/* Salsteg themes — dark is the default, light is a session-scoped switch.
   One stylesheet for every page: html[data-theme="light"] repaints the shells. */

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

/* ---- theme switch, same spot on every page ---- */
.theme-toggle {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 15px 10px 13px;
  border-radius: 999px;
  font: 600 .82rem/1 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  letter-spacing: .01em;
  cursor: pointer;
  border: 1px solid #48D1A3;
  background: #20251f;
  color: #d8f5e9;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .45);
  transition: background .15s, border-color .15s, color .15s, transform .15s;
}
.theme-toggle:hover { transform: translateY(-1px); border-color: #2fae84; }
.theme-toggle:active { transform: translateY(0); }
/* inside a bar it becomes one more pill, and cannot sit on top of a button */
.theme-toggle.inline {
  position: static;
  inset: auto;
  padding: 7px 12px;
  border-radius: 999px;
  box-shadow: none;
  font: inherit;
  font-size: .78rem;
  font-weight: 600;
  background: transparent;
  color: inherit;
  border: 1px solid currentColor;
  opacity: .62;
}
.theme-toggle.inline:hover { opacity: 1; transform: none; color: #48D1A3; border-color: #2fae84; }
html[data-theme="light"] .theme-toggle.inline { background: transparent !important; box-shadow: none !important; color: #3d453f !important; border-color: #cfd8d1 !important; }
html[data-theme="light"] .theme-toggle.inline:hover { color: #12664c !important; border-color: #2fae84 !important; }

html[data-theme="light"] .theme-toggle {
  background: #ffffff;
  border-color: #d3d8d3;
  color: #178f6d;
  box-shadow: 0 6px 18px rgba(16, 24, 20, .12);
}

/* ============ light palette ============ */
html[data-theme="light"] body {
  background: #f4f6f4 !important;
  color: #171b18 !important;
}

/* ---- login ---- */
html[data-theme="light"] .card { background: #ffffff !important; box-shadow: 0 10px 30px rgba(16,24,20,.08); }
html[data-theme="light"] .card h1,
html[data-theme="light"] .card p.sub,
html[data-theme="light"] label { color: #171b18 !important; }
html[data-theme="light"] p.sub,
html[data-theme="light"] a.alt,
html[data-theme="light"] .sep { color: #5f6863 !important; }
html[data-theme="light"] input {
  background: #eef1ee !important;
  color: #171b18 !important;
  border: 1px solid #dfe4df !important;
}
html[data-theme="light"] input::placeholder { color: #8b948e !important; }
html[data-theme="light"] input:focus { background: #e7ebe8 !important; }
html[data-theme="light"] .eye { background: transparent !important; color: #5f6863 !important; }
html[data-theme="light"] .eye:hover { color: #171b18 !important; }
html[data-theme="light"] .sep::before,
html[data-theme="light"] .sep::after { background: #dfe4df !important; }
html[data-theme="light"] a.google { background: #eef1ee !important; color: #171b18 !important; }
html[data-theme="light"] a.google:hover { background: #e4e9e5 !important; }
html[data-theme="light"] .err { color: #b3261e !important; }
html[data-theme="light"] button.submit { background: #178f6d !important; }
html[data-theme="light"] button.submit:hover { background: #127a5d !important; }

/* ---- user dashboard ---- */
html[data-theme="light"] .topbar,
html[data-theme="light"] header { background: rgba(255,255,255,.9) !important; border-color: #dfe4df !important; }
html[data-theme="light"] .brand,
html[data-theme="light"] header h1,
html[data-theme="light"] .voice h2 { color: #171b18 !important; }
html[data-theme="light"] .brand .sub,
html[data-theme="light"] .voice p,
html[data-theme="light"] header .who { color: #5f6863 !important; }
html[data-theme="light"] .voice,
html[data-theme="light"] .panel { background: #ffffff !important; border-color: #e2e7e2 !important; }
html[data-theme="light"] .voice .ic { background: #eef2ef !important; color: #178f6d !important; }
html[data-theme="light"] .voice:hover { background: #fafbfa !important; }
html[data-theme="light"] .voice.locked { background: #fffaf0 !important; border-color: #e8d9b5 !important; }
html[data-theme="light"] .badge,
html[data-theme="light"] .tag { background: #e7f5ef !important; color: #12664c !important; }
html[data-theme="light"] .kv { border-color: #e2e7e2 !important; }
html[data-theme="light"] .kv .k { color: #5f6863 !important; }
html[data-theme="light"] .kv .v { color: #171b18 !important; }
html[data-theme="light"] header .out { background: #eef1ee !important; color: #3d453f !important; }
html[data-theme="light"] header .out:hover { background: #e4e9e5 !important; color: #171b18 !important; }

/* ---- admin tables ---- */
html[data-theme="light"] .topbar { background: #ffffff !important; border-bottom-color: #dfe4df !important; }
html[data-theme="light"] aside { background: #ffffff !important; border-right-color: #e2e7e2 !important; }
html[data-theme="light"] main { background: #f4f6f4 !important; }
html[data-theme="light"] aside h1,
html[data-theme="light"] main h2 { color: #171b18 !important; }
html[data-theme="light"] .tbl { color: #3d453f !important; }
html[data-theme="light"] .tbl:hover { background: #eef2ef !important; }
html[data-theme="light"] .tbl.active { background: #e7f5ef !important; color: #12664c !important; border-color: #bfe6d7 !important; }
html[data-theme="light"] .grid th { background: #eef1ee !important; color: #5f6863 !important; border-bottom-color: #dfe4df !important; }
html[data-theme="light"] .grid td { background: #ffffff !important; color: #232a25 !important; border-bottom-color: #edf0ed !important; }
html[data-theme="light"] .grid tbody tr:hover td { background: #f6f8f6 !important; }
html[data-theme="light"] .grid th:first-child,
html[data-theme="light"] .grid td:first-child { background: #ffffff !important; }
html[data-theme="light"] .grid thead th:first-child { background: #eef1ee !important; }
html[data-theme="light"] .grid input,
html[data-theme="light"] .f input,
html[data-theme="light"] .f select,
html[data-theme="light"] .f textarea { background: #ffffff !important; color: #171b18 !important; border: 1px solid #dfe4df !important; }
html[data-theme="light"] .modal .card,
html[data-theme="light"] .cbox { background: #ffffff !important; border-color: #e2e7e2 !important; }
html[data-theme="light"] .modal .card h3,
html[data-theme="light"] .cbox h3 { color: #171b18 !important; }
html[data-theme="light"] .f label,
html[data-theme="light"] .card label { color: #5f6863 !important; }
html[data-theme="light"] .btn { background: #eef1ee !important; color: #232a25 !important; border-color: #dfe4df !important; }
html[data-theme="light"] .btn:hover { background: #e4e9e5 !important; }
html[data-theme="light"] .btn-primary { background: #178f6d !important; color: #ffffff !important; border-color: #178f6d !important; }
html[data-theme="light"] .btn-primary:hover { background: #127a5d !important; }
html[data-theme="light"] .btn-danger { background: #fdecea !important; color: #b3261e !important; border-color: #f5c9c4 !important; }
html[data-theme="light"] #cmsg { background: #f4f6f4 !important; color: #232a25 !important; border-color: #e2e7e2 !important; }
html[data-theme="light"] .cbox p { color: #5f6863 !important; }
html[data-theme="light"] .cicon { background: #fdecea !important; color: #b3261e !important; }
html[data-theme="light"] .cbox p.cwarn { color: #9a5b12 !important; }
html[data-theme="light"] .msg { color: #5f6863 !important; }
html[data-theme="light"] .banner.show { background: #e7f5ef !important; color: #12664c !important; }
html[data-theme="light"] .burger { background: #eef1ee !important; color: #232a25 !important; }

/* ---- app / apps ---- */
html[data-theme="light"] .container {
  background: #ffffff !important;
  box-shadow: 0 12px 34px rgba(16,24,20,.08);
}
html[data-theme="light"] .version,
html[data-theme="light"] .info { color: #5f6863 !important; }
html[data-theme="light"] .info { background: #eef2ef !important; color: #12664c !important; }
html[data-theme="light"] .form-group label { color: #232a25 !important; }
html[data-theme="light"] textarea,
html[data-theme="light"] .form-group input,
html[data-theme="light"] .password-wrapper input {
  background: #eef1ee !important;
  color: #171b18 !important;
  border: 1px solid #dfe4df !important;
}
html[data-theme="light"] .drop-zone { background: #f7f9f7 !important; border-color: #cfd8d1 !important; }
html[data-theme="light"] .drop-zone:hover { background: #eef2ef !important; border-color: #2fae84 !important; }
html[data-theme="light"] .drop-zone-text { color: #232a25 !important; }
html[data-theme="light"] .drop-zone-formats { color: #7c857f !important; }
html[data-theme="light"] .drop-zone-icon { background: #e7f5ef !important; color: #178f6d !important; }
html[data-theme="light"] .mode-switch { background: #eef1ee !important; border-color: #dfe4df !important; }
html[data-theme="light"] .mode-btn { color: #5f6863 !important; }
html[data-theme="light"] .mode-btn.active { background: #ffffff !important; color: #12664c !important; }
html[data-theme="light"] .btn-secondary { background: #eef1ee !important; color: #232a25 !important; border-color: #dfe4df !important; }
html[data-theme="light"] .result { color: #232a25 !important; }
html[data-theme="light"] .result.success { background: #e7f5ef !important; color: #12664c !important; }
html[data-theme="light"] .result.error { background: #fdecea !important; color: #b3261e !important; }
html[data-theme="light"] .progress { background: #eef1ee !important; }
html[data-theme="light"] .progress-bar { background: linear-gradient(90deg, #178f6d, #48D1A3) !important; }
html[data-theme="light"] .password-generate-btn,
html[data-theme="light"] .btn-secondary-wrap .btn-secondary,
html[data-theme="light"] #generatedPasswordBox { background: #eef1ee !important; color: #171b18 !important; }
html[data-theme="light"] .brand,
html[data-theme="light"] .topbar .brand span { color: #171b18 !important; }
html[data-theme="light"] .topbar { background: #ffffff !important; }
html[data-theme="light"] a.logout { color: #5f6863 !important; }
html[data-theme="light"] a.back { background: #eef1ee !important; border-color: #dfe4df !important; color: #171b18 !important; }
html[data-theme="light"] a.back:hover { background: #e4e9e5 !important; color: #12664c !important; border-color: #2fae84 !important; }

/* ---- chat ---- */
html[data-theme="light"] {
  --bg: #f4f6f4;
  --panel: #ffffff;
  --panel-2: #eef1ee;
  --line: #e0e5e0;
  --muted: #4f5852;
  --bubble: #ffffff;
  --bubble-mine: #d8f0e6;
}
html[data-theme="light"] .topbar { background: rgba(255,255,255,.92) !important; }
html[data-theme="light"] .brand .sub,
html[data-theme="light"] .person .last,
html[data-theme="light"] .person .when,
html[data-theme="light"] .pane-head .st,
html[data-theme="light"] .list-head h1,
html[data-theme="light"] .empty,
html[data-theme="light"] .composer .note { color: #5f6863 !important; }
html[data-theme="light"] .av { background: #e7f5ef !important; color: #12664c !important; }
html[data-theme="light"] .bubble { color: #171b18 !important; border: 1px solid #e6ebe6; }
html[data-theme="light"] .row.mine .bubble { background: #d8f0e6 !important; border-color: #bfe6d7; }
html[data-theme="light"] .bubble .t { color: #6b736d !important; }
html[data-theme="light"] .doc { background: #f2f5f2 !important; border-color: #dfe4df !important; }
html[data-theme="light"] .row.mine .doc { background: #ffffff !important; border-color: #bfe6d7 !important; }
html[data-theme="light"] .doc .ic { background: #e7f5ef !important; color: #12664c !important; }
html[data-theme="light"] .shot .acts .dl { background: rgba(23,27,24,.62) !important; }
html[data-theme="light"] .daysep { background: #ffffff !important; color: #5f6863 !important; }
html[data-theme="light"] .composer { background: #ffffff !important; }
html[data-theme="light"] .search input,
html[data-theme="light"] .composer-row textarea { background: #ffffff !important; color: #171b18 !important; }
html[data-theme="light"] .icon-btn { background: #eef1ee !important; color: #3d453f !important; }
html[data-theme="light"] .send-btn { background: #178f6d !important; border-color: #178f6d !important; color: #ffffff !important; }
html[data-theme="light"] .person:hover { background: #f7f9f7 !important; }
html[data-theme="light"] .person.active { background: #e7f5ef !important; }
html[data-theme="light"] .empty svg { color: #cfd8d1 !important; }

/* ---- guide ---- */
html[data-theme="light"] {
  --ink: #f4f6f4;
  --ink-2: #ffffff;
  --ink-3: #eef2ef;
  --line: #e0e5e0;
  --line-2: #d3d8d3;
  --text: #171b18;
  --muted: #4f5852;
  --faint: #78827b;
  --mint: #178f6d;
  --mint-deep: #12664c;
  --amber: #9a5b12;
  --amber-bg: #fff8ec;
}
html[data-theme="light"] .layer.l1 { background: linear-gradient(135deg, #f7f9f7, #eef2ef) !important; }
html[data-theme="light"] .layer.l3 { border-color: #2fae84 !important; }
html[data-theme="light"] .layer.l3 .ico { background: #178f6d !important; color: #ffffff !important; }
html[data-theme="light"] .callout.warn { border-color: #ecd9b6 !important; color: #7a4a0f !important; }
html[data-theme="light"] .callout.warn b { color: #5c3308 !important; }
html[data-theme="light"] .callout.warn svg { color: #9a5b12 !important; }

@media (max-width: 600px) {
  .theme-toggle { right: 14px; bottom: 14px; }
  html[data-theme="light"] header .out { background: #eef1ee !important; }
}

/* who is signed in: sits left of the theme switch and Logout */
.who-name {
    font-size: .78rem; color: var(--muted); max-width: 34vw;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    align-self: center;
}

/* live brute-force estimate next to the Encryption Key label */
.keystrength { font-weight: 400; font-size: .78rem; letter-spacing: 0; margin-left: 8px; opacity: .95;
               text-transform: none;
               color: #8d9993; }
.keystrength[data-level="weak"] { color: #ff8f7f; }
.keystrength[data-level="ok"] { color: #e3b341; }
.keystrength[data-level="strong"] { color: #5fd0a0; }
html[data-theme="light"] .keystrength { color: #6a756f; }
html[data-theme="light"] .keystrength[data-level="weak"] { color: #bf3a2b; }
html[data-theme="light"] .keystrength[data-level="ok"] { color: #8a6400; }
html[data-theme="light"] .keystrength[data-level="strong"] { color: #0f7f5b; }

/* bruteforce_meter (sys_properties): off hides the estimate without any layout shift */
html[data-bruteforce="off"] .keystrength { display: none; }
