/* ATREYA_THEME_CONTINUITY_T1
   Additive app theme bridge. Dark keeps the current application styling.
   Light applies the approved ivory / antique-gold Atreya language to common
   login, register, home, chat and profile surfaces without changing layout. */

html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }

html[data-theme="light"],
html[data-theme="light"] body {
  background: #fff9ee !important;
  color: #28180b !important;
}

html[data-theme="light"] body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 8%, rgba(246, 189, 75, .12), transparent 29%),
    radial-gradient(circle at 88% 18%, rgba(202, 136, 34, .08), transparent 24%),
    linear-gradient(180deg, #fffdf8 0%, #fff7e8 54%, #fffaf2 100%);
}

html[data-theme="light"] :where(
  .app-shell,.page,.page-shell,.auth-page,.auth-shell,.auth-wrap,.auth-panel,
  .main,.main-content,.content,.dashboard,.home-page,.profile-page,.chat-page
) {
  color: #28180b !important;
}

html[data-theme="light"] :where(
  .card,.profile-card,.context-card,.glass-card,.auth-card,.panel,.modal,.sheet,
  .hero-chat,.chat-window,.chat-compose,.topbar,.sidebar,.side-nav,.nav-panel,
  .feature-card,.stat-card,.quick-card,.mini-note,.subject-chip,.messages
) {
  background-color: rgba(255, 252, 245, .92) !important;
  color: #28180b !important;
  border-color: rgba(174, 112, 25, .24) !important;
  box-shadow: 0 16px 42px rgba(117, 70, 11, .08) !important;
}

html[data-theme="light"] :where(h1,h2,h3,h4,strong,b,.brand,.logo,.title) {
  color: #241507 !important;
}

html[data-theme="light"] :where(p,.muted,.subtext,.meta,.hint,small,.caption) {
  color: #765f43 !important;
}

html[data-theme="light"] :where(a,.link,.nav-link) {
  color: #965b07;
}

html[data-theme="light"] :where(input,textarea,select) {
  background: rgba(255,255,255,.96) !important;
  color: #27180b !important;
  border-color: rgba(174,112,25,.30) !important;
  caret-color: #9b610a;
}

html[data-theme="light"] :where(input,textarea)::placeholder {
  color: #9a886e !important;
}

html[data-theme="light"] :where(.btn-primary,.send-btn,.primary,.button-primary) {
  background: linear-gradient(135deg,#ffe39a,#e69d2d) !important;
  color: #1f1307 !important;
  border-color: rgba(168,103,15,.45) !important;
}

html[data-theme="light"] :where(.btn-soft,.btn-secondary,.secondary,.circle-btn:not(.send-btn)) {
  background: rgba(255,251,241,.92) !important;
  color: #6b430b !important;
  border-color: rgba(174,112,25,.26) !important;
}

html[data-theme="light"] :where(.badge,.subject-chip) {
  background: rgba(242,184,72,.11) !important;
  color: #774708 !important;
}

html[data-theme="light"] .msg.ai {
  background: #fff8ea !important;
  color: #32210d !important;
  border-color: rgba(174,112,25,.20) !important;
}

html[data-theme="light"] .msg.user {
  background: linear-gradient(135deg,#f5c965,#e7a53a) !important;
  color: #241606 !important;
}

.atreya-common-theme-toggle {
  position: fixed;
  z-index: 2147483000;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  min-width: 112px;
  height: 48px;
  padding: 6px 16px 6px 7px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(229,178,78,.46);
  border-radius: 999px;
  background: rgba(4,17,40,.90);
  color: #f7d886;
  box-shadow: 0 14px 38px rgba(0,0,0,.28), inset 0 1px rgba(255,255,255,.08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  font: 700 13px/1 Arial,sans-serif;
  letter-spacing: .02em;
  cursor: pointer;
}

.atreya-common-theme-toggle .atreya-theme-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg,#173b73,#071b3a);
  color: #ffe398;
  font-size: 19px;
  box-shadow: inset 0 0 0 1px rgba(255,221,139,.16);
}

html[data-theme="light"] .atreya-common-theme-toggle {
  background: rgba(255,251,241,.94);
  color: #69400a;
  border-color: rgba(174,112,25,.30);
  box-shadow: 0 14px 38px rgba(104,67,20,.15), inset 0 1px rgba(255,255,255,.85);
}

html[data-theme="light"] .atreya-common-theme-toggle .atreya-theme-icon {
  background: linear-gradient(145deg,#0a2d5c,#071a37);
  color: #ffe29a;
}

@media (max-width: 720px) {
  .atreya-common-theme-toggle {
    min-width: 48px;
    width: 48px;
    padding: 6px;
  }
  .atreya-common-theme-toggle .atreya-theme-label { display: none; }
}
