/* Shared appearance palette. Day mode preserves the existing company identity. */
:root {
  --theme-bg: #fffbf5;
  --theme-surface: #fff;
  --theme-soft: #fff0dd;
  --theme-text: #39291f;
  --theme-muted: #715f51;
  --theme-line: #eadfd1;
  --theme-accent: #ab4313;
  color-scheme: light;
}
:root[data-theme="night"] {
  --theme-bg: #191d24;
  --theme-surface: #252b34;
  --theme-soft: #323640;
  --theme-text: #f5ede4;
  --theme-muted: #c8bcb0;
  --theme-line: #4b525d;
  --theme-accent: #ffb87a;
  --orange-deep: #ffb87a;
  --orange-light: #3c322c;
  --cream: #191d24;
  --ink: #f5ede4;
  --muted: #c8bcb0;
  --line: #4b525d;
  color-scheme: dark;
  background: var(--theme-bg);
}
.theme-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid #d9bea0;
  border-radius: 12px;
  background: #fffaf2;
  color: #573a25;
  font:
    600 15px/1.5 "Noto Sans Thai",
    "DeeDog Korean UI",
    Tahoma,
    sans-serif;
  cursor: pointer;
  white-space: nowrap;
}
.theme-toggle:hover {
  border-color: #e87524;
}
.theme-toggle:focus-visible {
  outline: 3px solid #267b78;
  outline-offset: 3px;
}
.theme-symbol {
  font:
    24px/1 Arial,
    sans-serif;
}
.theme-icon {
  display: none;
}
@media (min-width: 1061px) {
  .theme-toggle {
    width: 44px;
    height: 44px;
    padding: 9px;
    border-radius: 50%;
  }
  .theme-toggle :is(.theme-symbol, .theme-name) {
    display: none;
  }
  .theme-icon,
  .theme-icon svg {
    display: block;
    width: 24px;
    height: 24px;
  }
  [data-language-host] > .theme-toggle {
    order: 1;
  }
  [data-language-host] > .language-switcher {
    order: 2;
  }
  .ep-header-inner > .ep-logo {
    order: 0;
  }
  .ep-header-inner > .ep-header-label {
    order: 0;
  }
  .ep-header-inner > #epLogout {
    order: 3;
  }
}
html[data-theme="night"] .theme-toggle,
html[data-theme="night"] .language-switcher select {
  color: var(--theme-text);
  background: var(--theme-soft);
  border-color: var(--theme-line);
}
html[data-theme="night"] body {
  background-color: var(--theme-bg);
  color: var(--theme-text);
}
html[data-theme="night"] :is(input, select, textarea) {
  background-color: var(--theme-bg) !important;
  color: var(--theme-text) !important;
  border-color: var(--theme-line) !important;
}
html[data-theme="night"] :is(input, textarea)::placeholder {
  color: #b7ac9f;
  opacity: 1;
}
html[data-theme="night"] :is(input, textarea, select):focus {
  outline-color: #ffb87a;
  border-color: #ffb87a !important;
}
html[data-theme="night"] :is(input, textarea):-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #29313a inset;
  -webkit-text-fill-color: #f5ede4;
  caret-color: #f5ede4;
}
html[data-theme="night"] :is(.brand-logo, .ep-logo, .saas-brand-logo) {
  background: #fffbf5;
  border-radius: 12px;
  padding: 4px;
}
html[data-theme="night"] :focus-visible {
  outline-color: #ffb87a;
}
@media (max-width: 1180px) {
  .theme-toggle {
    width: 44px;
    padding: 8px;
  }
  .theme-name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}
@media (max-width: 600px) {
  body[data-page] .header-actions {
    display: grid;
    grid-template-columns: minmax(78px, auto) 44px;
    gap: 8px;
    align-items: center;
  }
  body[data-page] .header-actions .language-switcher {
    grid-column: 1;
    grid-row: 1;
  }
  body[data-page] .header-actions .theme-toggle {
    grid-column: 2;
    grid-row: 1;
  }
  body[data-page] .header-actions .login-link {
    grid-column: 1;
    grid-row: 2;
    width: auto;
    min-width: 0;
    justify-content: center;
    padding: 8px;
  }
  body[data-page] .header-actions .login-link span {
    position: static;
    width: auto;
    height: auto;
    clip-path: none;
  }
  body[data-page] .header-actions .menu-toggle {
    grid-column: 2;
    grid-row: 2;
    width: 44px;
    height: 44px;
  }
  body[data-page] .header-inner {
    padding-block: 12px;
  }
  body[data-page] .header-actions .language-switcher select {
    width: 100%;
  }
  .ep-header-inner .theme-toggle {
    order: 2;
  }
}
@media print {
  .theme-toggle {
    display: none !important;
  }
}

@media (min-width: 1061px) {
  .saas-body .topbar-actions > #userAvatar {
    order: 3;
  }
}
