/*
 * DECYGO internal UI
 * Visual layer only. This file does not define behavior, routes or data.
 */

:root {
  --decygo-navy: #062e6f;
  --decygo-blue: #176cc7;
  --decygo-blue-strong: #0b5db5;
  --decygo-sky: #eaf4ff;
  --decygo-ink: #173b64;
  --decygo-copy: #5e7892;
  --decygo-line: #d8e5f0;
  --decygo-surface: #f4f8fc;
  --decygo-white: #ffffff;
}

/* Login */

body:has(#authView:not(.hidden)) {
  min-width: 320px;
  overflow-x: hidden;
  background: var(--decygo-navy);
}

body:has(#authView:not(.hidden)) .landing-header {
  display: none !important;
}

#authView:not(.hidden) {
  min-height: 100dvh;
  background: var(--decygo-navy) !important;
  color: var(--decygo-ink);
}

#authView:not(.hidden) .auth-wrap {
  position: relative;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(22px, 5vw, 64px) 18px;
  box-sizing: border-box;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 9% 12%, rgba(125, 202, 255, .18), transparent 25%),
    radial-gradient(circle at 92% 88%, rgba(32, 126, 218, .28), transparent 31%),
    var(--decygo-navy);
}

#authView:not(.hidden) .auth-wrap::before,
#authView:not(.hidden) .auth-wrap::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border: 1px solid rgba(180, 222, 255, .16);
  border-radius: 50%;
  z-index: -1;
}

#authView:not(.hidden) .auth-wrap::before {
  width: min(48vw, 560px);
  height: min(48vw, 560px);
  left: max(-18vw, -220px);
  top: max(-24vw, -250px);
}

#authView:not(.hidden) .auth-wrap::after {
  width: min(36vw, 420px);
  height: min(36vw, 420px);
  right: max(-14vw, -180px);
  bottom: max(-18vw, -190px);
}

#authView:not(.hidden) .auth-card {
  position: relative;
  width: min(100%, 466px);
  box-sizing: border-box;
  margin: 0;
  padding: clamp(28px, 4vw, 40px);
  border: 1px solid rgba(215, 230, 242, .95);
  border-radius: 18px;
  background: var(--decygo-white);
  box-shadow: 0 28px 70px rgba(3, 23, 56, .24);
}

#authView:not(.hidden) .auth-card::before {
  content: "";
  display: block;
  width: 142px;
  height: 38px;
  margin: 0 0 31px;
  border: 0 !important;
  border-radius: 0 !important;
  background: url("decygo-logo-transparent.png") left center / contain no-repeat !important;
  box-shadow: none !important;
}

#authView:not(.hidden) .auth-back {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin: 0 0 20px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #6b849c;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  transition: color .16s ease;
}

#authView:not(.hidden) .auth-back:hover {
  color: var(--decygo-blue);
}

#authView:not(.hidden) .auth-card h1 {
  margin: 0 0 9px;
  color: var(--decygo-navy);
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 850;
  line-height: 1.04;
  letter-spacing: -.055em;
}

#authView:not(.hidden) .auth-card > p {
  margin: 0 0 24px;
  color: var(--decygo-copy);
  font-size: 13px;
  line-height: 1.55;
}

#authView:not(.hidden) .auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin: 0 0 22px;
  padding: 4px;
  border: 1px solid #dce9f4;
  border-radius: 10px;
  background: #f1f6fb;
}

#authView:not(.hidden) .auth-tabs button {
  min-height: 38px;
  padding: 7px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #6d849a;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: color .16s ease, background-color .16s ease, box-shadow .16s ease;
}

#authView:not(.hidden) .auth-tabs button.active {
  color: var(--decygo-navy);
  background: #ffffff;
  box-shadow: 0 2px 7px rgba(16, 53, 91, .1);
}

#authView:not(.hidden) .field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0 0 16px;
}

#authView:not(.hidden) .field label {
  color: #315574;
  font-size: 12px;
  font-weight: 800;
}

#authView:not(.hidden) .field input {
  width: 100%;
  min-height: 48px;
  box-sizing: border-box;
  padding: 12px 13px;
  border: 1px solid #cbdce9;
  border-radius: 9px;
  outline: 0;
  background: #ffffff;
  color: #173b64;
  font: inherit;
  font-size: 14px;
  transition: border-color .16s ease, box-shadow .16s ease;
}

#authView:not(.hidden) .field input::placeholder {
  color: #95aabd;
}

#authView:not(.hidden) .field input:focus {
  border-color: #67a9df;
  box-shadow: 0 0 0 3px rgba(23, 108, 199, .13);
}

#authView:not(.hidden) .btn.btn-wide,
#authView:not(.hidden) #authSubmit {
  width: 100%;
  min-height: 48px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 850;
}

#authView:not(.hidden) #authSubmit,
#authView:not(.hidden) .btn.btn-dark {
  border: 1px solid var(--decygo-blue);
  background: var(--decygo-blue);
  color: #ffffff;
  box-shadow: 0 8px 16px rgba(23, 108, 199, .18);
}

#authView:not(.hidden) #authSubmit:hover,
#authView:not(.hidden) .btn.btn-dark:hover {
  background: var(--decygo-blue-strong);
}

#authView:not(.hidden) .auth-divider {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 21px 0 13px;
  color: #8aa0b3;
  font-size: 11px;
}

#authView:not(.hidden) .auth-divider::before,
#authView:not(.hidden) .auth-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: #e0eaf2;
}

#authView:not(.hidden) .google-auth-btn {
  width: 100%;
  min-height: 48px;
  box-sizing: border-box;
  border: 1px solid #c6d8e7;
  border-radius: 9px;
  background: #ffffff;
  color: #234563;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 3px 10px rgba(7, 42, 79, .05);
  transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
}

#authView:not(.hidden) .google-auth-btn:hover {
  border-color: #8eb8d9;
  background: #f7fbff;
  box-shadow: 0 7px 16px rgba(7, 42, 79, .08);
}

#authView:not(.hidden) .google-auth-btn svg {
  width: 18px;
  height: 18px;
}

#authView:not(.hidden) .auth-forgot {
  display: block;
  margin: 16px auto 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--decygo-blue);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

#authView:not(.hidden) .auth-resend {
  margin-top: 10px;
  border: 1px solid #cbddea;
  background: #f6fbff;
  color: var(--decygo-blue);
}

#authView:not(.hidden) .form-message,
#authView:not(.hidden) .recovery-message {
  margin: 12px 0;
  padding: 11px 12px;
  border: 1px solid #d7e5ef;
  border-radius: 9px;
  background: #f5f9fc;
  color: #4b6780;
  font-size: 12px;
  line-height: 1.45;
}

#authView:not(.hidden) .form-message.error {
  border-color: #efcaca;
  background: #fff7f7;
  color: #a23d48;
}

#authView:not(.hidden) .form-message.success {
  border-color: #bfe4d5;
  background: #f3fbf7;
  color: #28765e;
}

#authView:not(.hidden) .recovery-panel {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #d5e5f1;
  border-radius: 11px;
  background: #f7fbff;
}

#authView:not(.hidden) .auth-note {
  max-width: 330px;
  margin: 20px auto 0 !important;
  color: #8a9eae !important;
  font-size: 11px !important;
  line-height: 1.5;
  text-align: center;
}

/* Internal shell and shared surfaces */

body:has(#appView:not(.hidden)) {
  min-width: 320px;
  overflow-x: hidden;
  background: var(--decygo-surface);
}

#appView:not(.hidden) {
  display: block !important;
  min-height: 100dvh;
  overflow: visible !important;
  background: var(--decygo-surface) !important;
  color: var(--decygo-ink);
}

#appView:not(.hidden) .app-shell,
#appView:not(.hidden) .app-main,
#appView:not(.hidden) .app-content {
  min-height: 100dvh;
  background: var(--decygo-surface) !important;
}

#appView:not(.hidden) .app-shell {
  display: block !important;
  height: auto !important;
  overflow: visible !important;
}

/* The old shell remains available to the existing navigation logic.
   The chat workspace is the visible internal navigation surface. */

#appView:not(.hidden) .app-nav,
#appView:not(.hidden) .app-top {
  display: none !important;
}

#appView:not(.hidden) .app-content {
  position: relative;
  height: auto !important;
  overflow: visible !important;
  padding: 0 !important;
}

#appView:not(.hidden) #homeModule {
  min-height: 100dvh !important;
}

#appView:not(.hidden) #homeModule .assistant {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100dvh !important;
  height: auto !important;
  overflow: visible !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: var(--decygo-surface) !important;
  box-shadow: none !important;
}

#appView:not(.hidden) .chat-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex !important;
  align-items: center;
  gap: 13px;
  min-height: 72px;
  box-sizing: border-box;
  padding: 13px clamp(16px, 4vw, 48px) !important;
  border-bottom: 1px solid #dce8f2 !important;
  background: #ffffff !important;
  color: var(--decygo-navy) !important;
  box-shadow: 0 3px 12px rgba(12, 53, 93, .035) !important;
}

#appView:not(.hidden) .chat-brand-logo {
  flex: 0 0 auto;
  width: 116px;
  height: 38px;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent url("decygo-logo-transparent.png") left center / contain no-repeat !important;
  box-shadow: none !important;
}

#appView:not(.hidden) .chat-brand-logo img {
  width: 100%;
  height: 100%;
  opacity: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
}

#appView:not(.hidden) .chat-workspace {
  min-width: 0;
  padding-left: 14px;
  border-left: 1px solid #dce8f2;
}

#appView:not(.hidden) .chat-workspace-label {
  display: block;
  margin-bottom: 3px;
  color: #7e96aa !important;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .1em;
  text-transform: uppercase;
}

#appView:not(.hidden) .chat-workspace strong {
  display: block;
  overflow: hidden;
  max-width: min(26vw, 220px);
  color: var(--decygo-navy) !important;
  font-size: 14px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#appView:not(.hidden) .chat-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  color: #2d7f62 !important;
  font-size: 11px;
  font-weight: 800;
}

#appView:not(.hidden) .chat-live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #35b67d !important;
  box-shadow: 0 0 0 4px rgba(53, 182, 125, .12) !important;
}

#appView:not(.hidden) .chat-account {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 5px 9px 5px 6px;
  border: 1px solid #d4e3ee !important;
  border-radius: 9px;
  background: #ffffff !important;
  color: var(--decygo-ink) !important;
  font-size: 11px;
  font-weight: 800;
}

#appView:not(.hidden) .chat-account-avatar {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 7px;
  background: var(--decygo-sky) !important;
  color: var(--decygo-blue) !important;
  font-size: 11px;
  font-weight: 900;
}

#appView:not(.hidden) .chat-segments {
  position: sticky;
  top: 72px;
  z-index: 35;
  display: flex;
  align-items: stretch;
  gap: 5px;
  min-height: 54px;
  box-sizing: border-box;
  padding: 0 clamp(16px, 4vw, 48px) !important;
  overflow-x: auto;
  overflow-y: hidden;
  border-bottom: 1px solid #dce8f2 !important;
  background: #ffffff !important;
  box-shadow: none !important;
  scrollbar-width: none;
}

#appView:not(.hidden) .chat-segments::-webkit-scrollbar {
  display: none;
}

#appView:not(.hidden) .chat-segment {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 54px;
  padding: 0 14px;
  border: 0 !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #71879b !important;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition: color .16s ease, border-color .16s ease, background-color .16s ease;
}

#appView:not(.hidden) .chat-segment:hover {
  color: var(--decygo-blue) !important;
  background: #f7fbff !important;
}

#appView:not(.hidden) .chat-segment.active {
  border-bottom-color: var(--decygo-blue) !important;
  color: var(--decygo-blue) !important;
  background: transparent !important;
  box-shadow: none !important;
}

#appView:not(.hidden) .chat-segment svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

#appView:not(.hidden) .chat-intro {
  flex: 0 0 auto;
  box-sizing: border-box;
  padding: clamp(26px, 4vw, 46px) clamp(16px, 4vw, 48px) 23px !important;
  border-bottom: 1px solid #e1ebf3;
  background: #f4f8fc !important;
}

#appView:not(.hidden) .chat-intro .kicker {
  margin-bottom: 9px;
  color: #6e9dcc !important;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .14em;
}

#appView:not(.hidden) .chat-intro h3 {
  max-width: 760px;
  margin: 0 0 8px;
  color: var(--decygo-navy) !important;
  font-size: clamp(27px, 4vw, 40px);
  font-weight: 850;
  line-height: 1.02;
  letter-spacing: -.06em;
}

#appView:not(.hidden) .chat-intro p {
  max-width: 720px;
  margin: 0;
  color: #607b95 !important;
  font-size: 13px;
  line-height: 1.55;
}

#appView:not(.hidden) .voice-launcher {
  width: min(100%, 420px);
  min-height: 54px;
  box-sizing: border-box;
  margin-top: 20px;
  padding: 8px 12px 8px 8px;
  border: 1px solid #cfe0ec !important;
  border-radius: 12px;
  background: #ffffff !important;
  box-shadow: 0 6px 16px rgba(6, 46, 111, .05) !important;
}

#appView:not(.hidden) .voice-orb {
  width: 42px;
  height: 42px;
  background: var(--decygo-blue) !important;
  box-shadow: none !important;
}

#appView:not(.hidden) .voice-orb::before,
#appView:not(.hidden) .voice-orb::after {
  display: none !important;
}

#appView:not(.hidden) .voice-orb-core {
  width: 13px;
  height: 13px;
  background: #ffffff;
  box-shadow: none;
}

#appView:not(.hidden) .voice-launcher-copy strong {
  color: var(--decygo-navy) !important;
  font-size: 12px;
}

#appView:not(.hidden) .voice-launcher-copy span {
  color: #6b8399 !important;
  font-size: 10px;
}

#appView:not(.hidden) .chat-thread {
  flex: 0 0 auto;
  min-height: 270px !important;
  box-sizing: border-box;
  padding: 26px clamp(16px, 4vw, 48px) 34px !important;
  background: #f8fbfe !important;
  overflow: visible !important;
}

#appView:not(.hidden) .chat-day {
  margin: 0 auto 17px;
  color: #92a8ba;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .16em;
  text-align: center;
}

#appView:not(.hidden) .chat-message {
  width: min(100%, 920px);
  margin: 0 auto 16px;
  gap: 10px;
}

#appView:not(.hidden) .chat-avatar {
  flex: 0 0 auto;
  width: 31px;
  height: 31px;
  border-radius: 9px;
  background: var(--decygo-sky) !important;
  color: var(--decygo-blue) !important;
  font-size: 12px;
  font-weight: 900;
}

#appView:not(.hidden) .chat-bubble {
  max-width: min(720px, 90%);
  padding: 15px 16px;
  border: 1px solid #d9e6f0 !important;
  border-radius: 13px !important;
  background: #ffffff !important;
  color: #284967 !important;
  box-shadow: 0 5px 14px rgba(8, 49, 91, .04) !important;
  font-size: 13px;
  line-height: 1.55;
}

#appView:not(.hidden) .chat-bubble p {
  margin: 0 0 9px;
}

#appView:not(.hidden) .chat-bubble p:last-child {
  margin-bottom: 0;
}

#appView:not(.hidden) .user-message .chat-bubble {
  border-color: var(--decygo-blue) !important;
  background: var(--decygo-blue) !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

#appView:not(.hidden) .chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 13px;
}

#appView:not(.hidden) .chat-suggestions button,
#appView:not(.hidden) .chat-quick-row button {
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid #cbddea !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  color: var(--decygo-blue) !important;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease;
}

#appView:not(.hidden) .chat-suggestions button:hover,
#appView:not(.hidden) .chat-quick-row button:hover {
  border-color: #91b9d8 !important;
  background: #f1f8ff !important;
}

#appView:not(.hidden) .chat-meta {
  display: block;
  margin-top: 11px;
  color: #8aa0b3 !important;
  font-size: 9px;
}

#appView:not(.hidden) .chat-composer-wrap {
  position: sticky;
  bottom: 0;
  z-index: 30;
  flex: 0 0 auto;
  box-sizing: border-box;
  padding: 14px clamp(16px, 4vw, 48px) 18px !important;
  border-top: 1px solid #dce8f2 !important;
  background: rgba(255, 255, 255, .97) !important;
}

#appView:not(.hidden) .chat-composer {
  width: min(100%, 1040px);
  min-height: 58px;
  box-sizing: border-box;
  margin: 0 auto;
  padding: 7px;
  border: 1px solid #bfd4e4 !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  box-shadow: 0 7px 20px rgba(6, 46, 111, .07) !important;
}

#appView:not(.hidden) .chat-composer textarea {
  min-height: 40px;
  padding: 11px 8px;
  color: #183e63 !important;
  font-size: 13px;
  line-height: 1.4;
}

#appView:not(.hidden) .chat-composer textarea::placeholder {
  color: #91a8ba !important;
}

#appView:not(.hidden) .chat-tool {
  width: 39px;
  height: 39px;
  border: 0 !important;
  border-radius: 8px !important;
  background: var(--decygo-sky) !important;
  color: var(--decygo-blue) !important;
}

#appView:not(.hidden) .chat-send {
  width: 40px;
  height: 40px;
  border: 0 !important;
  border-radius: 8px !important;
  background: var(--decygo-blue) !important;
  color: #ffffff !important;
  font-size: 18px;
}

#appView:not(.hidden) .chat-helper {
  display: flex;
  justify-content: space-between;
  width: min(100%, 1040px);
  box-sizing: border-box;
  margin: 6px auto 0;
  padding: 0 3px;
  color: #8298aa !important;
  font-size: 10px;
}

#appView:not(.hidden) .chat-quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  width: min(100%, 1040px);
  box-sizing: border-box;
  margin: 9px auto 0;
}

/* Desktop tools rail */

@media (min-width: 701px) {
  #appView:not(.hidden) #homeModule .chat-tools-rail {
    position: fixed !important;
    top: 72px !important;
    bottom: 0 !important;
    left: 0 !important;
    z-index: 50 !important;
    display: flex !important;
    flex-direction: column;
    width: 292px !important;
    max-width: 292px !important;
    height: calc(100dvh - 72px) !important;
    min-height: 0 !important;
    box-sizing: border-box;
    margin: 0 !important;
    padding: 22px 15px 16px !important;
    overflow: hidden !important;
    border: 0 !important;
    border-right: 1px solid #d7e5ef !important;
    border-radius: 0 !important;
    background: #ffffff !important;
    box-shadow: 8px 0 24px rgba(8, 48, 90, .045) !important;
  }

  #appView:not(.hidden) #homeModule .chat-segments,
  #appView:not(.hidden) #homeModule .chat-intro,
  #appView:not(.hidden) #homeModule .chat-thread,
  #appView:not(.hidden) #homeModule .chat-composer-wrap,
  #appView:not(.hidden) #homeModule .chat-segment-panel {
    width: calc(100% - 292px) !important;
    max-width: none !important;
    margin-left: 292px !important;
    box-sizing: border-box;
  }

  #appView:not(.hidden) #homeModule .chat-tools-rail .chat-tools-rail-head {
    flex: 0 0 auto;
    padding: 0 4px 15px;
    border-bottom: 1px solid #e0eaf2;
  }

  #appView:not(.hidden) #homeModule .chat-tools-rail-kicker {
    color: #7590a8 !important;
    font-size: 9px;
    letter-spacing: .12em;
  }

  #appView:not(.hidden) #homeModule .chat-tools-rail-title {
    margin-top: 4px;
    color: var(--decygo-navy) !important;
    font-size: 18px;
    letter-spacing: -.04em;
  }

  #appView:not(.hidden) #homeModule .chat-tools-rail-subtitle {
    margin-top: 4px;
    color: #7891a6 !important;
    font-size: 10px;
    line-height: 1.4;
  }

  #appView:not(.hidden) #homeModule .chat-tools-rail-actions {
    gap: 4px;
  }

  #appView:not(.hidden) #homeModule .chat-tools-rail-arrow,
  #appView:not(.hidden) #homeModule .chat-tools-sidebar-close {
    display: none !important;
  }

  #appView:not(.hidden) #homeModule .chat-tools-rail .chat-tools-cards {
    display: grid;
    grid-auto-flow: row;
    grid-auto-columns: auto;
    grid-auto-rows: minmax(61px, auto);
    flex: 1 1 auto;
    min-height: 0;
    margin-top: 13px;
    padding: 2px 2px 10px;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    scroll-snap-type: y proximity;
    scrollbar-color: #9ebbd3 #f4f8fc;
    scrollbar-width: thin;
    touch-action: pan-y;
  }

  #appView:not(.hidden) #homeModule .chat-tools-cards::-webkit-scrollbar {
    display: block;
    width: 7px;
  }

  #appView:not(.hidden) #homeModule .chat-tools-cards::-webkit-scrollbar-track {
    border-radius: 9px;
    background: #f4f8fc;
  }

  #appView:not(.hidden) #homeModule .chat-tools-cards::-webkit-scrollbar-thumb {
    border: 2px solid #f4f8fc;
    border-radius: 9px;
    background: #9ebbd3;
  }

  #appView:not(.hidden) #homeModule .chat-tool-card {
    min-height: 61px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 9px;
    padding: 9px 8px;
    border: 1px solid #dce8f1 !important;
    border-radius: 10px !important;
    background: #ffffff !important;
    box-shadow: none !important;
    scroll-snap-align: start;
  }

  #appView:not(.hidden) #homeModule .chat-tool-card:hover {
    transform: none;
    border-color: #9fc3df !important;
    background: #f7fbff !important;
  }

  #appView:not(.hidden) #homeModule .chat-tool-card-icon {
    width: 31px;
    height: 31px;
    border-radius: 8px;
    background: var(--decygo-sky) !important;
    color: var(--decygo-blue) !important;
  }

  #appView:not(.hidden) #homeModule .chat-tool-card-copy b {
    color: #173f69 !important;
    font-size: 12px;
  }

  #appView:not(.hidden) #homeModule .chat-tool-card-copy small {
    margin-top: 3px;
    color: #7d94a8 !important;
    font-size: 10px;
    line-height: 1.25;
  }

  #appView:not(.hidden) #homeModule .chat-tool-card-go {
    color: #6fa4cd !important;
    font-size: 15px;
  }
}

/* Mobile tools drawer */

@media (max-width: 700px) {
  #appView:not(.hidden) .chat-topbar {
    min-height: 66px;
    padding: 10px 12px !important;
  }

  #appView:not(.hidden) .chat-brand-logo {
    width: 94px;
    height: 32px;
  }

  #appView:not(.hidden) .chat-workspace {
    padding-left: 9px;
  }

  #appView:not(.hidden) .chat-workspace-label {
    font-size: 8px;
  }

  #appView:not(.hidden) .chat-workspace strong {
    max-width: 28vw;
    font-size: 12px;
  }

  #appView:not(.hidden) .chat-live {
    display: none;
  }

  #appView:not(.hidden) .chat-account {
    min-height: 34px;
    padding-right: 6px;
  }

  #appView:not(.hidden) .chat-account-label {
    display: none;
  }

  #appView:not(.hidden) .chat-account-avatar {
    width: 26px;
    height: 26px;
  }

  #appView:not(.hidden) .chat-segments {
    top: 66px;
    min-height: 49px;
    padding: 0 10px !important;
  }

  #appView:not(.hidden) .chat-segment {
    min-height: 49px;
    padding: 0 11px;
    font-size: 11px;
  }

  #appView:not(.hidden) .chat-intro {
    padding: 22px 14px 18px !important;
  }

  #appView:not(.hidden) .chat-intro h3 {
    font-size: 30px;
  }

  #appView:not(.hidden) .chat-intro p {
    font-size: 12px;
  }

  #appView:not(.hidden) .voice-launcher {
    margin-top: 16px;
  }

  #appView:not(.hidden) .chat-thread {
    min-height: 220px !important;
    padding: 20px 12px 26px !important;
  }

  #appView:not(.hidden) .chat-message {
    gap: 7px;
  }

  #appView:not(.hidden) .chat-bubble {
    max-width: calc(100% - 39px);
    padding: 13px 13px;
    font-size: 12px;
  }

  #appView:not(.hidden) .chat-composer-wrap {
    padding: 10px 10px 13px !important;
  }

  #appView:not(.hidden) .chat-composer {
    min-height: 54px;
  }

  #appView:not(.hidden) .chat-composer textarea {
    font-size: 12px;
  }

  #appView:not(.hidden) .chat-helper {
    font-size: 9px;
  }

  #appView:not(.hidden) #homeModule .chat-sidebar-toggle {
    display: inline-flex !important;
  }

  #appView:not(.hidden) #homeModule .chat-tools-rail {
    position: fixed !important;
    top: 66px !important;
    bottom: 0 !important;
    left: 0 !important;
    z-index: 90 !important;
    display: flex !important;
    flex-direction: column;
    width: min(314px, calc(100vw - 38px)) !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
    box-sizing: border-box;
    margin: 0 !important;
    padding: 18px 12px 13px !important;
    overflow: hidden !important;
    border: 1px solid #d5e4ef !important;
    border-left: 0 !important;
    border-radius: 0 14px 14px 0 !important;
    background: #ffffff !important;
    box-shadow: 16px 0 34px rgba(6, 46, 111, .18) !important;
    transform: translateX(-106%);
    transition: transform .22s ease;
  }

  #appView:not(.hidden) #homeModule .tools-sidebar-open .chat-tools-rail,
  #appView:not(.hidden) #homeModule.tools-sidebar-open .chat-tools-rail {
    transform: translateX(0);
  }

  #appView:not(.hidden) #homeModule .chat-tools-rail .chat-tools-rail-head {
    flex: 0 0 auto;
    padding: 0 2px 14px;
    border-bottom: 1px solid #e0eaf2;
  }

  #appView:not(.hidden) #homeModule .chat-tools-rail-title {
    font-size: 17px;
  }

  #appView:not(.hidden) #homeModule .chat-tools-rail-subtitle {
    font-size: 10px;
  }

  #appView:not(.hidden) #homeModule .chat-tools-rail-arrow {
    display: none !important;
  }

  #appView:not(.hidden) #homeModule .chat-tools-sidebar-close {
    display: grid !important;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1px solid #cbdde9 !important;
    border-radius: 8px;
    background: #f5f9fd !important;
    color: var(--decygo-blue) !important;
    font-size: 20px;
    line-height: 1;
  }

  #appView:not(.hidden) #homeModule .chat-tools-rail .chat-tools-cards {
    display: grid;
    grid-auto-flow: row;
    grid-auto-columns: auto;
    grid-auto-rows: minmax(64px, auto);
    flex: 1 1 auto;
    min-height: 0;
    margin-top: 13px;
    padding: 2px 2px 10px;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    scroll-snap-type: y proximity;
    touch-action: pan-y;
  }

  #appView:not(.hidden) #homeModule .chat-tool-card {
    min-height: 64px;
    padding: 10px 9px;
    border: 1px solid #dce8f1 !important;
    border-radius: 10px !important;
    background: #ffffff !important;
    box-shadow: none !important;
  }

  #appView:not(.hidden) #homeModule .chat-tool-card-copy b {
    color: #173f69 !important;
    font-size: 12px;
  }

  #appView:not(.hidden) #homeModule .chat-tool-card-copy small {
    color: #7d94a8 !important;
    font-size: 10px;
  }

  #appView:not(.hidden) #homeModule .chat-sidebar-backdrop {
    position: fixed !important;
    inset: 66px 0 0 !important;
    z-index: 89 !important;
    display: block !important;
    border: 0;
    background: rgba(5, 27, 62, .38);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
  }

  #appView:not(.hidden) #homeModule .tools-sidebar-open .chat-sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
}

/* Segment panels, old modules and the tools workspace */

#appView:not(.hidden) .chat-segment-panel {
  box-sizing: border-box;
  padding: 26px clamp(16px, 4vw, 48px) 36px !important;
  background: var(--decygo-surface) !important;
}

#appView:not(.hidden) .chat-segment-panel h3,
#appView:not(.hidden) .module-title h1,
#appView:not(.hidden) .panel-head b,
#appView:not(.hidden) .module-empty strong {
  color: var(--decygo-navy) !important;
}

#appView:not(.hidden) .chat-segment-panel > p,
#appView:not(.hidden) .module-title p {
  color: var(--decygo-copy) !important;
}

#appView:not(.hidden) .chat-panel-stat,
#appView:not(.hidden) .chat-panel-list,
#appView:not(.hidden) .panel,
#appView:not(.hidden) .kpi,
#appView:not(.hidden) .module-empty {
  border: 1px solid var(--decygo-line) !important;
  border-radius: 13px !important;
  background: #ffffff !important;
  box-shadow: 0 5px 16px rgba(8, 48, 90, .035) !important;
}

#appView:not(.hidden) .panel,
#appView:not(.hidden) .module-empty {
  padding: 20px;
}

#appView:not(.hidden) .panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

#appView:not(.hidden) .panel-head span,
#appView:not(.hidden) .kpi small,
#appView:not(.hidden) .kpi span {
  color: #7891a6 !important;
  font-size: 10px;
}

#appView:not(.hidden) .kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

#appView:not(.hidden) .kpi {
  padding: 16px;
}

#appView:not(.hidden) .kpi strong {
  display: block;
  margin: 8px 0 3px;
  color: var(--decygo-navy) !important;
  font-size: 24px;
  letter-spacing: -.05em;
}

#appView:not(.hidden) .record-list {
  display: grid;
  gap: 0;
}

#appView:not(.hidden) .record-item,
#appView:not(.hidden) .record-row {
  border-color: #e4edf4 !important;
}

#appView:not(.hidden) .steps {
  display: grid;
  gap: 13px;
}

#appView:not(.hidden) .step {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding-bottom: 13px;
  border-bottom: 1px solid #e4edf4;
}

#appView:not(.hidden) .step:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

#appView:not(.hidden) .step-num {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 8px !important;
  background: var(--decygo-sky) !important;
  color: var(--decygo-blue) !important;
  font-size: 11px;
  font-weight: 900;
}

#appView:not(.hidden) .step h3 {
  margin: 0 0 4px;
  color: var(--decygo-ink);
  font-size: 12px;
}

#appView:not(.hidden) .step p {
  margin: 0;
  color: var(--decygo-copy);
  font-size: 10px;
  line-height: 1.4;
}

#appView:not(.hidden) .business-tools-view {
  position: absolute !important;
  inset: 0 !important;
  z-index: 60 !important;
  box-sizing: border-box;
  min-height: 100dvh !important;
  padding: clamp(18px, 4vw, 46px) clamp(16px, 4vw, 48px) 60px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  background: var(--decygo-surface) !important;
}

#appView:not(.hidden) .business-tools-view.active {
  display: block !important;
}

#appView:not(.hidden) .workspace-page {
  width: min(100%, 1320px);
  max-width: none;
  margin: 0 auto;
  padding-bottom: 18px;
}

#appView:not(.hidden) .workspace-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 24px;
}

#appView:not(.hidden) .workspace-head h1 {
  margin: 5px 0 7px;
  color: var(--decygo-navy) !important;
  font-size: clamp(28px, 4vw, 43px);
  line-height: 1;
  letter-spacing: -.06em;
}

#appView:not(.hidden) .workspace-head p {
  max-width: 660px;
  margin: 0;
  color: var(--decygo-copy) !important;
  font-size: 13px;
  line-height: 1.5;
}

#appView:not(.hidden) .workspace-card,
#appView:not(.hidden) .workspace-stat,
#appView:not(.hidden) .workspace-panel,
#appView:not(.hidden) .calculator-card,
#appView:not(.hidden) .document-preview,
body:has(#appView:not(.hidden)) #toolsModal .document-preview {
  border: 1px solid var(--decygo-line) !important;
  border-radius: 13px !important;
  background: #ffffff !important;
  box-shadow: 0 6px 18px rgba(8, 48, 90, .035) !important;
}

#appView:not(.hidden) .workspace-card {
  padding: 19px;
}

#appView:not(.hidden) .workspace-card:hover {
  transform: translateY(-2px);
  border-color: #9fc5e1 !important;
  box-shadow: 0 10px 22px rgba(8, 48, 90, .07) !important;
}

#appView:not(.hidden) .workspace-card-icon {
  width: 34px;
  height: 34px;
  margin-bottom: 14px;
  border-radius: 9px;
  background: var(--decygo-sky) !important;
  color: var(--decygo-blue) !important;
}

#appView:not(.hidden) .workspace-card h3,
#appView:not(.hidden) .workspace-panel-head h3,
#appView:not(.hidden) .calculator-card h3 {
  color: var(--decygo-navy) !important;
}

#appView:not(.hidden) .workspace-card p,
#appView:not(.hidden) .workspace-panel-head span,
#appView:not(.hidden) .workspace-empty,
#appView:not(.hidden) .calculator-card > p {
  color: var(--decygo-copy) !important;
}

#appView:not(.hidden) .workspace-hero {
  border-radius: 14px !important;
  background: var(--decygo-navy) !important;
  box-shadow: 0 10px 22px rgba(6, 46, 111, .12) !important;
}

#appView:not(.hidden) .workspace-hero::after {
  display: none !important;
}

#appView:not(.hidden) .workspace-btn,
body:has(#appView:not(.hidden)) #toolsModal .workspace-btn {
  min-height: 40px;
  border-radius: 8px !important;
  background: var(--decygo-blue) !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

#appView:not(.hidden) .workspace-btn.secondary,
#appView:not(.hidden) .workspace-btn.ghost,
body:has(#appView:not(.hidden)) #toolsModal .workspace-btn.secondary,
body:has(#appView:not(.hidden)) #toolsModal .workspace-btn.ghost {
  border: 1px solid #cbddea !important;
  background: #ffffff !important;
  color: var(--decygo-blue) !important;
}

#appView:not(.hidden) .workspace-table-wrap {
  border: 1px solid #dce8f1 !important;
  border-radius: 10px;
}

#appView:not(.hidden) .workspace-table th {
  background: #f3f8fc !important;
  color: #6d879d !important;
}

#appView:not(.hidden) .workspace-table td {
  border-color: #e4edf4 !important;
  color: #284b6b !important;
}

#appView:not(.hidden) .workspace-field input,
#appView:not(.hidden) .workspace-field select,
#appView:not(.hidden) .workspace-field textarea,
body:has(#appView:not(.hidden)) #toolsModal .workspace-field input,
body:has(#appView:not(.hidden)) #toolsModal .workspace-field select,
body:has(#appView:not(.hidden)) #toolsModal .workspace-field textarea {
  border-color: #cbdce9 !important;
  border-radius: 9px !important;
  background: #ffffff !important;
  color: #183e63 !important;
}

#appView:not(.hidden) .workspace-field input:focus,
#appView:not(.hidden) .workspace-field select:focus,
#appView:not(.hidden) .workspace-field textarea:focus,
body:has(#appView:not(.hidden)) #toolsModal .workspace-field input:focus,
body:has(#appView:not(.hidden)) #toolsModal .workspace-field select:focus,
body:has(#appView:not(.hidden)) #toolsModal .workspace-field textarea:focus {
  border-color: #67a9df !important;
  box-shadow: 0 0 0 3px rgba(23, 108, 199, .13) !important;
}

body:has(#appView:not(.hidden)) .tools-modal-card {
  border: 1px solid #d4e4ef !important;
  border-radius: 14px !important;
  background: #ffffff !important;
  box-shadow: 0 24px 60px rgba(3, 23, 56, .2) !important;
}

body:has(#appView:not(.hidden)) .tools-modal-head h2 {
  color: var(--decygo-navy) !important;
}

body:has(#appView:not(.hidden)) .tools-modal-head p {
  color: var(--decygo-copy) !important;
}

body:has(#appView:not(.hidden)) .tools-modal-close {
  border: 1px solid #d1e0eb;
  background: #f2f7fb;
  color: var(--decygo-blue);
}

/* Dark mode: every visible text gets an explicit readable color. */

body[data-theme="dark"]:has(#appView:not(.hidden)) {
  background: #0c1828;
}

body[data-theme="dark"] #appView:not(.hidden),
body[data-theme="dark"] #appView:not(.hidden) .app-shell,
body[data-theme="dark"] #appView:not(.hidden) .app-main,
body[data-theme="dark"] #appView:not(.hidden) .app-content {
  background: #0c1828 !important;
  color: #eaf4ff !important;
}

body[data-theme="dark"] #appView:not(.hidden) #homeModule .assistant {
  background: #0c1828 !important;
}

body[data-theme="dark"] #appView:not(.hidden) .chat-topbar,
body[data-theme="dark"] #appView:not(.hidden) .chat-segments,
body[data-theme="dark"] #appView:not(.hidden) .chat-composer-wrap {
  border-color: #263f59 !important;
  background: #101f32 !important;
  color: #eef7ff !important;
}

body[data-theme="dark"] #appView:not(.hidden) .chat-workspace {
  border-color: #2b4661;
}

body[data-theme="dark"] #appView:not(.hidden) .chat-workspace-label {
  color: #9db7ce !important;
}

body[data-theme="dark"] #appView:not(.hidden) .chat-workspace strong {
  color: #f2f8ff !important;
}

body[data-theme="dark"] #appView:not(.hidden) .chat-account {
  border-color: #3b5a76 !important;
  background: #142a42 !important;
  color: #eef7ff !important;
}

body[data-theme="dark"] #appView:not(.hidden) .chat-account-avatar {
  background: #204d78 !important;
  color: #c6e8ff !important;
}

body[data-theme="dark"] #appView:not(.hidden) .chat-segments {
  background: #101f32 !important;
}

body[data-theme="dark"] #appView:not(.hidden) .chat-segment {
  color: #a8bfd3 !important;
}

body[data-theme="dark"] #appView:not(.hidden) .chat-segment:hover {
  background: #172f49 !important;
  color: #bfe3ff !important;
}

body[data-theme="dark"] #appView:not(.hidden) .chat-segment.active {
  border-bottom-color: #65b7f5 !important;
  background: transparent !important;
  color: #a9d9ff !important;
}

body[data-theme="dark"] #appView:not(.hidden) .chat-intro,
body[data-theme="dark"] #appView:not(.hidden) .chat-thread,
body[data-theme="dark"] #appView:not(.hidden) .chat-segment-panel {
  border-color: #263f59 !important;
  background: #0c1828 !important;
}

body[data-theme="dark"] #appView:not(.hidden) .chat-intro .kicker {
  color: #8bc9f7 !important;
}

body[data-theme="dark"] #appView:not(.hidden) .chat-intro h3 {
  color: #f2f8ff !important;
}

body[data-theme="dark"] #appView:not(.hidden) .chat-intro p,
body[data-theme="dark"] #appView:not(.hidden) .chat-helper,
body[data-theme="dark"] #appView:not(.hidden) .chat-meta {
  color: #a9c0d3 !important;
}

body[data-theme="dark"] #appView:not(.hidden) .voice-launcher {
  border-color: #355672 !important;
  background: #142a42 !important;
}

body[data-theme="dark"] #appView:not(.hidden) .voice-launcher-copy strong {
  color: #eef7ff !important;
}

body[data-theme="dark"] #appView:not(.hidden) .voice-launcher-copy span {
  color: #a9c0d3 !important;
}

body[data-theme="dark"] #appView:not(.hidden) .chat-bubble {
  border-color: #35536f !important;
  background: #142a42 !important;
  color: #e5f1fb !important;
  box-shadow: none !important;
}

body[data-theme="dark"] #appView:not(.hidden) .chat-bubble strong {
  color: #f4f9ff !important;
}

body[data-theme="dark"] #appView:not(.hidden) .user-message .chat-bubble {
  border-color: #2e83d5 !important;
  background: #2379c9 !important;
  color: #ffffff !important;
}

body[data-theme="dark"] #appView:not(.hidden) .chat-suggestions button,
body[data-theme="dark"] #appView:not(.hidden) .chat-quick-row button {
  border-color: #416783 !important;
  background: #17344f !important;
  color: #b9e0ff !important;
}

body[data-theme="dark"] #appView:not(.hidden) .chat-composer {
  border-color: #3b5b77 !important;
  background: #142a42 !important;
  box-shadow: none !important;
}

body[data-theme="dark"] #appView:not(.hidden) .chat-composer textarea {
  color: #eff8ff !important;
}

body[data-theme="dark"] #appView:not(.hidden) .chat-composer textarea::placeholder {
  color: #9db8ce !important;
}

body[data-theme="dark"] #appView:not(.hidden) .chat-tool {
  background: #204d78 !important;
  color: #c5e8ff !important;
}

body[data-theme="dark"] #appView:not(.hidden) .chat-send {
  background: #318ddd !important;
}

body[data-theme="dark"] #appView:not(.hidden) .chat-tools-rail {
  border-color: #2b4661 !important;
  background: #101f32 !important;
  box-shadow: 8px 0 24px rgba(0, 0, 0, .16) !important;
}

body[data-theme="dark"] #appView:not(.hidden) .chat-tools-rail-head {
  border-color: #2b4661 !important;
}

body[data-theme="dark"] #appView:not(.hidden) .chat-tools-rail-kicker {
  color: #9bb9d1 !important;
}

body[data-theme="dark"] #appView:not(.hidden) .chat-tools-rail-title {
  color: #f2f8ff !important;
}

body[data-theme="dark"] #appView:not(.hidden) .chat-tools-rail-subtitle {
  color: #a7bfd2 !important;
}

body[data-theme="dark"] #appView:not(.hidden) .chat-tool-card {
  border-color: #35536f !important;
  background: #142a42 !important;
  color: #eef7ff !important;
}

body[data-theme="dark"] #appView:not(.hidden) .chat-tool-card:hover {
  border-color: #6090b5 !important;
  background: #1a3855 !important;
}

body[data-theme="dark"] #appView:not(.hidden) .chat-tool-card-icon {
  background: #204d78 !important;
  color: #c5e8ff !important;
}

body[data-theme="dark"] #appView:not(.hidden) .chat-tool-card-copy b {
  color: #f3f8ff !important;
}

body[data-theme="dark"] #appView:not(.hidden) .chat-tool-card-copy small {
  color: #aec6d9 !important;
}

body[data-theme="dark"] #appView:not(.hidden) .chat-tool-card-go {
  color: #9bd5ff !important;
}

body[data-theme="dark"] #appView:not(.hidden) .chat-sidebar-backdrop {
  background: rgba(0, 0, 0, .56);
}

body[data-theme="dark"] #appView:not(.hidden) .chat-tools-sidebar-close {
  border-color: #416783 !important;
  background: #1b3b59 !important;
  color: #c5e8ff !important;
}

body[data-theme="dark"] #appView:not(.hidden) .chat-panel-stat,
body[data-theme="dark"] #appView:not(.hidden) .chat-panel-list,
body[data-theme="dark"] #appView:not(.hidden) .panel,
body[data-theme="dark"] #appView:not(.hidden) .kpi,
body[data-theme="dark"] #appView:not(.hidden) .module-empty,
body[data-theme="dark"] #appView:not(.hidden) .workspace-card,
body[data-theme="dark"] #appView:not(.hidden) .workspace-stat,
body[data-theme="dark"] #appView:not(.hidden) .workspace-panel,
body[data-theme="dark"] #appView:not(.hidden) .calculator-card,
body[data-theme="dark"] #appView:not(.hidden) .document-preview,
body[data-theme="dark"]:has(#appView:not(.hidden)) #toolsModal .document-preview {
  border-color: #35536f !important;
  background: #142a42 !important;
  color: #eaf4ff !important;
  box-shadow: none !important;
}

body[data-theme="dark"] #appView:not(.hidden) .chat-segment-panel h3,
body[data-theme="dark"] #appView:not(.hidden) .module-title h1,
body[data-theme="dark"] #appView:not(.hidden) .panel-head b,
body[data-theme="dark"] #appView:not(.hidden) .module-empty strong,
body[data-theme="dark"] #appView:not(.hidden) .workspace-head h1,
body[data-theme="dark"] #appView:not(.hidden) .workspace-card h3,
body[data-theme="dark"] #appView:not(.hidden) .workspace-panel-head h3,
body[data-theme="dark"] #appView:not(.hidden) .calculator-card h3,
body[data-theme="dark"] #appView:not(.hidden) .kpi strong {
  color: #f2f8ff !important;
}

body[data-theme="dark"] #appView:not(.hidden) .chat-segment-panel > p,
body[data-theme="dark"] #appView:not(.hidden) .module-title p,
body[data-theme="dark"] #appView:not(.hidden) .workspace-head p,
body[data-theme="dark"] #appView:not(.hidden) .workspace-card p,
body[data-theme="dark"] #appView:not(.hidden) .workspace-panel-head span,
body[data-theme="dark"] #appView:not(.hidden) .workspace-empty,
body[data-theme="dark"] #appView:not(.hidden) .calculator-card > p,
body[data-theme="dark"] #appView:not(.hidden) .kpi small,
body[data-theme="dark"] #appView:not(.hidden) .kpi span {
  color: #aec5d7 !important;
}

body[data-theme="dark"] #appView:not(.hidden) .workspace-hero {
  background: #153e6e !important;
}

body[data-theme="dark"] #appView:not(.hidden) .workspace-btn.secondary,
body[data-theme="dark"] #appView:not(.hidden) .workspace-btn.ghost,
body[data-theme="dark"]:has(#appView:not(.hidden)) #toolsModal .workspace-btn.secondary,
body[data-theme="dark"]:has(#appView:not(.hidden)) #toolsModal .workspace-btn.ghost {
  border-color: #416783 !important;
  background: #1a3855 !important;
  color: #b9e0ff !important;
}

body[data-theme="dark"] #appView:not(.hidden) .workspace-table-wrap {
  border-color: #35536f !important;
}

body[data-theme="dark"] #appView:not(.hidden) .workspace-table th {
  background: #1b3854 !important;
  color: #b7ccdd !important;
}

body[data-theme="dark"] #appView:not(.hidden) .workspace-table td {
  border-color: #2d4963 !important;
  color: #e4f0fa !important;
}

body[data-theme="dark"] #appView:not(.hidden) .workspace-field input,
body[data-theme="dark"] #appView:not(.hidden) .workspace-field select,
body[data-theme="dark"] #appView:not(.hidden) .workspace-field textarea,
body[data-theme="dark"]:has(#appView:not(.hidden)) #toolsModal .workspace-field input,
body[data-theme="dark"]:has(#appView:not(.hidden)) #toolsModal .workspace-field select,
body[data-theme="dark"]:has(#appView:not(.hidden)) #toolsModal .workspace-field textarea {
  border-color: #416783 !important;
  background: #0f2033 !important;
  color: #eef7ff !important;
}

body[data-theme="dark"]:has(#appView:not(.hidden)) .tools-modal-card {
  border-color: #3b5b77 !important;
  background: #142a42 !important;
}

body[data-theme="dark"]:has(#appView:not(.hidden)) .tools-modal-head,
body[data-theme="dark"]:has(#appView:not(.hidden)) .tools-modal-footer {
  border-color: #35536f !important;
  background: #101f32 !important;
}

body[data-theme="dark"]:has(#appView:not(.hidden)) .tools-modal-head h2 {
  color: #f2f8ff !important;
}

body[data-theme="dark"]:has(#appView:not(.hidden)) .tools-modal-head p {
  color: #aec5d7 !important;
}

body[data-theme="dark"]:has(#appView:not(.hidden)) .tools-modal-close {
  border-color: #416783;
  background: #1b3b59;
  color: #c5e8ff;
}

@media (max-width: 900px) {
  #appView:not(.hidden) .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #appView:not(.hidden) .workspace-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  #authView:not(.hidden) .auth-wrap {
    min-height: 100dvh;
    align-items: start;
    padding: 16px 12px 22px;
    background: #f4f8fc;
  }

  #authView:not(.hidden) .auth-wrap::before,
  #authView:not(.hidden) .auth-wrap::after {
    display: none;
  }

  #authView:not(.hidden) .auth-card {
    width: min(100%, 470px);
    margin: max(4vh, 18px) 0 0;
    padding: 27px 19px 24px;
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(6, 46, 111, .1);
  }

  #authView:not(.hidden) .auth-card::before {
    margin-bottom: 25px;
  }

  #authView:not(.hidden) .auth-card h1 {
    font-size: 30px;
  }

  #appView:not(.hidden) .kpis {
    gap: 8px;
  }

  #appView:not(.hidden) .kpi {
    padding: 13px;
  }

  #appView:not(.hidden) .kpi strong {
    font-size: 20px;
  }

  #appView:not(.hidden) .workspace-head h1 {
    font-size: 32px;
  }

  #appView:not(.hidden) .workspace-grid {
    grid-template-columns: 1fr;
  }

  #appView:not(.hidden) .workspace-stat-row {
    grid-template-columns: 1fr 1fr;
  }
}
