.sg-app {
  --sg-bg: #090909;
  --sg-surface: #171717;
  --sg-text: #faf7f0;
  --sg-muted: #c5c0b7;
  --sg-gold: #e7b65f;
  --sg-line: #35332e;
  margin: 0;
  background: var(--sg-bg);
  color: var(--sg-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  accent-color: var(--sg-gold);
  color-scheme: dark;
}
.sg-app *, .sg-app *::before, .sg-app *::after { box-sizing: border-box; }
.sg-app ::selection { background: #8e692e; color: #fff; }
.sg-app :focus-visible { outline: 2px solid var(--sg-gold); outline-offset: 4px; }
.sg-app a { text-underline-offset: 4px; }
.sg-app svg { width: 24px; height: 24px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sg-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.sg-skip-link { position: fixed; inset-block-start: 8px; inset-inline-start: 260px; z-index: 100; padding: 10px 16px; background: var(--sg-gold); color: #17120a; transform: translateY(-160%); }
.sg-skip-link:focus { transform: translateY(0); }
.sg-sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 40; width: 240px; display: flex; flex-direction: column; overflow-y: auto; background: #101010; border-inline-end: 1px solid var(--sg-line); scrollbar-color: #736b5c #101010; scrollbar-width: thin; }
.sg-brand { display: inline-flex; align-items: center; text-decoration: none; }
.sg-brand img { display: block; width: 200px; height: auto; max-width: 100%; }
.sg-sidebar-brand { flex: 0 0 auto; padding: 54px 22px 44px; }
.sg-nav { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 0 14px 26px; }
.sg-nav-group { flex: 0 0 auto; }
.sg-nav-group + .sg-nav-group { border-top: 1px solid var(--sg-line); margin-top: 20px; padding-top: 20px; }
.sg-nav-heading { margin: 0 16px 14px; color: #bdb7ac; font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
.sg-nav-link { display: flex; align-items: center; gap: 14px; min-height: 52px; margin: 3px 0; padding: 12px 16px; border: 1px solid transparent; border-radius: 9px; color: #eee9df; text-decoration: none; font-size: 15px; line-height: 1.25; cursor: pointer; }
.sg-nav-link span { min-width: 0; }
.sg-nav-link:hover { background: #24221d; color: var(--sg-text); }
.sg-nav-link.is-active { background: #2b261b; border-color: #5e4b2c; color: var(--sg-gold); }
.sg-nav-link.is-emphasis, .sg-sign-in { color: #f0c76e; }
.sg-nav-link.is-emphasis:hover { border-color: var(--sg-gold); }
.sg-nav-footer { flex: 0 0 auto; margin-top: auto; padding-top: 42px; }
.sg-account summary { list-style: none; }
.sg-account summary::-webkit-details-marker { display: none; }
.sg-chevron { width: 16px !important; margin-inline-start: auto; transition: transform 140ms ease-out; }
.sg-account[open] .sg-chevron { transform: rotate(180deg); }
.sg-account-links { display: grid; gap: 4px; padding: 2px 12px 10px 54px; }
.sg-account-links a, .sg-account-links button { display: block; width: 100%; min-height: 38px; padding: 8px 0; border: 0; background: transparent; color: var(--sg-muted); font: inherit; font-size: 14px; text-decoration: none; text-align: start; cursor: pointer; }
.sg-account-links a:hover, .sg-account-links button:hover { color: var(--sg-gold); }
.sg-mobile-header, .sg-close-menu { display: none; }
.sg-content { min-width: 0; min-height: 100vh; margin-inline-start: 240px; padding: 42px 30px 0; }
.sg-content--welcome { padding: 0; }
.sg-content--auth { margin-inline-start: 0; }
.sg-research-container { display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; margin-inline-start: 240px; }
.sg-research-container > main { padding: 0; }
.sg-research-container h1, .sg-research-container h2 { color: var(--sg-text); }
.sg-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; padding: 32px; border-top: 1px solid var(--sg-line); color: var(--sg-muted); font-size: 13px; }
.sg-footer a { color: inherit; }
.sg-footer .sg-locales { display: flex; flex-wrap: wrap; gap: 12px; margin-inline-start: auto; }
.sg-auth-brand { justify-content: center; width: 100%; margin-bottom: 12px; }
.sg-history-page { width: 100%; max-width: 960px; margin: 0 auto; padding: 16px; }
.sg-history-page > h1 { font-size: 30px; margin-bottom: 12px; }
.sg-history-page > p { color: var(--sg-muted); margin-bottom: 28px; }
.sg-history-error { padding: 18px; border: 1px solid #ac8b56; border-radius: 10px; }
.sg-history-error button { margin-top: 12px; text-decoration: underline; }
@media (max-width: 900px) {
  .sg-sidebar { position: relative; inset: auto; display: none; width: 100%; max-height: calc(100svh - 64px); border-inline-end: 0; border-bottom: 1px solid var(--sg-line); }
  .sg-sidebar.is-open, .sg-sidebar:target { display: flex; }
  .sg-sidebar-brand { display: none; }
  .sg-nav { padding: 8px 20px 20px; }
  .sg-nav-link { min-height: 48px; }
  .sg-nav-group + .sg-nav-group { margin-top: 12px; padding-top: 16px; }
  .sg-nav-footer { padding-top: 16px; }
  .sg-mobile-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex: 0 0 auto; height: 64px; padding: 14px 20px; background: #101010; border-bottom: 1px solid var(--sg-line); }
  .sg-mobile-header .sg-brand img { width: 165px; }
  .sg-menu-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 7px 0 7px 10px; color: var(--sg-text); font-size: 14px; text-decoration: none; }
  .sg-close-menu { display: block; margin: 14px 36px 0; color: var(--sg-gold); font-size: 14px; }
  .sg-content, .sg-research-container { margin-inline-start: 0; }
  .sg-content { padding: 24px 16px 0; }
  .sg-content--welcome { padding: 0; }
  .sg-research-container > main { padding: 0; }
  .sg-skip-link { inset-inline-start: 10px; }
  .sg-footer { padding: 24px 20px; }
}
@media (max-height: 820px) and (min-width: 901px) {
  .sg-sidebar-brand { padding-top: 34px; padding-bottom: 30px; }
  .sg-nav-link { min-height: 44px; margin-block: 2px; padding-block: 10px; }
  .sg-nav-group + .sg-nav-group { margin-top: 14px; padding-top: 14px; }
  .sg-nav-footer { padding-top: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .sg-app *, .sg-app *::before, .sg-app *::after { scroll-behavior: auto !important; transition: none !important; }
}

.sg-research-app { --background: #090909; --foreground: #faf7f0; --card: #171717; --card-foreground: #faf7f0; --popover: #1d1d1d; --popover-foreground: #faf7f0; --primary: #e7b65f; --primary-foreground: #17120a; --muted: #1d1d1d; --muted-foreground: #c5c0b7; --border: #48443c; --input: #48443c; --ring: #e7b65f; --sidebar: #101010; --sidebar-foreground: #faf7f0; }
.sg-menu-toggle, button.sg-close-menu { border: 0; background: transparent; font: inherit; cursor: pointer; }
.sg-history-page { padding: 40px 30px; overflow: auto; }
@media (max-width: 900px) {
  .sg-research-app .sg-mobile-header { position: fixed; inset: 0 0 auto; z-index: 50; }
  .sg-research-app .sg-research-container { padding-top: 64px; }
  .sg-research-app .sg-sidebar { position: fixed; inset: 64px 0 0; z-index: 45; max-height: none; }
  .sg-research-app .sg-menu-toggle { display: inline-flex; }
  .sg-research-app .sg-sidebar-brand { display: none; }
}

.sg-research-app #main-content [data-sidebar="trigger"] { display: none; }

.sg-app [hidden] { display: none !important; }
.sg-app input, .sg-app textarea { caret-color: var(--sg-gold); }
.sg-sidebar { overflow: hidden; }
.sg-sidebar-brand { padding: 32px 22px 26px; }
.sg-nav { overflow: hidden; padding-bottom: 16px; }
.sg-nav-sections { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #736b5c #101010; }
.sg-nav-footer { flex: 0 0 auto; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--sg-line); background: #101010; }
.sg-nav-link { min-height: 46px; padding-block: 10px; }
.sg-nav-group + .sg-nav-group { margin-top: 14px; padding-top: 14px; }
@media (max-width: 900px) {
  .sg-sidebar { height: calc(100svh - 64px); }
  .sg-nav { padding-top: 8px; }
  .sg-nav-footer { padding-top: 8px; }
}

/* Guest account actions: shared by the research and community menus. */
.sg-app .sg-nav-footer > .sg-sign-in {
  justify-content: center;
  gap: 0;
  width: calc(100% - 32px);
  max-width: 240px;
  min-height: 40px;
  padding: 9px 14px;
  border: 0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  text-decoration: none;
}

.sg-app .sg-nav-footer > .sg-sign-in > svg {
  display: none;
}

.sg-app .sg-nav-footer > .sg-sign-in[href="/register"] {
  margin: 12px auto 0;
  background: var(--sg-gold);
  color: #17120a;
}

.sg-app .sg-nav-footer > .sg-sign-in[href="/register"]:hover {
  background: #f0c777;
}

.sg-app .sg-nav-footer > .sg-sign-in[href="/register"]:active {
  background: #d9a94e;
}

.sg-app .sg-nav-footer > .sg-sign-in[href^="/login?"] {
  margin: 8px auto 2px;
  border: 1px solid var(--sg-gold);
  background: transparent;
  color: var(--sg-text);
}

.sg-app .sg-nav-footer > .sg-sign-in[href^="/login?"]:hover {
  background: #242016;
  color: var(--sg-text);
  text-decoration: none;
}
