:root{
  --tq-brand-primary:var(--tq-brand-navy);
  --tq-brand-primary-hover:var(--tq-brand-navy-soft);
  --tq-brand-primary-active:var(--tq-brand-navy-strong);
  --tq-accent:var(--tq-brand-orange);
  --tq-accent-hover:var(--tq-brand-orange-strong);
  --tq-accent-active:var(--tq-brand-orange-active);
  --tq-accent-soft:var(--tq-brand-orange-soft);
  --tq-text-on-accent:var(--tq-action-primary-contrast);
  --tq-bg-page:var(--tq-surface-page);
  --tq-bg-subtle:var(--tq-surface-subtle);
  --tq-bg-elevated:var(--tq-surface-raised);
  --tq-bg-inverse:var(--tq-surface-inverse);
  --tq-surface:var(--tq-surface-default);
  --tq-border:var(--tq-border-subtle);
  --tqds-canvas:var(--tq-surface-page);
  --tqds-navy:var(--tq-brand-navy);
  --tqds-navy-elevated:var(--tq-brand-navy-soft);
  --tqds-paper:var(--tq-surface-page);
  --tqds-card:var(--tq-surface-raised);
  --tqds-text:var(--tq-text-primary);
  --tqds-body:var(--tq-text-secondary);
  --tqds-muted:var(--tq-text-muted);
  --tqds-muted-on-dark:var(--tq-text-on-brand-muted);
  --tqds-border:var(--tq-border-subtle);
  --tqds-border-on-dark:var(--tq-border-on-brand);
  --tqds-hover-border:var(--tq-brand-orange);
  --tqds-orange:var(--tq-brand-orange);
  --tqds-orange-bright:var(--tq-brand-orange-strong);
  --tqds-focus:var(--tq-focus-color);
}

.tq-global-theme-switch{
  box-sizing:border-box;
  display:inline-flex;
  flex:none;
  align-items:center;
  justify-content:center;
  gap:2px;
  width:148px;
  height:52px;
  padding:3px;
  border:1px solid var(--tqds-border-on-dark);
  border-radius:999px;
  background:var(--tqds-navy);
  box-shadow:0 4px 12px rgba(3,10,20,.2),inset 0 1px 0 rgba(255,255,255,.07);
}

.tq-global-theme-switch [data-theme-choice]{
  box-sizing:border-box;
  display:grid;
  flex:1 1 0;
  min-width:44px;
  min-height:44px;
  place-items:center;
  border-radius:50%;
  border:1px solid transparent;
  background:transparent;
  color:var(--tqds-muted-on-dark);
  cursor:pointer;
  touch-action:manipulation;
  transition:background-color 200ms cubic-bezier(.2,.8,.2,1),color 200ms cubic-bezier(.2,.8,.2,1),border-color 200ms cubic-bezier(.2,.8,.2,1),box-shadow 200ms cubic-bezier(.2,.8,.2,1);
}

.tq-global-theme-switch [data-theme-choice] svg{
  display:block;
  width:19px;
  height:19px;
  stroke:currentColor;
  stroke-width:1.7;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.tq-global-theme-switch [data-theme-choice]:hover{
  background:var(--tqds-navy-elevated);
  color:var(--tqds-paper);
}

.tq-global-theme-switch [data-theme-choice].is-selected{
  border-color:var(--tqds-orange-bright);
  background:var(--tqds-orange);
  color:var(--tq-text-on-accent);
  box-shadow:0 2px 6px rgba(3,10,20,.3),inset 0 1px 0 rgba(255,255,255,.24);
}

.tq-global-theme-switch [data-theme-choice]:focus-visible{
  outline:3px solid var(--tqds-orange);
  outline-offset:3px;
}

.tq-footer-credit,
.tq-footer-utility{
  display:flex;
  align-items:center;
  gap:20px;
}

.tq-footer-utility{
  margin-left:auto;
}

body.qhub-workspace > footer.tq-site-footer,
body.tq-organizer-auth > footer.tq-site-footer{
  display:block!important;
  margin-top:0;
}

body.qhub-workspace > footer.tq-site-footer .tq-footer-inner,
body.tq-organizer-auth > footer.tq-site-footer .tq-footer-inner{
  display:none!important;
}

body.qhub-workspace > footer.tq-site-footer .tq-footer-bottom,
body.tq-organizer-auth > footer.tq-site-footer .tq-footer-bottom{
  box-sizing:border-box;
  width:min(1200px,calc(100% - 48px));
  margin:0 auto;
  padding:12px 0;
  justify-content:flex-end;
  gap:0;
}

body.qhub-workspace > footer.tq-site-footer .tq-footer-bottom > :not(.tq-footer-utility),
body.tq-organizer-auth > footer.tq-site-footer .tq-footer-bottom > :not(.tq-footer-utility){
  display:none;
}

@media(min-width:861px) and (min-height:640px){
  body.tq-organizer-auth{
    display:flex;
    flex-direction:column;
    min-height:100dvh;
  }

  body.tq-organizer-auth #app{
    flex:1 0 auto;
    min-height:calc(100dvh - var(--tq-auth-viewport-inset,0px) - 64px);
  }

  body.tq-organizer-auth #app > .tq-auth:not(.tq-auth--modal){
    height:min(860px,calc(100dvh - var(--tq-auth-viewport-inset,0px) - 2*var(--tq-auth-pad,clamp(18px,4vw,48px)) - 64px));
  }
}

html[data-theme-resolved=light] body:not(.qhub-workspace),
html[data-theme-resolved=light] body:not(.qhub-workspace) #app,
html[data-theme-resolved=light] body:not(.qhub-workspace) main{
  background:var(--tqds-canvas)!important;
  color:var(--tqds-text);
}

html[data-theme-resolved=dark] body:not(.qhub-workspace),
html[data-theme-resolved=dark] body:not(.qhub-workspace) #app,
html[data-theme-resolved=dark] body:not(.qhub-workspace) main{
  background:var(--tqds-canvas)!important;
  color:var(--tqds-text);
}

html[data-theme-resolved=light] body:not(.qhub-workspace) #app .section-head h2,
html[data-theme-resolved=light] body.tq-about-route #app .tq-about-page :is(h1,h2,h3){
  color:var(--tq-text-primary)!important;
}

html[data-theme-resolved=dark] body.tq-about-route #app .tq-about-page :is(h1,h2,h3){
  color:var(--about-ink)!important;
}

@media(max-width:1100px) and (min-width:721px){
  .tq-footer-bottom{
    width:min(1200px,calc(100% - 48px));
  }
}

@media(max-width:720px){
  .tq-global-theme-switch{
    width:148px;
    height:52px;
  }

  .tq-footer-bottom{
    width:calc(100% - 30px);
    flex-wrap:wrap;
    gap:12px;
    padding:16px 0 20px;
  }

  body.qhub-workspace > footer.tq-site-footer .tq-footer-bottom,
  body.tq-organizer-auth > footer.tq-site-footer .tq-footer-bottom{
    width:calc(100% - 30px);
    padding:10px 0 14px;
  }

  .tq-global-theme-switch [data-theme-choice]{
    min-width:44px;
    min-height:44px;
  }
}

@media(prefers-reduced-motion:reduce){
  .tq-global-theme-switch [data-theme-choice]{transition:none}
}
