#ctv-account[open] {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: min(100% - 32px, 390px);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  margin: auto;
  padding: 26px;
  border: 1px solid #345066;
  border-radius: 20px;
  background: #102334;
  color: #edf5fa;
  box-shadow: 0 24px 70px #050d16b3;
  font-family: system-ui, sans-serif;
}

#ctv-account::backdrop { background: #08151b94; }
#ctv-account [hidden], #ctv-account-open[hidden] { display: none; }

.ctv-account-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

#ctv-account-title { margin: 0; font-size: 24px; font-weight: 700; }

.ctv-account-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 18px;
  border-radius: 12px;
  background: #0a1926;
}

#ctv-account button, #ctv-account-open {
  font: 600 14px system-ui, sans-serif;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
}

#ctv-account button { min-height: 42px; }
#ctv-account button[disabled] { opacity: 0.65; cursor: wait; }
.ctv-account-modes button { color: #b6cadd; background: transparent; }
.ctv-account-modes button[aria-pressed="true"] { color: #f4f8fa; background: #28485e; }

#ctv-account-form { display: grid; gap: 13px; }
#ctv-account-form label { display: grid; gap: 6px; font-size: 14px; }
#ctv-account-form input {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  border: 1px solid #365369;
  border-radius: 9px;
  padding: 9px 12px;
  outline-offset: 2px;
  background: #0b1b29;
  color: #f4f9fc;
  font: 16px system-ui, sans-serif;
}

#ctv-account :focus-visible, #ctv-account-open:focus-visible { outline: 2px solid #7cd9f1; outline-offset: 2px; }
#ctv-account-submit { margin-top: 4px; background: #68cce1; color: #0b222d; }
#ctv-account-guest, #ctv-account-close {
  border-color: #3b596e;
  background: #1b3245;
  color: #e2edf5;
}

#ctv-account-guest { width: 100%; margin-top: 10px; }
#ctv-account-close { padding: 0 12px; }
#ctv-account-message { margin: 12px 0 0; color: #ffc3b8; font-size: 13px; line-height: 1.45; }

#ctv-account-open {
  position: absolute;
  z-index: 90;
  top: max(8px, env(safe-area-inset-top));
  right: 9px;
  min-height: 34px;
  padding: 0 10px;
  color: #f1f8fc;
  background: #102637dc;
  border-color: #6b96ac6e;
}

@media (max-height: 540px) {
  #ctv-account[open] { padding: 17px; }
  .ctv-account-head { margin-bottom: 10px; }
}
