/* Shared SupFind tokens. The original logo and the existing controls are retained. */
:root {
  color-scheme: light;
  --ui-bg: #f8f8ff;
  --ui-surface: #fdfdff;
  --ui-text: #101124;
  --ui-muted: #555d73;
  --ui-line: #dfe1eb;
  --ui-accent: #3f20e8;
  --ui-action: #4928e9;
  --ui-soft: #eeebff;
  --ui-success: #18744a;
  --ui-warning: #8a4b08;
  --ui-warning-bg: #fff5db;
  --ui-danger: #b42318;
  --ui-radius: 12px;
  --ui-shadow: 0 12px 40px #17214a0a;
  --r-bg: var(--ui-bg);
  --r-card: var(--ui-surface);
  --r-text: var(--ui-text);
  --r-muted: var(--ui-muted);
  --r-line: var(--ui-line);
  --r-accent: var(--ui-accent);
  --r-soft: var(--ui-soft);
  /* Legacy selectors share the same live theme instead of forcing navy. */
  --ink: var(--ui-text);
  --muted: var(--ui-muted);
  --line: var(--ui-line);
  --bg: var(--ui-bg);
  --mint: var(--ui-soft);
  --white: var(--ui-surface);
  --soft: var(--ui-soft);
  --accent: var(--ui-accent);
  --navy: var(--ui-action);
  --blue: var(--ui-action);
}
:root[data-theme=dark] {
  color-scheme: dark;
  --ui-bg: #191c24;
  --ui-surface: #232730;
  --ui-text: #f5f6fa;
  --ui-muted: #bdc2ce;
  --ui-line: #454a59;
  --ui-accent: #c1a4ff;
  --ui-action: #6250eb;
  --ui-soft: #39314f;
  --ui-success: #83d6ae;
  --ui-warning: #ffd88a;
  --ui-warning-bg: #382f1f;
  --ui-danger: #ffafa7;
  --ui-shadow: 0 12px 40px #0002;
}
html { scroll-padding-top: 100px; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body :focus-visible { outline: 3px solid var(--ui-accent); outline-offset: 3px; }
button, input, select, textarea { font: inherit; }
button, .button { white-space: normal; word-break: normal; overflow-wrap: normal; }
button:disabled, .button[aria-disabled=true] { cursor: not-allowed; }
html[data-theme] body .supfind-logo { filter: none !important; }
html[data-theme=dark] body .supfind-logo { content: url('/static/supfind-logo-dark.webp'); }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.site-language { display: flex; align-items: center; margin: 0; }
.site-language select { width: 144px; max-width: 100%; height: 44px; margin: 0; padding: 0 38px 0 12px; border: 1px solid var(--ui-line); border-radius: 10px; background: var(--ui-surface); color: var(--ui-text); font-size: 13px; }
.site-language button, .site-theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; min-width: 44px; height: 44px; padding: 0;
  border: 1px solid var(--ui-line); border-radius: 10px;
  background: var(--ui-surface); color: var(--ui-text); box-shadow: none;
  font-size: 13px; font-weight: 650;
}
.site-theme-toggle svg { width: 20px; height: 20px; }
.site-theme-toggle .moon, [data-theme=dark] .site-theme-toggle .sun { display: block; }
.site-theme-toggle .sun, [data-theme=dark] .site-theme-toggle .moon { display: none; }
.site-menu { display: none; }
.site-menu summary { list-style: none; cursor: pointer; min-height: 44px; padding: 10px 12px; }
.site-menu summary::-webkit-details-marker { display: none; }
.site-menu nav { position: absolute; top: calc(100% - 4px); right: 16px; width: min(280px, calc(100vw - 32px)); padding: 8px; border: 1px solid var(--ui-line); border-radius: 12px; background: var(--ui-surface); box-shadow: var(--ui-shadow); }
.site-menu[open] nav { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
.site-menu nav a { display: flex; align-items: center; min-height: 44px; padding: 8px 12px; color: var(--ui-text); }
.site-menu nav a:hover { background: var(--ui-soft); border-radius: 8px; }
.skip-link { position: fixed; z-index: 1000; top: 8px; left: 16px; transform: translateY(-150%); padding: 12px 16px; background: var(--ui-surface); color: var(--ui-text); border: 1px solid var(--ui-accent); border-radius: 10px; }
.skip-link:focus { transform: none; }
@media (max-width: 1120px) {
  body:not(.auth-page) .topbar > .topbar-nav { display: none; }
  body:not(.auth-page) .site-menu { display: block; margin-left: auto; }
}
@media (max-width: 420px) {
  body:not(.portal-desk):not(.account-manage):not(.auth-page) .topbar {
    min-height: 64px;
    height: 64px;
    padding: 8px 12px !important;
    gap: 6px;
  }
  body:not(.portal-desk):not(.account-manage):not(.auth-page) .topbar .brand img {
    width: 96px !important;
    height: 40px !important;
  }
  body:not(.portal-desk):not(.account-manage):not(.auth-page) .site-language select {
    width: 92px;
    height: 38px;
    padding: 0 30px 0 7px;
    font-size: 11px;
  }
  body:not(.portal-desk):not(.account-manage):not(.auth-page) .site-theme-toggle {
    width: 36px;
    min-width: 36px;
    height: 38px;
  }
  body:not(.portal-desk):not(.account-manage):not(.auth-page) .site-menu summary {
    display: grid;
    place-items: center;
    width: 34px;
    min-height: 38px;
    padding: 4px;
    font-size: 0;
  }
  body:not(.portal-desk):not(.account-manage):not(.auth-page) .site-menu summary::after {
    content: '☰';
    font-size: 20px;
    line-height: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
