/* UNAUTHORIZED DEPARTMENT — v3
   Installed-app geometry with a dedicated iOS Home Screen safe-viewport path.
   iOS standalone intentionally drops viewport-fit=cover so WebKit/iOS owns the
   Dynamic Island, status-bar and Home-indicator inset. */
html.ud-pwa-standalone,
html.ud-pwa-standalone body{
  width:100%;max-width:100%;min-height:var(--ud-pwa-viewport-height,100dvh);
  overflow-x:clip;-webkit-text-size-adjust:100%;text-size-adjust:100%;
}
html.ud-pwa-standalone body{overscroll-behavior-y:none;touch-action:pan-y pinch-zoom}
html.ud-pwa-standalone :where(a,button,[role="button"],input,select,textarea){touch-action:manipulation}

@media (max-width:1023px){
  html.ud-pwa-standalone{
    --ud-pwa-safe-top:env(safe-area-inset-top,0px);
    --ud-pwa-safe-right:env(safe-area-inset-right,0px);
    --ud-pwa-safe-bottom:env(safe-area-inset-bottom,0px);
    --ud-pwa-safe-left:env(safe-area-inset-left,0px);
    --ud-pwa-header-content:52px;
    --ud-pwa-header-total:calc(var(--ud-pwa-header-content) + var(--ud-pwa-safe-top));
    --ud-mobile-header-height:var(--ud-pwa-header-content);
  }
  html.ud-pwa-ios-standalone{
    --ud-pwa-safe-top:0px;--ud-pwa-safe-right:0px;--ud-pwa-safe-bottom:0px;--ud-pwa-safe-left:0px;
    --ud-pwa-header-total:var(--ud-pwa-header-content);
    --ud-pwa-viewport-height:100vh;
  }
  html.ud-pwa-ios-standalone,html.ud-pwa-ios-standalone body{min-height:100vh!important;height:auto}

  html.ud-pwa-standalone .ud-global-header.ud-header-v280,
  html.ud-pwa-standalone .ud-global-header.ud-header-v280.ud-stable-header-v21145,
  html.ud-pwa-standalone .ud-global-header.ud-header-v280.ud-stable-header-v21143,
  html.ud-pwa-standalone .ud-global-header.ud-header-v280.ud-stable-header-v21144{
    position:fixed!important;top:0!important;right:0!important;left:0!important;
    box-sizing:border-box!important;width:100%!important;
    height:var(--ud-pwa-header-total)!important;min-height:var(--ud-pwa-header-total)!important;max-height:var(--ud-pwa-header-total)!important;
    padding:var(--ud-pwa-safe-top) 0 0!important;margin:0!important;overflow:visible!important;
    z-index:1000!important;transform:none!important;translate:none!important;
  }
  html.ud-pwa-standalone .ud-global-header.ud-header-v280>.ud-global-nav,
  html.ud-pwa-standalone .ud-global-header.ud-header-v280 .ud-global-nav{
    box-sizing:border-box!important;display:grid!important;grid-template-columns:minmax(0,1fr) 44px!important;
    align-items:center!important;gap:8px!important;width:100%!important;
    height:var(--ud-pwa-header-content)!important;min-height:var(--ud-pwa-header-content)!important;max-height:var(--ud-pwa-header-content)!important;
    padding:0 max(12px,var(--ud-pwa-safe-right)) 0 max(12px,var(--ud-pwa-safe-left))!important;margin:0!important;
  }
  html.ud-pwa-standalone .ud-global-header .ud-header-logo,
  html.ud-pwa-standalone .ud-global-header .ud-stable-brand-v21145{
    display:block!important;width:min(128px,40vw)!important;min-width:0!important;max-width:128px!important;
    height:24px!important;min-height:24px!important;max-height:24px!important;align-self:center!important;
  }
  html.ud-pwa-standalone .ud-global-header button[aria-label="Open menu"],
  html.ud-pwa-standalone .ud-global-header button[aria-label="Close menu"],
  html.ud-pwa-standalone .ud-global-header .ud-stable-menu-button-v21145{
    position:relative!important;z-index:4!important;display:grid!important;place-items:center!important;
    width:44px!important;min-width:44px!important;max-width:44px!important;
    height:44px!important;min-height:44px!important;max-height:44px!important;
    margin:0!important;padding:0!important;justify-self:end!important;align-self:center!important;
    pointer-events:auto!important;cursor:pointer!important;touch-action:manipulation!important;
  }
  html.ud-pwa-standalone .ud-site-main,
  html.ud-pwa-standalone .ud-site-main.ud-global-layout-v21144,
  html.ud-pwa-standalone .ud-site-main.ud-global-layout-v21145{padding-top:var(--ud-pwa-header-total)!important}
  html.ud-pwa-standalone[data-ud-route="network"] .ud-site-main,
  html.ud-pwa-standalone[data-ud-route="messages"] .ud-site-main{padding-top:0!important}
  html.ud-pwa-standalone .ud-page-shell-v21144,
  html.ud-pwa-standalone .ud-page-shell-v21144.ud-unified-page-shell-v21155,
  html.ud-pwa-standalone .ud-public-page-shell-v21147{padding-top:22px!important;padding-bottom:44px!important}
  html.ud-pwa-standalone .ud-route-account-v21124{padding-top:18px!important;padding-bottom:48px!important}

  html.ud-pwa-standalone .ud-mobile-menu-v21124.ud-mobile-menu-full-cover-v21194,
  html.ud-pwa-standalone div.fixed.inset-0.ud-mobile-menu-full-cover-v21194:has(.ud-mobile-menu-logo){
    position:fixed!important;inset:0!important;top:0!important;right:0!important;bottom:auto!important;left:0!important;
    width:100vw!important;max-width:100vw!important;
    height:var(--ud-pwa-viewport-height,100dvh)!important;min-height:var(--ud-pwa-viewport-height,100dvh)!important;max-height:var(--ud-pwa-viewport-height,100dvh)!important;
    margin:0!important;padding:0!important;overflow:hidden!important;background:var(--background)!important;
    z-index:990!important;pointer-events:auto!important;
  }
  html.ud-pwa-ios-standalone .ud-mobile-menu-v21124.ud-mobile-menu-full-cover-v21194,
  html.ud-pwa-ios-standalone div.fixed.inset-0.ud-mobile-menu-full-cover-v21194:has(.ud-mobile-menu-logo){height:100vh!important;min-height:100vh!important;max-height:100vh!important}
  html.ud-pwa-standalone .ud-mobile-menu-full-cover-v21194>.ud-mobile-menu-body-v21194{
    position:absolute!important;right:0!important;bottom:0!important;left:0!important;width:100%!important;
    height:auto!important;min-height:0!important;max-height:none!important;
    padding:8px max(14px,var(--ud-pwa-safe-right)) calc(10px + var(--ud-pwa-safe-bottom)) max(14px,var(--ud-pwa-safe-left))!important;
    overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior:contain!important;-webkit-overflow-scrolling:touch!important;
    pointer-events:auto!important;
  }
  html.ud-pwa-standalone .ud-mobile-menu-v21124 nav{min-height:0!important;height:auto!important;padding:0!important;overflow:visible!important}
  html.ud-pwa-standalone .ud-mobile-menu-v21124 nav>:is(a,button):not(.ud-mobile-menu-account-v21124):not(.ud-mobile-menu-language-v21124){
    display:flex!important;align-items:center!important;min-height:42px!important;height:42px!important;padding:0 2px!important;
    font-size:clamp(16px,4.5vw,19px)!important;line-height:1!important;pointer-events:auto!important;touch-action:manipulation!important;
  }
  html.ud-pwa-standalone .ud-mobile-menu-utilities-v21126{position:static!important;margin-top:8px!important;padding-top:8px!important;gap:8px!important;box-shadow:none!important}
  html.ud-pwa-standalone .ud-mobile-menu-utilities-v21126>.ud-mobile-menu-account-v21124,
  html.ud-pwa-standalone .ud-mobile-menu-utilities-v21126>.ud-mobile-menu-language-v21124{
    min-height:42px!important;height:42px!important;padding:0 9px!important;pointer-events:auto!important;touch-action:manipulation!important;
  }
  html.ud-pwa-standalone .ud-mobile-interface-v21124 :is(.text-5xl,.text-6xl,.text-7xl,.text-8xl),
  html.ud-pwa-standalone .ud-mobile-display-title-v21124{font-size:clamp(28px,8vw,38px)!important;line-height:.97!important}
  html.ud-pwa-standalone :where(.btn-primary,.btn-ghost,button,a[role="button"]){min-height:42px}
}
@media (max-width:430px) and (max-height:900px){
  html.ud-pwa-ios-standalone{--ud-pwa-header-content:50px}
  html.ud-pwa-ios-standalone .ud-global-header .ud-header-logo{width:min(124px,38vw)!important;max-width:124px!important;height:23px!important;min-height:23px!important;max-height:23px!important}
  html.ud-pwa-ios-standalone .ud-mobile-menu-v21124 nav>:is(a,button):not(.ud-mobile-menu-account-v21124):not(.ud-mobile-menu-language-v21124){min-height:40px!important;height:40px!important;font-size:17px!important}
}
@media (prefers-reduced-motion:reduce){html.ud-pwa-standalone *{scroll-behavior:auto!important}}


/* v3 — GLOBAL PALETTE TEST
   Core: var(--ud-brand-primary,#11110f) / var(--ud-brand-support,#f0eee7) · Highlight/activation: var(--ud-brand-accent,#cc0808) */
:root,
html[data-appearance="night"]{
  --ud-black:var(--ud-brand-primary,#11110f);
  --ud-white:var(--ud-brand-support,#f0eee7);
  --ud-highlight:var(--ud-brand-accent,#cc0808);
  --ud-highlight-foreground:var(--ud-brand-primary,#11110f);
  --background:var(--ud-brand-primary,#11110f);
  --foreground:var(--ud-brand-support,#f0eee7);
  --surface:#171714;
  --surface-1:#171714;
  --surface-2:#1e1e1a;
  --line:#393930;
  --muted:#161613;
  --muted-foreground:#95948a;
  --primary:var(--ud-brand-support,#f0eee7);
  --primary-foreground:var(--ud-brand-primary,#11110f);
  --ud-global-logo-color:var(--ud-brand-support,#f0eee7);
  color-scheme:dark;
}
html[data-appearance="day"]{
  --ud-black:var(--ud-brand-primary,#11110f);
  --ud-white:var(--ud-brand-support,#f0eee7);
  --ud-highlight:var(--ud-brand-accent,#cc0808);
  --ud-highlight-foreground:var(--ud-brand-primary,#11110f);
  --background:var(--ud-brand-support,#f0eee7);
  --foreground:var(--ud-brand-primary,#11110f);
  --surface:#e6e3da;
  --surface-1:#e6e3da;
  --surface-2:#dbd8cf;
  --line:#32322d;
  --muted:#e4e1d8;
  --muted-foreground:#626158;
  --primary:var(--ud-brand-primary,#11110f);
  --primary-foreground:var(--ud-brand-support,#f0eee7);
  --ud-global-logo-color:var(--ud-brand-primary,#11110f);
  color-scheme:light;
}
::selection{background:var(--ud-highlight)!important;color:var(--ud-highlight-foreground)!important}
:where(input[type="checkbox"],input[type="radio"],progress){accent-color:var(--ud-highlight)}
:where(a,button,input,select,textarea,[tabindex]):focus-visible{outline-color:var(--ud-highlight)!important}

/* Keep primary CTAs monochrome; use acid highlight for decisive interaction feedback. */
:where(.btn-primary,.btn-primary-hover):hover:not(:disabled),
:where(.btn-primary,.btn-primary-hover):focus-visible:not(:disabled){
  background:var(--ud-highlight)!important;
  color:var(--ud-highlight-foreground)!important;
  border-color:var(--ud-highlight)!important;
}

/* Main application active states. */
:is(
  .ud-console-group button,
  .ud-dashboard-switch button,
  .admin-action,
  .ud-crew-actions-v286 button,
  .ud-crew-tabs-v286 button,
  .ud-message-action-filter,
  .ud-messages-actions>button
).is-active,
button[aria-pressed="true"]{
  background:var(--ud-highlight)!important;
  color:var(--ud-highlight-foreground)!important;
  border-color:var(--ud-highlight)!important;
}
.ud-network-nav-item.is-active{box-shadow:inset 3px 0 0 var(--ud-highlight)!important}
.ud-network-nav-item.is-active .ud-network-nav-mark{
  background:var(--ud-highlight)!important;
  color:var(--ud-highlight-foreground)!important;
  border-color:var(--ud-highlight)!important;
}
.ud-network-top-tabs button.is-active::after{background:var(--ud-highlight)!important}
:is(
 .ud-message-tabs button,
 .ud-network-search-tabs button,
 .ud-social-profile-tabs button,
 .ud-message-primary-tabs button,
 .ud-message-request-tabs button
).is-active{box-shadow:inset 0 -3px 0 var(--ud-highlight)!important}

/* Small active badges / selected controls inherit the new signature color. */
:is([data-selected="true"],[aria-selected="true"]){--ud-active-accent:var(--ud-highlight)}

/* ==========================================================================
   UNAUTHORIZED DEPARTMENT v3 — ACID BRAND INTEGRATION
   var(--ud-brand-accent,#cc0808) is a signature identity signal, not a semantic status replacement.
   ========================================================================== */
:root{
  --ud-highlight:var(--ud-brand-accent,#cc0808);
  --ud-highlight-foreground:var(--ud-brand-primary,#11110f);
  --ud-highlight-soft:color-mix(in srgb,var(--ud-highlight) 12%,transparent);
  --ud-highlight-line:color-mix(in srgb,var(--ud-highlight) 55%,var(--line));
}

/* GLOBAL HEADER — selected route becomes a clear brand signal. */
.ud-global-nav .ud-nav-link,
.ud-global-nav a,
.ud-global-nav button{
  transition:color .16s ease,border-color .16s ease,background-color .16s ease!important;
}
.ud-global-nav .ud-nav-link.ud-nav-active,
.ud-global-nav .ud-nav-active,
.ud-global-nav [aria-current="page"]{
  color:var(--ud-highlight)!important;
}
.ud-global-nav .ud-nav-link.ud-nav-active::after,
.ud-global-nav .ud-nav-active::after,
.ud-global-nav [aria-current="page"]::after{
  background:var(--ud-highlight)!important;
  height:2px!important;
}
.ud-global-nav .ud-nav-link:hover:not(.ud-nav-active),
.ud-global-nav a:hover:not([aria-current="page"]){
  color:var(--ud-highlight)!important;
}

/* MOBILE MENU — current route uses an acid rail rather than a generic fill. */
.ud-mobile-menu-v21124 :is(a,button)[aria-current="page"],
.ud-mobile-menu-v21124 .ud-nav-active{
  color:var(--ud-highlight)!important;
  border-left:3px solid var(--ud-highlight)!important;
  padding-left:calc(1em - 3px)!important;
  background:var(--ud-highlight-soft)!important;
}

/* SECTION KICKERS / EYEBROWS — repeated brand language across the site. */
.label-sm.inline-flex,
.ud-journal-kicker,
.ud-newsletter-kicker,
.ud-archive-article-kicker-v2105,
.ud-crew-kicker-v286,
.ud-health-kicker,
.ud-console-group-label,
.ud-network-group-title,
.ud-network-sidebar-heading-v21166,
.ud-map-detail-kicker-v211139,
.ud-map-ui-drawer-title-v2111403{
  color:var(--ud-highlight)!important;
}
.label-sm.inline-flex > span:first-child{
  background:var(--ud-highlight)!important;
  border-color:var(--ud-highlight)!important;
}

/* MAJOR TITLES — short acid rule, not full lime text. */
:is(h1,h2).font-black.uppercase,
.ud-page-title-v21144,
.ud-unified-page-title-v21155,
.ud-public-page-direct-title-v21147,
.ud-journal-title,
.ud-crew-directory-title{
  position:relative;
}
:is(h1,h2).font-black.uppercase::after,
.ud-page-title-v21144::after,
.ud-unified-page-title-v21155::after,
.ud-public-page-direct-title-v21147::after,
.ud-journal-title::after,
.ud-crew-directory-title::after{
  content:"";
  display:block;
  width:clamp(42px,6vw,86px);
  height:4px;
  margin-top:.22em;
  background:var(--ud-highlight);
}
/* Avoid duplicate title accents when multiple legacy title classes coexist. */
:is(h1,h2).font-black.uppercase.ud-page-title-v21144::after,
:is(h1,h2).font-black.uppercase.ud-unified-page-title-v21155::after,
:is(h1,h2).font-black.uppercase.ud-public-page-direct-title-v21147::after{
  content:"";
}

/* CTA language: monochrome body + acid signature at rest, full acid on intent. */
.btn-primary,
.ud-health-panel footer button,
.ud-order-actions .btn-primary{
  box-shadow:inset 0 -3px 0 var(--ud-highlight)!important;
}
.btn-primary:hover:not(:disabled),
.btn-primary:focus-visible:not(:disabled),
.btn-primary-hover:hover:not(:disabled),
.ud-health-panel footer button:hover:not(:disabled){
  background:var(--ud-highlight)!important;
  color:var(--ud-highlight-foreground)!important;
  border-color:var(--ud-highlight)!important;
  box-shadow:none!important;
}
.btn-ghost:hover:not(:disabled),
.btn-ghost:focus-visible:not(:disabled),
.btn-ghost-hover:hover:not(:disabled){
  color:var(--ud-highlight)!important;
  border-color:var(--ud-highlight)!important;
}

/* FORMS — acid appears at the exact point of interaction. */
:where(input,textarea,select):focus,
:where(input,textarea,select):focus-visible{
  border-color:var(--ud-highlight)!important;
  outline-color:var(--ud-highlight)!important;
  caret-color:var(--ud-highlight)!important;
}
:where(input[type="checkbox"],input[type="radio"],progress){accent-color:var(--ud-highlight)!important}

/* NETWORK — selection and navigation gain a recognisable UD acid language. */
.ud-network-top-tabs button.is-active,
.ud-network-search-tabs button.is-active,
.ud-message-tabs button.is-active,
.ud-message-primary-tabs button.is-active,
.ud-message-request-tabs button.is-active,
.ud-social-profile-tabs button.is-active,
.ud-social-profile-tabs-v21124 button.is-active{
  color:var(--ud-highlight)!important;
}
.ud-network-top-tabs button.is-active::after,
.ud-network-search-tabs button.is-active::after,
.ud-message-tabs button.is-active::after,
.ud-message-primary-tabs button.is-active::after,
.ud-message-request-tabs button.is-active::after,
.ud-social-profile-tabs button.is-active::after,
.ud-social-profile-tabs-v21124 button.is-active::after{
  background:var(--ud-highlight)!important;
  border-color:var(--ud-highlight)!important;
}
.ud-network-nav-item-v21124.is-active,
.ud-network-nav-item.is-active{
  background:var(--ud-highlight-soft)!important;
  color:var(--ud-highlight)!important;
  box-shadow:inset 3px 0 0 var(--ud-highlight)!important;
}
.ud-network-nav-item-v21124.is-active .ud-network-nav-mark,
.ud-network-nav-item.is-active .ud-network-nav-mark,
.ud-network-nav-item-v21124.is-active .ud-network-nav-count{
  color:var(--ud-highlight)!important;
  border-color:var(--ud-highlight)!important;
}

/* CREW / AUTH / CONSOLE / ADMIN selection states. */
.ud-auth-tab-v291.is-active,
.ud-crew-tabs-v285 button.is-active,
.ud-crew-tabs-v286 button.is-active,
.ud-translation-locale-tabs button.is-active,
.ud-console-mobile-nav button.is-active,
.ud-console-mobile-nav-v21124 button.is-active{
  background:var(--ud-highlight)!important;
  color:var(--ud-highlight-foreground)!important;
  border-color:var(--ud-highlight)!important;
}
.ud-console-main :is([aria-current="page"],[aria-selected="true"]),
.ud-product-editor :is([aria-selected="true"],[data-active="true"]){
  border-color:var(--ud-highlight)!important;
}

/* KEY NUMBERS — use acid selectively while semantic warning/success colors win. */
.ud-metric-value:not(.ud-metric-warning):not(.ud-metric-positive),
.ud-storage-metric strong,
.ud-social-counts strong,
.ud-social-counts-v21124 strong,
.ud-auto-stat strong{
  color:var(--ud-highlight)!important;
}

/* INTERACTIVE RECORDS — restrained acid edge rather than a lime card. */
:where(.ud-product-admin-row,.ud-storage-row,.ud-members-table-row,.ud-orders-row):hover{
  border-color:var(--ud-highlight-line)!important;
}

/* Small branded selection chips that are not semantic alert/status chips. */
:is(.ud-network-search-tabs,.ud-translation-locale-tabs,.ud-crew-tabs-v285,.ud-crew-tabs-v286) button:hover:not(.is-active){
  border-color:var(--ud-highlight-line)!important;
  color:var(--ud-highlight)!important;
}

/* Day mode keeps the acid identical for brand consistency. */
html[data-appearance="day"]{
  --ud-highlight-soft:color-mix(in srgb,var(--ud-brand-accent,#cc0808) 22%,transparent);
  --ud-highlight-line:color-mix(in srgb,#8aa900 65%,var(--line));
}

@media (max-width:767px){
  :is(h1,h2).font-black.uppercase::after,
  .ud-page-title-v21144::after,
  .ud-unified-page-title-v21155::after,
  .ud-public-page-direct-title-v21147::after,
  .ud-journal-title::after,
  .ud-crew-directory-title::after{
    width:48px;
    height:3px;
    margin-top:.18em;
  }
  .ud-network-nav-item-v21124.is-active,
  .ud-network-nav-item.is-active{
    box-shadow:inset 0 -3px 0 var(--ud-highlight)!important;
  }
}
