/* Shared Matrixe visual language. Existing layout and visibility states stay with the app. */
html[data-page="dashboard"] {
  color-scheme: light;
  --bg: #faf9f3;
  --bg-primary: #faf9f3;
  --bg-secondary: #ffffff;
  --surface: #ffffff;
  --surface-hover: #f1f3f7;
  --text: #172f25;
  --text-primary: #172f25;
  --text-secondary: #52655a;
  --text-muted: #52655a;
  --border: #cfd6c9;
  --accent: #185337;
  --accent-color: #185337;
  --accent-hover: #103e29;
  --primary: #185337;
  --primary-color: #185337;
  --primary-hover: #103e29;
  --primary-light: #e1f1e6;
  --danger: #ba3440;
}

html[data-page="dashboard"] body {
  background: #faf9f3 !important;
  color: #172f25 !important;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  -webkit-font-smoothing: antialiased;
}
html[data-page="dashboard"] body :is(button, input, textarea, select) {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}
html[data-page="dashboard"] body button { border-radius: 10px; }
html[data-page="dashboard"] body :is(button, a, input, textarea, select):focus-visible {
  outline: 3px solid #18533752 !important;
  outline-offset: 3px;
}
html[data-page="dashboard"] body :is(.ambient-background, .noise-overlay) {
  visibility: hidden !important;
  pointer-events: none !important;
}
html[data-page="dashboard"] body header.top-header {
  background: #fff !important;
  border-bottom: 1px solid #cfd6c9 !important;
  box-shadow: none !important;
}
html[data-page="dashboard"] body header.top-header .hero-title.matrixe-wordmark,
html[data-page="dashboard"] body #chatView .hero-title.matrixe-wordmark {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-weight: 750 !important;
  letter-spacing: -1.2px !important;
  color: #172f25 !important;
  -webkit-text-fill-color: #172f25 !important;
  background: transparent !important;
  text-shadow: none !important;
}
html[data-page="dashboard"] body header.top-header .hero-title.matrixe-wordmark { font-size: 24px !important; }
html[data-page="dashboard"] body #chatView .hero-title.matrixe-wordmark { font-size: clamp(32px, 4vw, 44px) !important; line-height: 1.2 !important; }
html[data-page="dashboard"] body .matrixe-brand-dot {
  font-family: inherit !important;
  color: #185337 !important;
  -webkit-text-fill-color: #185337 !important;
  text-shadow: none !important;
}
html[data-page="dashboard"] body header.top-header .tabs {
  background: #f3f4f7 !important;
  border: 1px solid #e9ebf0 !important;
  box-shadow: none !important;
  border-radius: 11px !important;
}
html[data-page="dashboard"] body header.top-header .tab {
  color: #52655a !important;
  font-weight: 500 !important;
  border-radius: 8px !important;
  transition: background 140ms ease, color 140ms ease !important;
}
html[data-page="dashboard"] body header.top-header .tab.active {
  color: #185337 !important;
  background: #fff !important;
  box-shadow: 0 1px 3px #16203a0c !important;
}
html[data-page="dashboard"] body header.top-header .tab.active :is(svg, svg *, .tab-text) { color: #185337 !important; }
html[data-page="dashboard"] body header.top-header .tab:hover { background: #e9edf7 !important; color: #185337 !important; }
html[data-page="dashboard"] body header.top-header .btn-menu,
html[data-page="dashboard"] body header.top-header .btn-store-select,
html[data-page="dashboard"] body header.top-header .sp-btn-upgrade {
  background: #fff !important;
  border: 1px solid #cfd6c9 !important;
  color: #4f5a6d !important;
  box-shadow: none !important;
  border-radius: 10px !important;
}
html[data-page="dashboard"] body header.top-header .status-pill { background: #faf9f3 !important; border-color: #cfd6c9 !important; box-shadow: none !important; }
html[data-page="dashboard"] body .sidebar {
  background: #fff !important;
  color: #172f25 !important;
  border-right: 1px solid #cfd6c9 !important;
  box-shadow: none !important;
}
html[data-page="dashboard"] body .sidebar-header { border-color: #cfd6c9 !important; }
html[data-page="dashboard"] body .sidebar-header h2 { font-size: 13px !important; font-weight: 600 !important; color: #52655a !important; letter-spacing: 0 !important; text-transform: none !important; }
html[data-page="dashboard"] body :is(.chat-item, .chat-list-item) {
  color: #4f5a6d !important;
  border-radius: 10px !important;
  box-shadow: none !important;
}
html[data-page="dashboard"] body :is(.chat-item, .chat-list-item):hover { background: #f5f6f9 !important; }
html[data-page="dashboard"] body :is(.chat-item.active, .chat-list-item.active) { color: #185337 !important; background: #e1f1e6 !important; }
html[data-page="dashboard"] body :is(.btn-new-chat, .btn-premium-primary, .btn-primary, .input-submit-btn-grey, .c-send) {
  color: #fff !important;
  background: #185337 !important;
  border-color: #185337 !important;
  box-shadow: none !important;
  border-radius: 10px !important;
  text-shadow: none !important;
}
html[data-page="dashboard"] body :is(.btn-new-chat, .btn-premium-primary, .btn-primary, .input-submit-btn-grey, .c-send):hover { background: #103e29 !important; }
html[data-page="dashboard"] body :is(.btn-new-chat, .btn-premium-primary, .btn-primary, .input-submit-btn-grey, .c-send):disabled { opacity: .5; }
html[data-page="dashboard"] body :is(.glass-panel, .settings-card, .bot-card, .prompt-card, .knowledge-card, .feedback-card) {
  background: #fff !important;
  color: #172f25 !important;
  border: 1px solid #cfd6c9 !important;
  border-radius: 14px !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}
html[data-page="dashboard"] body :is(.page-title-premium, .section-header h2) { color: #172f25 !important; font-weight: 650 !important; letter-spacing: -.6px !important; }
html[data-page="dashboard"] body :is(.page-subtitle, .header-subtitle, .hero-subtitle) { color: #52655a !important; text-shadow: none !important; }
html[data-page="dashboard"] body #chatView .hero-container { background: transparent !important; box-shadow: none !important; }
html[data-page="dashboard"] body #chatView .hero-container::before,
html[data-page="dashboard"] body #chatView .hero-container::after { content: none !important; }
html[data-page="dashboard"] body :is(.hero-input-card, .input-wrapper-hero, .composer-bar) {
  background: #fff !important;
  border: 1px solid #d9dee7 !important;
  border-radius: 16px !important;
  box-shadow: 0 4px 18px #16203a06 !important;
  backdrop-filter: none !important;
}
html[data-page="dashboard"] body :is(.hero-input-card, .composer-bar):focus-within { border-color: #9ca9f3 !important; box-shadow: 0 0 0 3px #1853370b !important; }
html[data-page="dashboard"] body :is(.glass-input-large, .c-input) { color: #172f25 !important; background: transparent !important; font-size: 15px !important; line-height: 1.65 !important; }
html[data-page="dashboard"] body :is(.glass-input-large, .c-input)::placeholder { color: #929aa8 !important; }
html[data-page="dashboard"] body :is(.model-toggle-btn, .family-switch, .c-model) { background: #f4f5f8 !important; border-color: #cfd6c9 !important; color: #52655a !important; box-shadow: none !important; }
html[data-page="dashboard"] body .family-opt { color: #52655a !important; border-radius: 7px !important; }
html[data-page="dashboard"] body .family-opt.active { color: #185337 !important; background: #fff !important; box-shadow: 0 1px 3px #16203a0c !important; }
html[data-page="dashboard"] body .action-pill {
  border: 1px solid #cfd6c9 !important;
  background: #fff !important;
  color: #4f5a6d !important;
  border-radius: 10px !important;
  box-shadow: none !important;
  font-weight: 450 !important;
  font-size: 13px !important;
}
html[data-page="dashboard"] body .action-pill:hover { background: #e1f1e6 !important; color: #185337 !important; border-color: #cfd6fc !important; transform: none !important; }
html[data-page="dashboard"] body .hero-case-card {
  background: #fff !important;
  border: 1px solid #cfd6c9 !important;
  border-radius: 14px !important;
  box-shadow: none !important;
}
html[data-page="dashboard"] body .hero-case-card-title { color: #172f25 !important; font-weight: 600 !important; }
html[data-page="dashboard"] body .hero-case-card-tag { color: #52655a !important; }
html[data-page="dashboard"] body .hero-cases-tab { background: transparent !important; color: #52655a !important; border-radius: 8px !important; }
html[data-page="dashboard"] body .hero-cases-tab.active { color: #185337 !important; background: #e1f1e6 !important; }
html[data-page="dashboard"] body :is(.modal-content, .store-dropdown, .profile-dropdown, #profileDropdown) {
  background: #fff !important;
  color: #172f25 !important;
  border: 1px solid #cfd6c9 !important;
  border-radius: 14px !important;
  box-shadow: 0 18px 60px #16203a1a !important;
}
html[data-page="dashboard"] body :is(.modal-header, .modal-footer, .panel-header-premium, .panel-footer-premium) { border-color: #cfd6c9 !important; background: transparent !important; }
html[data-page="dashboard"] body :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]), select) {
  background-color: #fff !important;
  border-color: #d9dee7 !important;
  color: #172f25 !important;
  border-radius: 9px;
}
html[data-page="dashboard"] body :is(.sidebar-logout-btn, .btn-premium-secondary) { color: #52655a !important; background: #f5f6f9 !important; border-color: #cfd6c9 !important; box-shadow: none !important; }
html[data-page="dashboard"] body ::selection { color: #172f25; background: #dfe5ff; }

@media (max-width: 900px) {
  html[data-page="dashboard"] body header.top-header { padding-inline: 12px !important; gap: 10px !important; }
  html[data-page="dashboard"] body header.top-header .header-right { gap: 8px !important; }
  html[data-page="dashboard"] body header.top-header .tab { font-size: 12px !important; }
  html[data-page="dashboard"] body header.top-header .hero-title.matrixe-wordmark { font-size: 20px !important; }
  html[data-page="dashboard"] body #chatView .hero-subtitle { font-size: 14px !important; }
}
@media (prefers-reduced-motion: reduce) {
  html[data-page="dashboard"] body :is(button, a, input, textarea, .chat-item, .hero-case-card) { transition: none !important; }
}

html[data-page="dashboard"] body .main {
  background: url("/entry/paper-fibre.webp"), #faf9f3 !important;
}
html[data-page="dashboard"] body header.top-header .tabs,
html[data-page="dashboard"] body header.top-header .status-pill {
  background: #f1f4e9 !important;
  border-color: #d3ddcc !important;
}
html[data-page="dashboard"] body header.top-header .tabs button.tab.active {
  color: #174f34 !important;
  background: #dcebd9 !important;
  border-color: #c4d9bd !important;
}
html[data-page="dashboard"] body header.top-header #balanceDisplay {
  background: #205b3d !important;
  color: #fff !important;
  border-color: #205b3d !important;
}
html[data-page="dashboard"] body header.top-header button.tab.active :is(.tab-text,svg) { color:#174f34 !important; }
html[data-page="dashboard"] body #chatView #heroSendBtn,
html[data-page="dashboard"] body #composer #send { background: #205b3d !important; border-color: #205b3d !important; color:#fff !important; }
html[data-page="dashboard"] body #chatView #heroSendBtn:disabled,
html[data-page="dashboard"] body #composer #send:disabled { background:#c6d5c1 !important; border-color:#c6d5c1 !important; color:#354b39 !important; }
html[data-page="dashboard"] body .family-switch .family-opt.is-active .family-opt-name { color:#205b3d !important; }
html[data-page="dashboard"] body.hero-page:has(#chatView.active) .main { padding-top: 12px !important; }
html[data-page="dashboard"] body.hero-page #chatView #chatContainer { padding-top: 10px !important; }
html[data-page="dashboard"] body.hero-page #chatView #heroSection:not(.chat-active) {
  isolation: isolate; position: relative;
  padding-top: 28px !important;
}
html[data-page="dashboard"] body.hero-page #chatView #heroSection:not(.chat-active)::before {
  content: "" !important; display: block !important; z-index: -1;
  position: absolute !important; inset: 0 0 auto !important;
  height: 164px !important; width: auto !important; transform: none !important;
  opacity: 1 !important; filter: none !important; pointer-events: none;
  border: 1px solid #d1dfc9; border-radius: 17px;
  background: url("/entry/studio-order-book.webp") right 6% center / auto 77% no-repeat,
              url("/entry/paper-fibre.webp"), #e3eddc !important;
}
html[data-page="dashboard"] body.hero-page #chatView #heroSection > .hero-subtitle {
  color: #385640 !important; font-size: 16px !important;
}
html[data-page="dashboard"] body #chatView #heroSection .action-pill {
  background: #fffdf5 !important; border-color: #d2dac8 !important; white-space: normal !important;
}
html[data-page="dashboard"] body .view :is(.section-header h2,.bots-page-title,.page-title-premium,.knowledge-title,.fbv-title,.uv-title)::after {
  content: ""; display:inline-block; width:47px; height:40px; margin-inline-start:12px; vertical-align:-.3em;
  background: url("/entry/studio-order-book.webp") center / contain no-repeat; pointer-events:none;
}
html[data-page="dashboard"] body .view :is(.page-title-premium,.uv-title)::after { background-image:url("/entry/studio-shop-keys.webp"); }
html[data-page="dashboard"] body .view .bots-page-title::after { background-image:url("/entry/studio-shop-shelves.webp"); }
@media (min-width:901px) and (max-width:1180px) {
  html[data-page="dashboard"] body.hero-page #chatView #heroSection:not(.chat-active)::before {
    background-position:right 3% center,0 0,0 0 !important;
    background-size:auto 65%,200px 200px,auto !important;
  }
}
@media (max-width:900px) {
  html[data-page="dashboard"] body.hero-page:has(#chatView.active) .main { padding-top: 0 !important; }
  html[data-page="dashboard"] body.hero-page #chatView #heroSection:not(.chat-active) { padding-top:18px !important; }
  html[data-page="dashboard"] body.hero-page #chatView #heroSection:not(.chat-active)::before {
    height: 115px !important;
    background: url("/entry/paper-fibre.webp"),#e3eddc !important;
  }
  html[data-page="dashboard"] body #chatView #heroSection > .hero-subtitle { padding:0 12px; line-height:1.38 !important; }
  html[data-page="dashboard"] body .view :is(.section-header h2,.bots-page-title,.page-title-premium,.knowledge-title,.fbv-title,.uv-title)::after { width:31px; height:29px; margin-inline-start:6px; }
}
