/* Shared appearance tokens and the keyboard-accessible sun/moon switch. */
:root { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #171b16;
  --white: #22281f;
  --ink: #eef2e8;
  --muted: #a7b49d;
  --line: #394432;
  --lime: #c2f34e;
  --lime-soft: #2e3b1e;
  --dark: #121610;
  --orange: #ebbd78;
  --theme-raised: #2a3226;
  --theme-nav: #121610;
  --theme-code: #10150f;
  --theme-on-accent: #1b2410;
  --theme-blue: #a5cbe2;
  --theme-pink: #d3aed9;
  --theme-good: #b4dc90;
  background: var(--paper);
  color: var(--ink);
}
[data-theme="dark"] ::selection { background: var(--lime); color: var(--theme-on-accent); }
[data-theme="dark"] :focus-visible { outline-color: var(--lime); }
[data-theme="dark"] input, [data-theme="dark"] progress { accent-color: var(--lime); }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 68px; width: 68px; height: 44px; margin: 0; padding: 4px 0; border: 0; border-radius: 20px; background: transparent; color: #52672c; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.theme-toggle__track { display: block; position: relative; width: 68px; height: 36px; box-sizing: border-box; border: 1px solid #a4b394; border-radius: 20px; background: #e7edde; transition: background-color .2s, border-color .2s; }
.theme-toggle__thumb { display: grid; place-items: center; position: absolute; left: 3px; top: 3px; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px #27331d26; transition: transform .2s ease, background-color .2s; }
.theme-toggle__thumb svg { display: block; grid-area: 1 / 1; width: 20px; height: 20px; transition: opacity .15s; }
.theme-toggle__moon { opacity: 0; }
.theme-toggle:hover .theme-toggle__track { border-color: #617944; }
.theme-toggle:focus-visible { outline: 3px solid #5f8421; outline-offset: 3px; border-radius: 20px; }
[data-theme="dark"] .theme-toggle { color: #1b2410; }
[data-theme="dark"] .theme-toggle__track { border-color: #6f8943; background: #344226; }
[data-theme="dark"] .theme-toggle__thumb { transform: translateX(32px); background: var(--lime); }
[data-theme="dark"] .theme-toggle__sun { opacity: 0; }
[data-theme="dark"] .theme-toggle__moon { opacity: 1; }
[data-theme="dark"] .theme-toggle:hover .theme-toggle__track { border-color: var(--lime); }
[data-theme="dark"] .theme-toggle:focus-visible { outline-color: var(--lime); }
@media (prefers-reduced-motion: reduce) {
  .theme-toggle__track, .theme-toggle__thumb, .theme-toggle__thumb svg { transition: none; }
}
.workspace-header { gap: 16px; }
.workspace-header .breadcrumb { margin-right: auto; }
.auth-main > .theme-toggle { position: absolute; top: 24px; right: 30px; }
.site-header > .theme-toggle { margin-left: auto; }
.error-page { background: var(--paper); color: var(--ink); }
.error-page main { max-width: 820px; margin: 60px auto; padding: 24px; }
.error-page h1 { margin: 32px 0 20px; }
.error-page p { margin-bottom: 24px; }
@media (min-width: 721px) and (max-width: 1120px) {
  .site-header { height: auto; min-height: 96px; flex-wrap: wrap; padding-block: 18px; gap: 16px; }
  .site-header .desktop-nav { order: 4; flex-basis: 100%; justify-content: center; }
}
@media (max-width: 720px) {
  .theme-toggle { width: 60px; flex-basis: 60px; }
  .theme-toggle__track { width: 60px; }
  [data-theme="dark"] .theme-toggle__thumb { transform: translateX(24px); }
  .workspace-header .breadcrumb { display: none; }
  .workspace-header > .theme-toggle { margin-left: auto; }
  .workspace-header .header-profile { flex-shrink: 0; }
  .auth-main > .theme-toggle { top: 18px; right: 22px; }
  .site-header { height: auto; min-height: 77px; flex-wrap: wrap; padding-block: 14px; gap: 8px; }
  .site-header > .theme-toggle { margin-left: auto; }
  .site-header .mobile-nav { top: 100%; }
}
@media (max-width: 380px) {
  .site-header .wordmark { font-size: 13px; gap: 6px; }
  .site-header .brand-java { font-size: 26px; }
  .site-header .brand-slash { font-size: 30px; }
}
