:root {
  --bg: #f6f7f9;
  --surface: #fff;
  --text: #1c2330;
  --muted: #5b6475;
  --line: #d9dde5;
  --accent: #2753d6;
  --accent-text: #fff;
  --ok: #1a7f45;
  --bad: #b3261e;
  --zebra: #eef1f6;
  --flash-error-bg: #fdeceb;
  --flash-ok-bg: #e6f5ec;
  --flash-info-bg: #e8effd;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151b;
    --surface: #1b2029;
    --text: #e8ebf1;
    --muted: #9aa3b5;
    --line: #323a49;
    --accent: #7a9bff;
    --accent-text: #0b1020;
    --ok: #4cc27f;
    --bad: #ff8a80;
    --zebra: #222834;
    --flash-error-bg: #3a1f1d;
    --flash-ok-bg: #17301f;
    --flash-info-bg: #1c2742;
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font:
    16px/1.5 system-ui,
    sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a {
  color: var(--accent);
}
h1 {
  font-size: 1.4rem;
  margin: 0 0 0.75rem;
}
.brand {
  text-align: center;
  padding: 2rem 1rem 0;
}
.brand-name {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
}
.card-page {
  width: min(26rem, calc(100% - 2rem));
  margin: 1.25rem auto;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
}
.page {
  width: min(64rem, calc(100% - 2rem));
  margin: 1.25rem auto;
  flex: 1;
}
.footer {
  margin-top: auto;
  padding: 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}
.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  flex: 1;
}
.nav a {
  text-decoration: none;
  color: var(--muted);
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}
.nav a[aria-current='page'] {
  color: var(--text);
  border-bottom-color: var(--accent);
}
.user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.user form {
  margin: 0;
}
.badge {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 0.8rem;
  font-weight: 700;
}
.form {
  display: grid;
  gap: 0.5rem;
  margin: 1rem 0;
}
label {
  font-weight: 600;
  font-size: 0.9rem;
}
input[type='text'],
input[type='password'],
input[type='email'],
input[type='url'] {
  width: 100%;
  padding: 0.6rem 0.7rem;
  font: inherit;
  color: inherit;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
}
input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
button,
.button {
  font: inherit;
  padding: 0.65rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--line);
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  color: var(--text);
  background: var(--surface);
}
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
  margin-top: 0.5rem;
}
button.secondary,
.button.secondary {
  background: transparent;
}
button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
button.link {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent);
  text-decoration: underline;
}
.inline {
  display: inline;
}
.small {
  font-size: 0.875rem;
  color: var(--muted);
}
.flash {
  padding: 0.7rem 0.9rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
}
.flash-error {
  background: var(--flash-error-bg);
  border-color: var(--bad);
}
.flash-success {
  background: var(--flash-ok-bg);
  border-color: var(--ok);
}
.flash-info {
  background: var(--flash-info-bg);
  border-color: var(--accent);
}
.or {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  margin: 1rem 0;
}
.or::before,
.or::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--line);
}
.passkey-option button {
  width: 100%;
}
.links {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  gap: 0.4rem;
}
.choices {
  border: 0;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.6rem;
}
.choice {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  font-weight: 400;
  cursor: pointer;
}
.choice:has(input:checked) {
  border-color: var(--accent);
}
.choice[aria-disabled='true'] {
  opacity: 0.5;
  cursor: not-allowed;
}
.qr {
  display: block;
  margin: 0.75rem auto;
  background: #fff;
  padding: 0.5rem;
  border-radius: 0.5rem;
}
.manual-key {
  word-break: break-all;
  font-size: 1rem;
  color: var(--text);
}
.codes {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}
.codes td {
  padding: 0.4rem;
  text-align: center;
  border: 1px solid var(--line);
  font-size: 1.05rem;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.check {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-weight: 400;
}
.rules {
  list-style: none;
  padding: 0;
  margin: 0.25rem 0 0.5rem;
  display: grid;
  gap: 0.25rem;
  font-size: 0.9rem;
}
.rules li {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.rules .mark::before {
  content: '✘';
  color: var(--bad);
}
.rules li.ok .mark::before {
  content: '✔';
  color: var(--ok);
}
.cards {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
}
.cards .card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
}
.cards .card a {
  display: block;
  padding: 1rem;
  text-decoration: none;
  color: var(--text);
}
.cards .note {
  color: var(--muted);
  font-size: 0.9rem;
}
.ext {
  margin-left: 0.35rem;
  color: var(--muted);
}
.empty {
  color: var(--muted);
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
@media (max-width: 40rem) {
  .user-name {
    display: none;
  }
}
.problems {
  margin: 0.25rem 0;
  padding-left: 1.25rem;
  color: var(--bad);
  font-size: 0.9rem;
}
.panels {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(14rem, 18rem) 1fr;
  align-items: start;
}
@media (max-width: 48rem) {
  .panels {
    grid-template-columns: 1fr;
  }
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.panels .panel {
  margin-bottom: 0;
}
.panel h2 {
  font-size: 1.05rem;
  margin: 0 0 0.75rem;
}
.panel.narrow {
  max-width: 30rem;
  margin-inline: auto;
}
.avatar {
  display: block;
  width: 8rem;
  height: 8rem;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1rem;
  background: var(--bg);
}
.avatar-initials {
  display: grid;
  place-items: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent-text);
  background: var(--accent);
}
.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.6rem 1.25rem;
  margin: 0 0 1rem;
}
.facts dt {
  font-weight: 600;
  color: var(--muted);
}
.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0;
  margin: 0;
}
.chips li {
  padding: 0.1rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  font-size: 0.9rem;
}
.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.35rem 0;
}
.row p {
  margin: 0;
}
hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0.75rem 0;
}
.status-on {
  margin-left: 0.5rem;
  color: var(--ok);
  font-size: 0.9rem;
}
.status-on::before {
  content: '● ';
}
button.danger,
.button.danger {
  color: var(--bad);
  border-color: var(--bad);
  background: transparent;
}
button.primary.danger,
button.danger[type='submit'] {
  background: var(--bad);
  color: var(--accent-text);
  border-color: var(--bad);
}
.passkey-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
.passkey-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
}

/* The trusted device's mark: the browser it came from, with its system on the corner. */
.device-name {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.device-icon {
  position: relative;
  display: inline-block;
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
}
.device-icon .device-mark {
  display: block;
  width: 100%;
  height: 100%;
}
.device-os {
  position: absolute;
  right: -0.3rem;
  bottom: -0.3rem;
  display: block;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 0 0 1.5px var(--surface);
}
.device-os .device-mark {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}
.passkey-info {
  flex: 1 1 12rem;
}
.inline-form {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.inline-form input {
  width: 10rem;
}
input[aria-invalid='true'] {
  border-color: var(--bad);
}
dialog {
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 0;
  width: min(32rem, calc(100% - 2rem));
  background: var(--surface);
  color: var(--text);
}
dialog::backdrop {
  background: rgb(0 0 0 / 0.5);
}
dialog .dialog-body {
  padding: 1.25rem;
}
dialog .flash {
  margin-bottom: 0.75rem;
}
dialog .panel {
  border: 0;
  padding: 0;
  margin: 0;
}
dialog h1 {
  font-size: 1.2rem;
}
.dialog-close {
  float: right;
}

/* The profile sections: a row of cards, the current one filled in. */
.tab-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0 0 1.25rem;
}
.tab-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  text-decoration: none;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  font-weight: 500;
}
.tab-card:hover {
  border-color: var(--accent);
  color: var(--text);
}
.tab-card[aria-current='page'] {
  color: var(--accent-text);
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.2);
}
@media (max-width: 40rem) {
  .tab-card {
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.6rem 0.4rem;
    font-size: 0.85rem;
  }
}
.icon {
  flex: none;
}

/* A button that is only an icon (copy). */
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  vertical-align: middle;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  cursor: pointer;
}
.icon-button:hover {
  color: var(--text);
  border-color: var(--accent);
}
.icon-button .icon-check {
  display: none;
  color: var(--ok);
}
.icon-button.copied .icon-copy {
  display: none;
}
.icon-button.copied .icon-check {
  display: block;
}
.icon-button[hidden] {
  display: none;
}

/* The bar: full on a wide screen; on a phone only the name of the app and a menu button. */
.menu {
  display: none;
  margin-left: auto;
  position: relative;
}
.menu summary {
  list-style: none;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  cursor: pointer;
  color: var(--text);
}
.menu summary::-webkit-details-marker {
  display: none;
}
.menu[open] summary {
  background: var(--bg);
}
.menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  z-index: 10;
  min-width: 14rem;
  display: grid;
  gap: 0.15rem;
  padding: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.25);
}
.menu-panel a,
.menu-signout {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.6rem 0.75rem;
  border: 0;
  border-radius: 0.5rem;
  background: none;
  color: var(--text);
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}
.menu-panel a:hover,
.menu-signout:hover {
  background: var(--bg);
}
.menu-panel a[aria-current='page'] {
  font-weight: 600;
  box-shadow: inset 3px 0 var(--accent);
}
.menu-panel form {
  margin: 0.25rem 0 0;
  padding-top: 0.25rem;
  border-top: 1px solid var(--line);
}
.menu-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  padding: 0.5rem 0.75rem;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
@media (max-width: 48rem) {
  .nav-wide,
  .user-wide {
    display: none;
  }
  .menu {
    display: block;
  }
}

/* Applications */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
}
.page-head h1 {
  margin: 0;
}
.cards .card a {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
.app-icon {
  flex: none;
  width: 3rem;
  height: 3rem;
  border-radius: 0.6rem;
  object-fit: cover;
  background: var(--bg);
}
.app-icon.small {
  width: 2rem;
  height: 2rem;
  border-radius: 0.4rem;
}
.app-icon-initials {
  display: inline-grid;
  place-items: center;
  color: var(--accent-text);
  background: var(--accent);
  font-weight: 700;
  font-size: 1rem;
}
.app-icon.small.app-icon-initials {
  font-size: 0.8rem;
}

/* The catalog: a table across the page, a border round every cell, alternate rows tinted. */
.page.page-wide {
  width: calc(100% - 3rem);
  max-width: none;
}
.with-icon {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}
.table-wrap {
  overflow-x: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}
.table th,
.table td {
  padding: 0.7rem 0.9rem;
  text-align: left;
  vertical-align: top;
  border: 1px solid var(--line);
}
.table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
  background: var(--bg);
}
.table tbody tr:nth-child(even) td {
  background: var(--zebra);
}
@media (max-width: 40rem) {
  .page.page-wide {
    width: calc(100% - 2rem);
  }
  .table.stack thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .table.stack tr {
    display: block;
    border-bottom: 1px solid var(--line);
  }
  .table.stack tr:nth-child(even) {
    background: var(--zebra);
  }
  .table.stack td,
  .table.stack tbody tr:nth-child(even) td {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border: 0;
    background: transparent;
    padding: 0.4rem 0.9rem;
  }
  .table.stack td[data-label]::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.85rem;
  }
}

/* A link that is only an icon (edit) behaves like the icon buttons. */
a.icon-button {
  text-decoration: none;
  width: 2.25rem;
  height: 2.25rem;
}
.actions-cell {
  width: 1%;
  white-space: nowrap;
}

/* A button with a glyph before its label; on a phone the label goes and the glyph is the button. */
.button.with-glyph {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
@media (max-width: 40rem) {
  .button.with-glyph {
    padding: 0.65rem;
  }
  .button.with-glyph .label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

/* Stacked on a phone, the edit button takes the whole width of its cell. */
@media (max-width: 40rem) {
  .table.stack td.actions-cell {
    display: block;
    width: auto;
    white-space: normal;
    padding: 0.4rem 0.9rem 0.75rem;
  }
  .table.stack a.icon-button {
    width: 100%;
    height: 2.5rem;
  }
}

/* Filters above a table */
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.75rem 1rem;
  margin: 0 0 1rem;
}
.filters .field {
  display: grid;
  gap: 0.25rem;
}
.filters input[type='search'],
.filters input[type='text'],
.filters input[type='date'],
.filters select {
  padding: 0.55rem 0.7rem;
  font: inherit;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  min-width: 11rem;
}
.filters button {
  margin-top: 0;
}
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 1rem 0;
}
.button.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* A badge that names where an event comes from */
.badge-label {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  font-size: 0.85rem;
  background: var(--bg);
}
.badge-label.badge-directory {
  border-color: var(--accent);
  color: var(--accent);
}
.audit-details {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.2rem;
  font-size: 0.9rem;
}
details summary {
  cursor: pointer;
}

/* Application access: one row with a switch for each application */
.access-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}
.access-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
}
.access-list form {
  margin: 0;
}
.with-icon-row {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.switch {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.6rem 0.25rem 0.3rem;
  border-radius: 2rem;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
}
.switch .knob {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.15s;
}
.switch[aria-checked='true'] {
  border-color: var(--ok);
  color: var(--ok);
}
.switch[aria-checked='true'] .knob {
  background: var(--ok);
  transform: translateX(0.2rem);
}
.status-warn {
  color: var(--bad);
  font-weight: 600;
}
.temp-password {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.4rem;
  margin: 1rem 0;
}
.temp-password code {
  word-break: break-all;
}

/* Filters above a table */
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.75rem 1rem;
  margin: 0 0 1rem;
}
.filters .field {
  display: grid;
  gap: 0.25rem;
}
.filters input[type='search'],
.filters input[type='text'],
.filters input[type='date'],
.filters select {
  padding: 0.55rem 0.7rem;
  font: inherit;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  min-width: 11rem;
}
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 1rem 0;
}
.button.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* A badge that names where an event comes from */
.badge-label {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  font-size: 0.85rem;
  background: var(--bg);
}
.badge-label.badge-directory {
  border-color: var(--accent);
  color: var(--accent);
}
.audit-details {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.2rem;
  font-size: 0.9rem;
}
details summary {
  cursor: pointer;
}

/* Application access: one row with a switch for each application */
.access-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}
.access-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
}
.access-list form {
  margin: 0;
}
.with-icon-row {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.switch {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.6rem 0.25rem 0.3rem;
  border-radius: 2rem;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
}
.switch .knob {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.15s;
}
.switch[aria-checked='true'] {
  border-color: var(--ok);
  color: var(--ok);
}
.switch[aria-checked='true'] .knob {
  background: var(--ok);
  transform: translateX(0.2rem);
}
.status-warn {
  color: var(--bad);
  font-weight: 600;
}
.temp-password {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.4rem;
  margin: 1rem 0;
}
.temp-password code {
  word-break: break-all;
}

/* An application that opens its instructions in a dialog looks like a link card but is a button. */
.cards .card .card-open {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  padding: 1rem;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.cards .card .card-open:focus-visible,
.cards .card a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 0.75rem;
}
.instructions-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 50vh;
  overflow: auto;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin: 0.75rem 0;
}
dialog.instructions .actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* The logo beside the name in the header: the operator's picture or the default. */
.brand-name {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.brand-logo {
  width: 1.75rem;
  height: 1.75rem;
  object-fit: contain;
  border-radius: 0.35rem;
}
textarea {
  width: 100%;
  padding: 0.6rem 0.7rem;
  font: inherit;
  color: inherit;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  resize: vertical;
}
textarea[aria-invalid='true'] {
  border-color: var(--bad);
}

/* The user's photo (from the directory) in the header, in place of the initials. */
.badge-photo {
  object-fit: cover;
  background: var(--bg);
}
/* Wide screens: the name and photo open a small menu that holds Sign out. */
.user-menu {
  position: relative;
}
.user-menu summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.5rem;
  cursor: pointer;
  color: var(--text);
}
.user-menu summary::-webkit-details-marker {
  display: none;
}
.user-menu summary:hover,
.user-menu[open] summary {
  background: var(--bg);
}
.user-menu .caret {
  color: var(--muted);
  font-size: 0.8rem;
}
.user-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  z-index: 10;
  min-width: 10rem;
  padding: 0.35rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.25);
}
.user-panel form {
  margin: 0;
}

/* The two ways out of a forgotten password: each button with a line saying what it does. */
.reset-choice {
  display: grid;
  gap: 0.25rem;
  margin-top: 0.5rem;
}
.reset-choice p {
  margin: 0;
}
