/* Reserve a shared strip below application content. The dock itself uses Shadow DOM. */
html { min-height: 100%; }
body {
  box-sizing: border-box !important;
  min-height: 100% !important;
  padding-bottom: 50px !important;
}

html:has(.cybercustom-auth-register),
body:has(.cybercustom-auth-register) {
  width: 100% !important;
  height: 100dvh !important;
  min-height: 100dvh !important;
  overflow: hidden !important;
}
body:has(.cybercustom-auth-register) { padding-bottom: 0 !important; }

cybercustom-app-dock {
  all: initial !important;
  position: fixed !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  z-index: 2147483000 !important;
  display: block !important;
  height: 49px !important;
  color-scheme: dark !important;
}

:host {
  all: initial;
  display: block;
  height: 49px;
  color-scheme: dark;
}

.dock {
  box-sizing: border-box;
  display: flex;
  width: 100%;
  height: 49px;
  padding: 5px max(12px, env(safe-area-inset-right)) 5px max(12px, env(safe-area-inset-left));
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid #31516b;
  background: #081522;
  box-shadow: 0 -3px 12px rgb(0 0 0 / 24%);
  font: 600 12px/1.15 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { box-sizing: border-box; text-decoration: none; }
.cybercustom-auth-register {
  position: fixed;
  right: 50%;
  bottom: 22px;
  z-index: 20;
  display: flex;
  min-height: 38px;
  padding: 0 15px;
  align-items: center;
  justify-content: center;
  transform: translateX(50%);
  border: 1px solid #3f9b70;
  border-radius: 8px;
  color: #d9f8e8 !important;
  background: #17603e;
  font: 600 12px/1.15 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  white-space: nowrap;
}
.cybercustom-auth-register:hover, .cybercustom-auth-register:focus-visible {
  border-color: #75d7a5;
  color: #fff !important;
  background: #207a50;
}
.cybercustom-auth-register:focus-visible { outline: 2px solid #78bdf4; outline-offset: 2px; }
.back {
  display: flex;
  height: 37px;
  padding: 0 11px;
  align-items: center;
  gap: 7px;
  border: 1px solid #46647d;
  border-radius: 8px;
  color: #dceaf6;
  background: #152738;
  white-space: nowrap;
}
.back span:first-child { color: #78bdf4; font-size: 18px; line-height: 1; }
.back:hover, .back:focus-visible { border-color: #78bdf4; background: #193650; }
.back:focus-visible, .account a:focus-visible { outline: 2px solid #78bdf4; outline-offset: 2px; }

.account, .signed-out {
  display: flex;
  min-width: 0;
  height: 37px;
  padding: 3px;
  align-items: center;
  gap: 4px;
  border: 0;
  border-radius: 8px;
  background: #152738;
}
[hidden] { display: none !important; }
.identity {
  display: grid;
  min-width: 0;
  padding: 0 5px;
  line-height: 1.05;
  text-decoration: none;
}
.identity small { color: #8fa3b7; font-size: 9px; font-weight: 500; }
.identity strong {
  max-width: 130px;
  overflow: hidden;
  color: #76e1a2;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account a, .signed-out a {
  display: grid;
  height: 29px;
  padding: 0 8px;
  place-items: center;
  border-radius: 6px;
  color: #78bdf4;
  white-space: nowrap;
}
.account a { border: 1px solid #46647d; background: #0d1b28; }
.account a.identity { height: auto; padding: 0 5px; place-items: initial; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.account a.identity:hover, .account a.identity:focus-visible, .account a.identity:active { border: 0; outline: 0; background: transparent; box-shadow: none; }
.account a.identity:hover strong, .account a.identity:focus-visible strong, .account a.identity:active strong { color: #78bdf4; text-decoration: underline; text-underline-offset: 2px; }
.signed-out a:last-child { border: 1px solid #3f9b70; color: #d9f8e8; background: #17603e; }
.signed-out a:last-child:hover { border-color: #75d7a5; background: #207a50; }
.account a:hover, .signed-out a:hover { color: #fff; background: #193650; }

@media (max-width: 420px) {
  .dock { padding-right: 7px; padding-left: 7px; gap: 6px; }
  .back { width: 37px; padding: 0; justify-content: center; }
  .back span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .identity strong { max-width: 82px; }
  .account a, .signed-out a { padding-right: 6px; padding-left: 6px; font-size: 11px; }
  .cybercustom-auth-register { bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
