:root{
  color-scheme: dark;

  --site-bg:#191919;
  --site-bg-soft:#202020;
  --site-surface:#242424;
  --site-surface-2:#1f1f1f;
  --site-surface-3:#2b2b2b;
  --site-surface-4:#2d2d2d;
  --site-panel:#222222;
  --site-panel-2:#262626;
  --site-panel-3:#2d2d2d;
  --site-line:#3a3a3a;
  --site-line-soft:#444444;
  --site-border:#4c4c4c;
  --site-border-soft:rgba(255,255,255,0.15);
  --site-text:#e5e5e5;
  --site-text-strong:#ffffff;
  --site-text-soft:#d8d8d8;
  --site-muted:#a4a4a4;
  --site-muted-2:#b9b9b9;
  --site-link:#68a7ff;
  --site-link-hover:#95c2ff;
  --site-accent:#990101;
  --site-accent-hover:#510e0e;
  --site-danger:#7a1f1f;
  --site-danger-hover:#972727;
  --site-success:#446743;
  --site-table-head:rgba(255,255,255,0.05);
  --site-row-hover:#282828;
  --site-input-bg:#101010;
  --site-input-focus:#131313;
  --site-input-text:#f1f1f1;
  --site-input-border:#4c4c4c;
  --site-button:#2f2f2f;
  --site-button-text:#ffffff;
  --site-button-hover:#3a3a3a;
  --site-button-border:#585858;
  --site-shadow:0 8px 24px rgba(0,0,0,.22);
  --site-inset-shadow:inset 0 1px 0 rgba(255,255,255,0.05);
  --site-tooltip-bg:rgba(0,0,0,0.85);
  --site-tooltip-text:#ffffff;
  --site-tooltip-border:rgba(255,255,255,0.18);
  --site-tooltip-shadow:0 4px 12px rgba(0,0,0,0.35);
  --site-tooltip-radius:4px;
  --site-nation:#008000;
  --site-nation-hover:#01c001;
  --site-red:#c40000;
  --site-badge-level:red;
  --site-toggle-track:#252525;
  --site-toggle-knob:#9c9c9c;
  --site-pakt:#5e0197;
  --site-vote-for:#4e79a7;
  --site-vote-against:#b04a45;
  --site-warning:#ffd400;
  --site-warning-text:#111111;
  --site-warning-border:#8a7400;
  --site-status-draft:#d5d5d5;
  --site-status-submitted:#e9d57a;
  --site-status-approved:#8fd790;
  --site-status-failed:#ef8a8a;
  --site-button-primary:#5f87b6;
  --site-button-primary-2:#3e638f;
  --site-button-primary-hover:#6d96c6;
  --site-button-primary-hover-2:#4b739f;
  --site-button-danger:#aa625c;
  --site-button-danger-2:#843d37;
  --site-button-danger-hover:#bb716b;
  --site-button-danger-hover-2:#944842;
  --site-button-success:#628a5f;
  --site-button-success-2:#446743;
  --site-button-success-hover:#709a6d;
  --site-button-success-hover-2:#527751;
  --site-flag-border:rgba(255,255,255,0.18);
  --site-text-on-dark:#ffffff;
  --site-text-on-accent:#ffffff;
  --site-link-highlight:rgba(104,167,255,.10);
  --site-focus-border:#6a6a6a;
  --site-text-error:#d65f5f;

  --header-bg:#202020;
  --header-bg-2:#272727;
  --header-line:#3a3a3a;
  --header-text:#e5e5e5;
  --header-link:#e5e5e5;
  --header-link-hover:#ffffff;
  --header-active:#990101;
  --header-active-border:#ffffff;
  --header-badge-bg:#990101;
  --header-badge-text:#ffffff;
  --header-btn:#2f2f2f;
  --header-btn-hover:#3a3a3a;
  --header-btn-border:#585858;
  --header-shadow:0 8px 24px rgba(0,0,0,.22);
}

html[data-theme="light"]{
  color-scheme: light;

  --site-bg:#f4f4f4;
  --site-bg-soft:#ffffff;
  --site-surface:#ffffff;
  --site-surface-2:#f0f0f0;
  --site-surface-3:#e7e7e7;
  --site-surface-4:#dddddd;
  --site-panel:#ffffff;
  --site-panel-2:#eeeeee;
  --site-panel-3:#e5e5e5;
  --site-line:#c8c8c8;
  --site-line-soft:#d6d6d6;
  --site-border:#b9b9b9;
  --site-border-soft:rgba(0,0,0,0.16);
  --site-text:#171717;
  --site-text-strong:#000000;
  --site-text-soft:#262626;
  --site-muted:#666666;
  --site-muted-2:#555555;
  --site-link:#1f5fbf;
  --site-link-hover:#143f82;
  --site-accent:#b22222;
  --site-accent-hover:#8e1b1b;
  --site-danger:#b43a3a;
  --site-danger-hover:#962f2f;
  --site-success:#3f7d42;
  --site-table-head:rgba(0,0,0,0.06);
  --site-row-hover:#e7e7e7;
  --site-input-bg:#ffffff;
  --site-input-focus:#ffffff;
  --site-input-text:#111111;
  --site-input-border:#bdbdbd;
  --site-button:#eeeeee;
  --site-button-text:#111111;
  --site-button-hover:#dddddd;
  --site-button-border:#b7b7b7;
  --site-shadow:0 8px 24px rgba(0,0,0,.12);
  --site-inset-shadow:inset 0 1px 0 rgba(255,255,255,0.65);
  --site-tooltip-bg:rgba(20,20,20,0.92);
  --site-tooltip-text:#ffffff;
  --site-tooltip-border:rgba(255,255,255,0.22);
  --site-tooltip-shadow:0 4px 12px rgba(0,0,0,0.25);
  --site-tooltip-radius:4px;
  --site-nation:#007800;
  --site-nation-hover:#009b00;
  --site-red:#b22222;
  --site-badge-level:#cc0000;
  --site-toggle-track:#cfcfcf;
  --site-toggle-knob:#555555;
  --site-pakt:#7a3db3;
  --site-vote-for:#3f6fa4;
  --site-vote-against:#a6423f;
  --site-warning:#ffd400;
  --site-warning-text:#111111;
  --site-warning-border:#8a7400;
  --site-status-draft:#555555;
  --site-status-submitted:#8a6900;
  --site-status-approved:#2f7832;
  --site-status-failed:#b13a3a;
  --site-button-primary:#dce9f8;
  --site-button-primary-2:#bfd6f0;
  --site-button-primary-hover:#cfe1f5;
  --site-button-primary-hover-2:#a9c9eb;
  --site-button-danger:#f0d6d3;
  --site-button-danger-2:#e1b6b2;
  --site-button-danger-hover:#e7c6c2;
  --site-button-danger-hover-2:#d79c96;
  --site-button-success:#d6ead5;
  --site-button-success-2:#b8d8b7;
  --site-button-success-hover:#c6e2c4;
  --site-button-success-hover-2:#9bc99b;
  --site-flag-border:rgba(0,0,0,0.18);
  --site-text-on-dark:#ffffff;
  --site-text-on-accent:#ffffff;
  --site-link-highlight:rgba(31,95,191,.10);
  --site-focus-border:#8f8f8f;
  --site-text-error:#b13a3a;

  --header-bg:#ffffff;
  --header-bg-2:#f3f3f3;
  --header-line:#c7c7c7;
  --header-text:#171717;
  --header-link:#171717;
  --header-link-hover:#000000;
  --header-active:#b22222;
  --header-active-border:#6f1515;
  --header-badge-bg:#b22222;
  --header-badge-text:#ffffff;
  --header-btn:#eeeeee;
  --header-btn-hover:#dddddd;
  --header-btn-border:#b9b9b9;
  --header-shadow:0 8px 24px rgba(0,0,0,.10);
}

html,
body{
  margin: 0;
  padding: 0;
  background: var(--site-bg);
  color: var(--site-text);
}

.site-header,
.site-header *{
  box-sizing: border-box;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

.site-header{
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  background: linear-gradient(180deg, var(--header-bg-2) 0%, var(--header-bg) 100%);
  border-bottom: 1px solid var(--header-line);
  box-shadow: var(--header-shadow);
}

.site-header-inner{
  width: min(1280px, calc(100% - 24px));
  margin: 0 auto;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 0;
}

.site-brand-wrap{
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.site-brand{
  color: var(--header-text);
  text-decoration: none;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: .2px;
  white-space: nowrap;
}

.site-brand:hover{
  color: var(--header-link-hover);
  text-decoration: none;
}

.site-nav{
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  flex-wrap: wrap;
  min-width: 0;
}

.site-nav-link{
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--header-btn);
  color: var(--header-link);
  border: 1px solid var(--header-btn-border);
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}

.site-nav-link:hover{
  background: var(--header-btn-hover);
  color: var(--header-link-hover);
  text-decoration: none;
}

.site-nav-link.active{
  background: var(--header-active);
  border-color: var(--header-active-border);
  color: var(--site-text-on-accent);
}

.site-nav-badge{
  position: absolute;
  top: -6px;
  right: -6px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--header-badge-bg);
  color: var(--header-badge-text);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 0 0 2px var(--header-bg);
  z-index: 2;
}

.site-user-tools{
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex: 0 0 auto;
  flex-wrap: nowrap;
}

.site-theme-form{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.site-theme-label{
  color: var(--header-text);
  font-size: 12px;
  font-weight: 700;
}

.site-theme-select{
  background: var(--header-btn);
  color: var(--header-link);
  border: 1px solid var(--header-btn-border);
  border-radius: 8px;
  padding: 7px 8px;
  font-weight: 600;
  font-size: 14px;
}

.site-user-identity{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.site-user-flag{
  width: 40px;
  height: 26px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--header-btn-border);
  display: block;
  flex: 0 0 auto;
}

.site-user-link{
  display: inline-block;
  color: var(--site-link);
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.2;
  white-space: nowrap;
}

.site-user-link:hover{
  color: var(--site-link-hover);
  text-decoration: underline;
}

.site-nav-link-beta{
    position: relative;
    overflow: visible;
}

.site-nav-beta-tag{
    position: absolute;
    right: -6px;
    bottom: -10px;
    background: var(--site-warning);
    color: var(--site-warning-text);
    border: 1px solid var(--site-warning-border);
    font-size: 10px;
    line-height: 1;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 2px;
    z-index: 5;
    pointer-events: none;
    display: inline-block;
    box-shadow: 0 1px 2px rgba(0,0,0,0.35);
}

.site-nav-new-star{
    position: absolute;
    right: -8px;
    bottom: -12px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    overflow: hidden;
    isolation: isolate;
    z-index: 6;
    pointer-events: none;
    clip-path: polygon(
        50% 0%,
        61% 34%,
        98% 36%,
        68% 57%,
        79% 94%,
        50% 72%,
        21% 94%,
        32% 57%,
        2% 36%,
        39% 34%
    );
    background:
        radial-gradient(circle at 34% 23%, rgba(255,255,255,.96) 0 5%, rgba(255,255,255,.4) 13%, transparent 30%),
        linear-gradient(145deg, #fff8a6 0%, #ffdf4d 34%, #f4b900 68%, #a96800 100%);
    color: #553600;
    filter:
        drop-shadow(0 1px 1px rgba(255,255,255,.45))
        drop-shadow(0 2px 3px rgba(0,0,0,.45))
        drop-shadow(0 0 4px rgba(255,221,64,.52))
        drop-shadow(0 0 8px rgba(255,183,0,.24));
    transform: rotate(-8deg);
}

.site-nav-new-star::before{
    content: "";
    position: absolute;
    top: -12px;
    bottom: -12px;
    left: -18px;
    width: 12px;
    z-index: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,.94),
        transparent
    );
    transform: translateX(-42px) rotate(24deg);
    animation: site-nav-new-star-shimmer 3.2s ease-in-out infinite;
}

.site-nav-new-star > span{
    position: relative;
    z-index: 1;
    display: block;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 8px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -.2px;
    text-shadow:
        0 1px 0 rgba(255,255,255,.75),
        0 0 2px rgba(255,255,255,.65);
    transform: rotate(8deg);
}

@keyframes site-nav-new-star-shimmer{
    0%, 58%{
        opacity: 0;
        transform: translateX(-42px) rotate(24deg);
    }
    66%{
        opacity: 1;
    }
    82%, 100%{
        opacity: 0;
        transform: translateX(62px) rotate(24deg);
    }
}

@media (prefers-reduced-motion: reduce){
    .site-nav-new-star::before{
        animation: none;
    }
}

.site-user-action{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--header-btn);
  color: var(--header-link);
  border: 1px solid var(--header-btn-border);
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}

.site-user-action:hover{
  background: var(--header-btn-hover);
  color: var(--header-link-hover);
  text-decoration: none;
}

.site-page-shell{
  width: min(1280px, calc(100% - 24px));
  margin: 20px auto 40px;
}

@media (max-width: 900px){
  .site-header-inner{
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 0;
  }

  .site-nav{
    width: 100%;
  }

  .site-user-tools{
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}
