:root {
  color-scheme: light;
  --paper: #fafafc;
  --ink: #292331;
  --muted: #68616f;
  --pink: #f3c6d8;
  --line: #ddd6e1;
  --plum: #694461;
  --field: #ffffff;
  --field-border: #a89cad;
  --note: #f6eef4;
  --button-ink: #292331;
  --button-hover: #eab0ca;
  --secondary-hover: #f0e6ee;
  --message: #292331;
  --message-ink: #ffffff;
  --danger: #a82744;
  font-family: Calibri, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--paper);
}
:root[data-server-theme="dark"] {
  color-scheme: dark;
  --paper: #19161e;
  --ink: #f6eff7;
  --muted: #bfb3c5;
  --line: #49404f;
  --plum: #efb8d5;
  --field: #24202b;
  --field-border: #817389;
  --note: #2b2230;
  --secondary-hover: #352c3b;
  --message: #f3c6d8;
  --message-ink: #292331;
  --danger: #ffb4bf;
}
* { box-sizing: border-box; }
body { margin: 0; }
header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 24px 5vw; border-bottom: 1px solid var(--line); }
.header-actions { display: flex; gap: 16px; align-items: center; }
.header-actions > span { color: var(--muted); }
#server-theme-toggle { white-space: nowrap; }
#server-theme-toggle[aria-pressed="true"] { border-color: var(--pink); }
a { color: var(--plum); }
.brand { display: flex; gap: 12px; align-items: center; font-size: 1.6rem; font-weight: 700; text-decoration: none; color: var(--ink); }
main { max-width: 1100px; margin: 70px auto; padding: 0 28px; }
h1 { font-size: clamp(2.5rem, 5vw, 4.4rem); line-height: 1.06; letter-spacing: -.045em; font-weight: 600; margin: 0 0 24px; }
h2 { font-size: 1.55rem; margin: 0 0 16px; }
p { line-height: 1.6; max-width: 70ch; }
#login-panel { display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; gap: 70px; min-height: 55vh; }
#login-form { border-left: 4px solid var(--pink); padding: 12px 0 12px 32px; }
.intro p { font-size: 1.2rem; color: var(--muted); }
label { display: grid; gap: 7px; font-weight: 600; margin: 0 0 18px; }
input, select, textarea, button, .button { font: inherit; min-height: 44px; border-radius: 7px; }
input, select, textarea { width: 100%; border: 1px solid var(--field-border); background: var(--field); color: var(--ink); padding: 10px 12px; }
input::placeholder { color: var(--muted); opacity: 1; }
input[type="checkbox"] { accent-color: var(--plum); }
button, .button { display: inline-flex; align-items: center; justify-content: center; padding: 11px 20px; background: var(--pink); color: var(--button-ink); border: 1px solid transparent; font-weight: 600; text-decoration: none; cursor: pointer; }
button:hover, .button:hover { background: var(--button-hover); }
button:disabled { opacity: .6; cursor: wait; }
:focus-visible { outline: 3px solid var(--plum); outline-offset: 3px; }
.secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.secondary:hover { background: var(--secondary-hover); }
.danger { color: var(--danger); border-color: var(--danger); }
.danger:disabled { cursor: not-allowed; }
.muted { color: var(--muted); font-size: .95rem; }
.heading { display: flex; justify-content: space-between; gap: 24px; align-items: center; }
.heading h1 { font-size: 3rem; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.workspace-note { border-left: 4px solid var(--pink); padding: 12px 20px; margin: 24px 0 44px; background: var(--note); max-width: none; }
.users { margin: 24px 0; }
.user { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 16px; padding: 22px 0; border-top: 1px solid var(--line); align-items: end; }
.user label { margin: 0; }
.user-actions { display: grid; gap: 8px; }
.user-devices { grid-column: 1 / -1; padding: 16px 0 0; min-width: 0; }
.user-devices summary { font-size: 1rem; }
.user-devices > button { margin-top: 16px; }
.device-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.device-row > div { min-width: 0; overflow-wrap: anywhere; }
.device-row p { margin: 6px 0 0; }
.device-row > button { flex-shrink: 0; }
.device-current { display: inline-block; font-size: .8rem; padding: 3px 8px; border-radius: 6px; background: var(--pink); color: var(--button-ink); }
.user input, .user select { min-width: 0; }
.person { align-self: center; overflow-wrap: anywhere; }
.person strong { display: block; font-size: 1.15rem; }
.person label { display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: .9rem; margin-top: 8px; }
.person input { width: 18px; min-height: 18px; }
details { border-top: 1px solid var(--line); padding: 22px 0; }
summary { cursor: pointer; font-weight: 600; font-size: 1.15rem; }
.compact { max-width: 520px; margin-top: 24px; }
.security-flow { max-width: 600px; }
.security-flow h1 { font-size: clamp(2rem, 5vw, 3rem); }
.security-flow .actions { margin: 24px 0; }
.check-label { display: flex; align-items: center; gap: 10px; margin-top: 24px; }
.check-label input { width: 18px; min-height: 18px; flex-shrink: 0; }
.totp-qr { display: block; max-width: 100%; height: auto; margin: 24px 0; padding: 8px; background: #fff; }
#policy-panel { margin-bottom: 32px; }
#security-passkeys { margin-top: 20px; }
.passkey-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.passkey-row > span { min-width: 0; }
#recovery-codes { line-height: 1.7; resize: vertical; }
#passkey-login { margin-top: 12px; }
#message { position: sticky; bottom: 20px; background: var(--message); color: var(--message-ink); padding: 16px 20px; border-radius: 8px; max-width: none; }
#message:empty { display: none; }
[hidden] { display: none !important; }
@media (max-width: 720px) {
  main { margin-top: 36px; padding: 0 20px; }
  #login-panel { grid-template-columns: 1fr; gap: 30px; }
  #login-form { padding-left: 22px; }
  .heading { display: block; }
  .user { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .user button { width: 100%; }
  .device-row { align-items: stretch; flex-direction: column; gap: 12px; }
  header { padding: 18px 20px; }
  .header-actions > span { display: none; }
}
