.atlas-account-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 8px;
  color: inherit;
  text-decoration: none;
  font-size: 13px;
  white-space: nowrap;
}
.atlas-account-link:hover { text-decoration: underline; }
.atlas-portal {
  color-scheme: dark;
  --surface: #17181c;
  --field: #22242a;
  --rule: #363842;
  --ink: #f4f4f6;
  --muted: #b8bac5;
  --accent: #c91342;
  --accent-hover: #ad1038;
  --blue: #98d3f7;
  margin: 0;
  min-height: 100vh;
  background: var(--surface);
  color: var(--ink);
  font: 1rem/1.5 system-ui, sans-serif;
}
.atlas-portal *, .atlas-portal *::before, .atlas-portal *::after { box-sizing: border-box; }
.atlas-portal [hidden] { display: none !important; }
.portal-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  padding: 10px clamp(16px, 4vw, 56px);
  min-height: 64px;
  border-bottom: 1px solid var(--rule);
}
.portal-brand, .portal-bar nav { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.portal-brand img { width: 104px; height: auto; }
.portal-brand span { color: var(--muted); padding-left: 12px; border-left: 1px solid var(--rule); }
.portal-bar nav { gap: 4px 12px; }
.atlas-portal a { color: var(--blue); text-underline-offset: 3px; }
.portal-bar nav a { display: flex; align-items: center; min-height: 44px; padding: 0 4px; }
.portal-bar nav a[aria-current="page"] { color: var(--ink); font-weight: 650; }
.portal-main { max-width: 1100px; margin: auto; padding: 48px 24px 64px; }
.access-panel { max-width: 410px; margin: min(6vh, 42px) auto 0; }
.atlas-portal h1, .atlas-portal h2 { margin: 0; letter-spacing: -.025em; line-height: 1.15; }
.atlas-portal h1 { font-size: 2rem; }
.atlas-portal h2 { font-size: 1.375rem; }
.atlas-portal .muted { color: var(--muted); margin: 8px 0 22px; }
.fields { display: grid; gap: 14px; }
.fields label, .account-filter label { display: grid; gap: 5px; font-weight: 600; font-size: .875rem; }
.atlas-portal input, .atlas-portal button {
  font: inherit;
  border: 1px solid var(--rule);
  border-radius: 7px;
  min-height: 44px;
  color: var(--ink);
  background: var(--field);
}
.atlas-portal input { width: 100%; padding: 9px 12px; font-weight: 400; }
.atlas-portal input::placeholder { color: var(--muted); }
.atlas-portal button { cursor: pointer; padding: 8px 14px; font-weight: 640; }
.atlas-portal button:hover { background: #2c2e37; }
.atlas-portal button:disabled { opacity: .55; cursor: default; }
.atlas-portal button.accent { background: var(--accent); border-color: transparent; color: #fff; }
.atlas-portal button.accent:hover { background: var(--accent-hover); }
.atlas-portal .portal-entry {
  display: grid;
  place-items: center;
  min-height: 44px;
  border-radius: 7px;
  padding: 8px 14px;
  background: var(--accent);
  color: #fff;
  font-weight: 640;
  text-decoration: none;
}
.atlas-portal .portal-entry:hover { background: var(--accent-hover); }
.atlas-portal button.danger { color: #ffb5c2; }
.atlas-portal :focus-visible, .atlas-account-link:focus-visible { outline: 2px solid #98d3f7; outline-offset: 3px; }
.feedback { margin: 0; font-size: .9rem; color: var(--blue); }
.feedback:empty { display: none; }
.feedback[data-error] { color: #ffb5c2; }
.field-help { color: var(--muted); font-size: .875rem; font-weight: 400; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.accounts-heading { display: flex; gap: 16px; justify-content: space-between; align-items: start; }
.account-filter { max-width: 360px; margin: 4px 0 16px; }
.account-filter input { margin-top: 5px; }
#accounts-feedback:not(:empty) { margin-bottom: 12px; }
.atlas-portal table { width: 100%; border-collapse: collapse; text-align: left; }
.atlas-portal th, .atlas-portal td { padding: 13px 12px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.atlas-portal th { font-size: .875rem; color: var(--muted); }
.account-name, .account-email, .account-detail { display: block; overflow-wrap: anywhere; }
.account-email, .account-detail { color: var(--muted); font-size: .875rem; }
.access-on { color: #abe2c6; }
.access-off { color: #ffb5c2; }
.account-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.account-actions button { font-size: .875rem; }
.atlas-portal dialog {
  width: min(440px, calc(100% - 24px));
  max-height: calc(100% - 28px);
  padding: 24px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
}
.atlas-portal dialog::backdrop { background: #000b; }
.sr-only { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
@media (max-width: 740px) {
  .portal-main { padding: 30px 16px 48px; }
  .accounts-heading { flex-wrap: wrap; padding-bottom: 15px; }
  .accounts-heading .muted { margin-bottom: 0; }
  .atlas-portal thead { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
  .atlas-portal table, .atlas-portal tbody { display: block; }
  .atlas-portal tr { display: flex; flex-wrap: wrap; gap: 7px 14px; padding: 12px 0; border-top: 1px solid var(--rule); }
  .atlas-portal td { border: none; padding: 0; }
  .atlas-portal td:first-child, .atlas-portal td:last-child { width: 100%; }
  .account-detail { display: inline; margin-left: 7px; }
}
@media (max-width: 440px) {
  .atlas-account-link { min-height: 44px; padding: 0 4px; font-size: 12px; }
}
