:root {
  color-scheme: light;
  --field-border: #8291ad;
  --danger: #9c2c3b;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--canvas);
  color: var(--ink);
  font: 300 1rem/1.6 var(--font);
}
main { flex: 1; display: flex; flex-direction: column; }
[hidden] { display: none !important; }
::selection { background: var(--accent-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
h1, h2, p { margin: 0; }
h1, h2 { font-weight: 300; }
h1 { font-size: 2.25rem; line-height: 1.25; letter-spacing: -.025em; overflow-wrap: anywhere; }
h1:focus { outline: none; }
.icon { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.topbar {
  min-height: 77px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 40px;
  border-bottom: 1px solid var(--border);
}
.wordmark { display: flex; align-items: center; gap: 11px; flex: none; font-size: 1.2rem; letter-spacing: -.03em; }
.brand-mark { width: 22px; height: 22px; color: var(--accent); }
.account { display: flex; align-items: center; justify-content: end; flex-wrap: wrap; gap: 4px 8px; }
.identity { color: var(--muted); font-size: .875rem; padding-inline: 8px; overflow-wrap: anywhere; }
.login-view { display: grid; place-items: center; flex: 1; padding: 60px 24px 100px; }
.login-content { width: min(100%, 360px); padding-block: 14px; }
.login-content h1 { font-size: 2rem; margin-bottom: 32px; }
.field { display: grid; gap: 7px; margin-bottom: 19px; }
label { font-size: .9375rem; }
input {
  width: 100%;
  min-width: 0;
  min-height: 50px;
  padding: 10px 14px;
  border: 1px solid var(--field-border);
  border-radius: 12px;
  background: var(--canvas);
  color: var(--ink);
  caret-color: var(--accent);
  font: inherit;
}
input::placeholder { color: var(--muted); opacity: 1; }
input[aria-invalid="true"] { border-color: var(--danger); }
.password-field { position: relative; }
.password-field input { padding-right: 57px; }
button, .primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms, color 160ms;
}
.eye { position: absolute; top: 3px; right: 4px; min-width: 44px; padding: 0; color: var(--muted); }
.quiet:hover, .eye:hover, .secondary { background: var(--surface); }
.quiet:active, .eye:active, .secondary:hover { background: var(--accent-soft); }
.primary { background: var(--accent); color: var(--canvas); padding-inline: 20px; }
.primary:hover, .primary:active { background: var(--accent-hover); }
.primary:disabled { background: var(--surface); color: var(--muted); cursor: default; }
.login-submit { width: 100%; min-height: 50px; margin-top: 8px; }
.return-to-login { display: flex; margin: 8px auto 0; color: var(--accent); }
.error { color: var(--danger); font-size: .875rem; }
.help { color: var(--muted); font-size: .875rem; }
.admin-view { width: min(100%, 1136px); margin-inline: auto; padding: 64px 36px; }
.page-heading { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 16px; margin-bottom: 32px; }
.page-heading p { color: var(--muted); margin-top: 9px; overflow-wrap: anywhere; }
.page-heading .primary { align-self: center; }
.page-heading .primary[aria-expanded="true"] { display: none; }
.records { width: 100%; border-collapse: collapse; table-layout: fixed; text-align: left; font-variant-numeric: tabular-nums; }
.records th, .records td { padding: 12px 16px; }
.records th { background: var(--surface); color: var(--muted); font-weight: 300; font-size: .875rem; }
.records th:first-child { border-start-start-radius: 12px; width: 36%; }
.records th:last-child { border-start-end-radius: 12px; }
.records td { border-bottom: 1px solid var(--border); height: 72px; overflow-wrap: anywhere; }
.organizations-table th:nth-child(2) { width: 20%; }
.organizations-table th:nth-child(3) { width: 27%; }
.organizations-table td:nth-child(3) { white-space: nowrap; }
.back-button + .page-heading { margin-top: 14px; }
.back-button { color: var(--accent); margin-inline-start: -12px; padding-inline: 12px; }
.member-limit { margin: -16px 0 20px; color: var(--muted); font-size: .9375rem; }
.inline-editor {
  width: min(100%, 540px);
  margin-bottom: 28px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.inline-editor h2 { font-size: 1.375rem; margin-bottom: 20px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: end; margin-top: 25px; }
.notice:empty { display: none; }
.notice {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: calc(100% - 48px);
  padding: 10px 18px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--canvas);
  pointer-events: none;
}
.workspace { flex: 1; display: flex; flex-direction: column; }
.library-frame { flex: 1; width: 100%; min-height: 610px; border: 0; }
.workspace-compact { display: none; padding: 48px 24px; }
.workspace-compact h2 { margin-bottom: 18px; font-size: 1.5rem; }
.workspace-compact .red-account-nav { justify-content: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.workspace[data-compact] .workspace-compact { display: block; }
.workspace[data-compact] .library-frame { display: none; }
@media (max-width: 1099px) {
  .workspace:not([data-open-frame]) .library-frame { display: none; }
  .workspace:not([data-open-frame]) .workspace-compact { display: block; }
}
@media (max-width: 680px) {
  .topbar { padding-inline: 20px; min-height: 66px; align-items: start; }
  .wordmark { min-height: 44px; }
  .identity { flex-basis: 100%; text-align: right; }
  .admin-view { padding: 35px 20px; }
  .login-view { padding: 38px 24px 58px; }
  .records th, .records td { padding-inline: 8px; }
  .organizations-table th:first-child { width: auto; }
  .organizations-table th:nth-child(2) { width: calc(8ch + 16px); }
  .organizations-table th:nth-child(3) { width: calc(11ch + 20px); }
  .organizations-table th:last-child { width: 50px; }
  .records td { font-size: .875rem; }
  .inline-editor { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

.management-section {
  margin-top: 44px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.management-section h2 { font-size: 1.375rem; }
.table-scroll { overflow-x: auto; }
.table-scroll .organizations-table { min-width: 880px; }
.table-scroll .members-table { min-width: 490px; }
.table-scroll .organizations-table th:first-child { width: auto; }
.table-scroll .organizations-table th:nth-child(2) { width: 13%; }
.table-scroll .organizations-table th:nth-child(3) { width: 22%; }
.table-scroll .organizations-table th:nth-child(4) { width: 8%; }
.table-scroll .organizations-table th:nth-child(5) { width: 100px; }
.table-scroll .records th:last-child { width: 168px; }
.mobile-member-status { display: none; }
.table-button { padding-inline: 8px; color: var(--accent); white-space: nowrap; font-size: .875rem; }
.danger-text { color: var(--danger); }
#manage-dialog {
  width: min(460px, calc(100% - 32px));
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--ink);
}
#manage-dialog::backdrop { background: #22314d55; }
#manage-title { margin-bottom: 8px; font-size: 1.375rem; }
#manage-description { margin-bottom: 16px; }
.danger-button { background: var(--danger); }
.danger-button:hover { background: var(--danger); text-decoration: underline; }
@media (max-width: 680px) {
  #members-table .members-table { min-width: 0; }
  #members-table .members-table th:first-child { width: calc(11ch + 18px); }
  #members-table :is(th, td):nth-child(3) { display: none; }
  #members-table .members-table th:last-child { width: 92px; }
  #members-table td:last-child { padding-block: 6px; }
  .mobile-member-status { display: block; color: var(--muted); }
}

.home-organization {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin: 0 0 24px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.home-organization h2 { font-size: 1.125rem; }
.home-organization p { margin-top: 4px; color: var(--muted); font-size: .875rem; }
.home-organization-actions, .organization-row-actions { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.table-scroll .organizations-table th:last-child { width: 256px; }
.organization-row-actions { flex-wrap: nowrap; gap: 4px; }
.workspace-entry { background: var(--surface); }
.workspace-entry:hover { background: var(--accent-soft); }

.credit-table { min-width: 500px; }
.credit-table th:nth-child(3), .credit-table th:nth-child(4) { width: 16%; }
.credit-more { margin-top: 12px; }
