/** ChallengeFlow: 02-navigation.css */
@layer components {
  /* Header und Navigation */
  .nav button em {
    font-style: normal;
  }
  .nav ~ .top-actions {
    margin-left: 0;
  }
  .topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    background: var(--topbar);
    border-bottom: 1px solid var(--line);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
  }
  .topbar-inner {
    position: relative;
    width: 100%;
    margin: 0;
    display: flex;
    align-items: center;
    max-width: none;
    height: var(--topbar-height);
    padding: 0 12px;
    gap: 14px;
  }
  .app-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text);
    gap: 9px;
    white-space: nowrap;
  }
  .app-brand strong {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -.03em;
    text-transform: uppercase;
  }
  .brand-symbol {
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 17px;
    line-height: 1;
    width: 30px;
    height: 30px;
    border-radius: 0;
    background: var(--accent);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.34),0 4px 12px var(--accent-glow);
  }
  .brand-symbol svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: #fff;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .view-title {
    font-family: var(--font-display);
    display: none;
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -.02em;
    text-transform: none;
  }
  .header-primary-actions {
    position: absolute;
    left: var(--header-primary-center-x,50%);
    top: 50%;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transform: translate(-50%,-50%);
  }
  .header-primary-actions.hidden {
    display: none;
  }
  .header-primary-actions.is-compact .header-primary-button {
    width: 38px;
    padding-inline: 0;
  }
  .header-primary-actions.is-compact .header-primary-button span {
    display: none;
  }
  .header-update-button[hidden] {
    display: none;
  }
  .header-primary-button {
    min-height: 38px;
    padding: 0 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 0;
    background: #f4f4f4;
    color: #fff;
    box-shadow: 0 6px 18px rgba(0,0,0,.18);
    font-size: 12.5px;
    font-weight: 680;
    letter-spacing: -.01em;
    white-space: nowrap;
    transition: background-color .18s ease,border-color .18s ease,transform .18s ease,box-shadow .18s ease;
  }
  .header-primary-button:hover {
    background: #d3d5cc;
    border-color: rgba(255,255,255,.2);
  }
  .header-primary-button:active {
    transform: scale(.97);
  }
  .header-primary-button svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .header-create-button {
    background: var(--create-accent);
    color: var(--create-accent-ink);
    border-color: transparent;
    box-shadow: 0 7px 20px color-mix(in srgb,var(--create-accent) 32%,transparent);
  }
  .header-create-button:hover,
  .header-create-button.is-active {
    background: var(--create-accent-hover);
    color: var(--create-accent-ink);
    border-color: transparent;
    box-shadow: 0 9px 25px color-mix(in srgb,var(--create-accent) 44%,transparent);
  }
  .header-update-button {
    background: rgba(44,44,46,.96);
  }
  .nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
  }
  .nav button {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    position: relative;
    min-height: 38px;
    padding: 0 14px;
    gap: 6px;
    border-radius: 0;
    color: #3a3a3a;
    font-size: 12.5px;
    font-weight: 560;
    letter-spacing: -.01em;
    transition: background-color .18s ease,color .18s ease,transform .18s ease;
  }
  .nav button span {
    font-size: 16px;
    line-height: 1;
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    filter: none;
    opacity: .82;
  }
  .nav button span svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .nav button:hover {
    background: var(--soft);
    color: var(--text);
  }
  .nav button:active {
    transform: scale(.97);
  }
  .nav button.active {
    background: var(--accent-glow);
    color: var(--accent);
  }
  .nav button.active span {
    filter: none;
    opacity: 1;
  }
  .top-actions {
    display: flex;
    align-items: center;
    margin-left: auto;
    gap: 8px;
  }
  /* Der Tag/Nacht-Knopf ist immer sichtbar, auch vor dem Anmelden. Wenn
     Navigation und Kopfaktionen eingeblendet sind, reiht er sich ein;
     sonst rutscht er selbst an den rechten Rand. */
  .theme-toggle {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    margin-left: auto;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    color: var(--text);
    border: 1px solid var(--text);
    cursor: pointer;
    transition: background .16s ease, color .16s ease;
  }
  .nav:not(.hidden) ~ .theme-toggle {
    margin-left: 0;
  }
  .theme-toggle svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .theme-toggle:hover {
    background: var(--text);
    color: var(--page-a);
  }
  .top-actions button {
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 15px;
    width: 36px;
    height: 36px;
    min-height: 36px;
    border: 0;
    background: var(--soft);
    box-shadow: none;
    color: #d3d5cc;
    transition: background-color .18s ease,transform .18s ease;
  }
  .top-actions button:hover {
    background: var(--soft);
  }
  .top-actions button:active {
    transform: scale(.94);
  }
  .top-actions button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
}
