.panel-signin {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 24px;
  background: #03151b url('/signin-background.png') center / cover fixed no-repeat;
}
.panel-signin::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(90deg, #00101870, #00101848 50%, #00101870),
              linear-gradient(0deg, #00101845, #00101836);
}
.panel-signin-card {
  width: min(360px, 100%);
  padding: 24px;
  border: 1px solid #1a625e;
  border-block-start-color: #40e2bd;
  border-radius: 16px;
  background: #071820df;
  box-shadow: 0 24px 80px #001014a8, inset 0 1px 0 #8ffff018;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
#panel-signin-form { display: grid; gap: 9px; }
#panel-signin-form label { margin-block-start: 6px; color: #e7f4f3; font-size: 13px; font-weight: 700; }
#panel-signin-form input {
  min-height: 48px;
  margin: 0;
  padding: 9px 12px;
  border: 1px solid #22434c;
  border-radius: 10px;
  background: #07171edb;
  font-size: 14px;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
#panel-signin-form input:focus {
  border-color: #42e1bd;
  background: #06151deF;
  box-shadow: 0 0 0 3px #42e1bd20, 0 0 24px #42e1bd16;
}
#panel-signin-form button {
  width: 100%;
  min-height: 48px;
  margin-block-start: 7px;
  border: 1px solid #5df0cd;
  border-radius: 10px;
  background: linear-gradient(135deg, #38d9b2, #50dfbd);
  color: #06251f;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 8px 24px #35d6ad25;
}
#panel-signin-form button:hover { background: linear-gradient(135deg, #4be8c2, #69efd0); }
#panel-signin-form button:focus-visible { outline: 3px solid #b8ffeb; outline-offset: 3px; }
.panel-field-error { margin: 0; color: #ffaaaa; font-size: .84rem; }
@media (max-width: 600px) {
  .panel-signin { padding: 18px; background-position: 57% center; }
  .panel-signin-card { padding: 22px 20px; border-radius: 16px; }
}

/* Account name and broker user share the header controls' dimensions. */
.shell > .topbar { padding-inline: 5px 12px; }
.topbar .brand #header-session { min-block-size: 30px; }
.panel-user-picker { display: flex; align-items: center; align-self: center; gap: 5px; min-width: 0; white-space: nowrap; }
.panel-user-picker .panel-account-tag {
  min-inline-size: 0;
  max-inline-size: min(120px, 24vw);
  border: 1px solid #344d5e;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
}
.panel-user-picker .panel-account-tag.has-selected-owner { max-inline-size: min(175px, 32vw); }
#header-user-name { flex: 0 1 auto; width: auto; max-inline-size: min(19vw, 220px); min-width: 0; min-height: 30px; margin: 0; line-height: 1.25; }
#header-user-name:disabled { opacity: .8; }
.panel-user-option { width: 100%; min-width: 0; text-align: start; background: transparent; border: 1px solid transparent; white-space: normal; }
.panel-user-option[aria-pressed=true] { background: #1a393b; border-color: #40776b; color: var(--mint); font-weight: 700; }
@media (max-width: 760px) {
  #header-user-name { max-inline-size: min(43vw, 180px); }
}

/* Account administration: roomy dialog with a dense, readable account table. */
#panel-accounts-dialog {
  width: min(1080px, calc(100vw - 20px));
  min-height: min(74dvh, 720px);
  max-height: 94dvh;
  overflow: auto;
  padding: 20px;
}
#panel-accounts-dialog .account-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  padding-block-end: 12px;
  border-block-end: 1px solid var(--border);
}
#panel-accounts-dialog .account-heading h2 { margin: 0; }
#panel-accounts-dialog.panel-own-account { width: min(480px, calc(100vw - 20px)); min-height: 0; }
.panel-own-account .panel-account-form { grid-template-columns: minmax(0, 1fr); }
#panel-account-add {
  display: flex;
  min-height: 38px;
  margin: 8px 0 10px auto;
  padding: 7px 14px;
}
.panel-account-table-wrap {
  margin-block: 0 16px;
  max-height: 55dvh;
  overflow: auto;
  border: 1px solid #304554;
  border-radius: 11px;
  background: var(--input);
}
.panel-account-table {
  width: 100%;
  min-width: 520px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  text-align: start;
}
.panel-account-table th,
.panel-account-table td {
  padding: 5px 10px;
  border-block-end: 1px solid #263a49;
  overflow-wrap: anywhere;
  text-align: right;
  vertical-align: middle;
}
.panel-account-table th {
  position: sticky;
  inset-block-start: 0;
  z-index: 1;
  background: #1b303e;
  color: #dce8ee;
  font-size: 11px;
  font-weight: 700;
}
.panel-account-table th:nth-child(3) { width: 21%; }
.panel-account-table th:nth-last-child(2) { width: 72px; }
.panel-account-table th:last-child { width: 94px; }
.panel-account-table :is(th, td):last-child { border-inline-start: 1px solid var(--border); }
.panel-account-table td:first-child bdi { display: block; font-weight: 700; }
.panel-account-table tbody tr:nth-child(even) { background: #ffffff04; }
.panel-account-table tbody tr:hover { background: #58e2bf0b; }
.panel-account-table tbody tr:last-child td { border-block-end: 0; }
.panel-account-row-actions { display: flex; justify-content: flex-start; gap: 7px; }
.panel-account-row-actions button { flex: none; width: 26px; height: 26px; min-height: 26px; padding: 4px; }
.panel-account-row-actions .danger:disabled { cursor: not-allowed; }
.panel-account-row-actions button svg { width: 16px; height: 16px; }
.panel-account-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-block-start: 12px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--input);
}
.panel-account-form h3,
.panel-account-form #panel-admin-username-note,
.panel-account-form .panel-account-actions { grid-column: 1 / -1; }
.panel-account-form h3 {
  padding-block-end: 8px;
  border-block-end: 1px solid var(--border);
  font-size: 13px;
}
.panel-account-form label { display: grid; align-content: start; gap: 4px; font-size: 11px; }
.panel-account-form input {
  min-height: 42px;
  margin: 0;
  padding: 8px 10px;
  font-size: 13px;
}
.panel-account-form #panel-admin-username-note { margin: 0; color: var(--muted); font-size: 10px; }
.panel-account-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-block-start: 2px; }
.panel-account-actions button { min-height: 38px; padding: 7px 14px; }
@media (max-width: 560px) {
  #panel-accounts-dialog { padding: 14px; }
  .panel-account-table-wrap { max-height: 50dvh; }
  .panel-account-form { grid-template-columns: 1fr; padding: 12px; }
  .panel-account-form h3,
  .panel-account-form #panel-admin-username-note,
  .panel-account-form .panel-account-actions { grid-column: auto; }
}


.panel-account-protection:not([hidden]) { display: grid; gap: 8px; margin-block-start: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; }
.panel-account-protection .helper { margin: 0; }
.panel-account-protection .icon-button { justify-self: start; }
#panel-protection-form:not([hidden]) { display: flex; flex-wrap: wrap; gap: 6px; align-items: end; }
#panel-protection-form label { flex: 1 1 180px; }

