@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/bricolage-var.c47ac31e5437.woff2") format("woff2");
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-400.570751c5f8b4.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  --page: #0b0b0d;
  --surface: #111114;
  --surface-raised: #18181c;
  --line: #2d2d34;
  --line-strong: #555560;
  --text: #f4f4f5;
  --muted: #b0b0bd;
  --accent: #dc2626;
  --accent-hover: #be2020;
  --focus: #fb9292;
  --positive: #b5dbc7;
  --positive-surface: #17271f;
  --error-text: #ffb0b0;
  --body-font: "Bricolage Grotesque", Arial, sans-serif;
  --mono-font: "JetBrains Mono", monospace;
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--page);
  color: var(--text);
  font-family: var(--body-font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-underline-offset: 0.23em; }
a:hover { color: #fff; }
button, input, textarea, select { font: inherit; }
button, a, summary, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, summary { cursor: pointer; }
button, input, textarea, select { border-radius: 5px; }
input, textarea, select { max-width: 100%; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-weight: 600; }
h1 { font-size: clamp(1.75rem, 3vw, 2.5rem); letter-spacing: -0.035em; line-height: 1.16; margin-bottom: 0.7rem; }
h2 { font-size: 1.3rem; line-height: 1.3; letter-spacing: -0.025em; margin-bottom: 1.35rem; }
h3 { font-size: 1rem; margin-bottom: 0.3rem; }
p { margin-bottom: 1rem; }
img { max-width: 100%; }
code, .mono { font-family: var(--mono-font); font-size: 0.85em; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -100px; left: 1rem; z-index: 10; padding: 0.75rem 1rem; background: var(--text); color: var(--page); border-radius: 4px; }
.skip-link:focus { top: 1rem; color: var(--page); }
.site-header { min-height: 88px; padding: 1.25rem clamp(1.25rem, 5vw, 5rem); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.brand { display: inline-flex; gap: 0.7rem; align-items: center; flex-shrink: 0; font-size: 1.3rem; font-weight: 700; letter-spacing: -0.025em; text-decoration: none; }
.brand img { width: 36px; height: 36px; object-fit: contain; }
.header-context { font-size: 0.875rem; color: var(--muted); }
.top-navigation { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 1.3rem; font-size: 0.875rem; }
.top-navigation > a { color: var(--muted); text-decoration: none; padding: 0.35rem 0; }
.top-navigation > a:hover { color: var(--text); }
.inline-form { display: inline; margin: 0; }
.button-quiet { color: var(--muted); border: 1px solid var(--line); background: transparent; padding: 0.5rem 0.8rem; font-size: 0.875rem; }
.button-quiet:hover { color: var(--text); border-color: var(--line-strong); }
.main { width: min(1240px, 100%); padding: 3.5rem 2rem 5rem; margin: 0 auto; flex: 1; }
.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; padding: 1.4rem clamp(1.25rem, 5vw, 5rem); border-top: 1px solid var(--line); color: var(--muted); font-size: 0.75rem; }
.access-main { width: min(1280px, 100%); display: flex; flex-direction: column; justify-content: center; padding-top: 4rem; padding-bottom: 4rem; }
.access-layout { display: grid; grid-template-columns: 1.15fr 1fr; align-items: center; gap: clamp(3rem, 8vw, 8rem); }
.access-introduction h1 { max-width: 520px; font-size: clamp(2.4rem, 4.8vw, 4.1rem); line-height: 1.03; letter-spacing: -0.05em; margin: 1.8rem 0; }
.access-introduction > p { color: var(--muted); font-size: 1.12rem; max-width: 360px; line-height: 1.65; }
.access-rule { display: block; width: 52px; height: 4px; background: var(--accent); }
.access-note { margin-top: 3.8rem; max-width: 360px; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.access-note p:first-child { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.45rem; }
.access-note p:last-child { font-size: 0.86rem; color: var(--muted); margin-bottom: 0; line-height: 1.65; }
.access-card, .form-card { background: var(--surface); border: 1px solid var(--line); padding: clamp(1.5rem, 3.5vw, 2.7rem); border-radius: 10px; }
.access-card { width: 100%; max-width: 470px; justify-self: end; }
.card-heading { margin-bottom: 2rem; }
.card-heading h1, .card-heading h2 { margin-bottom: 0.65rem; font-size: 1.75rem; }
.card-heading p { color: var(--muted); font-size: 0.95rem; line-height: 1.65; margin-bottom: 0; }
.field { margin-bottom: 1.4rem; }
.field label { display: block; font-size: 0.88rem; font-weight: 600; margin-bottom: 0.55rem; }
.field input:not([type="checkbox"]):not([type="radio"]), .field textarea, .field select {
  display: block;
  width: 100%;
  padding: 0.8rem 0.9rem;
  min-height: 48px;
  border: 1px solid var(--line-strong);
  background: var(--page);
  color: var(--text);
}
.field input::placeholder, .field textarea::placeholder { color: #81818d; }
.field input[readonly] { color: var(--muted); }
.field textarea { min-height: 120px; resize: vertical; }
.field select { appearance: auto; }
.field-checkbox { display: grid; grid-template-columns: 1.1rem 1fr; column-gap: 0.8rem; align-items: start; }
.field-checkbox input { width: 1.1rem; height: 1.1rem; margin: 0.2rem 0 0; accent-color: var(--accent); grid-column: 1; grid-row: 1; }
.field-checkbox label { grid-column: 2; grid-row: 1; margin: 0; }
.field-checkbox .field-help, .field-checkbox [role="alert"] { grid-column: 2; }
.field-help { margin: 0.6rem 0 0; font-size: 0.8rem; line-height: 1.6; color: var(--muted); }
.field-error { margin: 0.5rem 0 0; font-size: 0.85rem; line-height: 1.5; color: var(--error-text); }
.has-error input, .has-error select, .has-error textarea { border-color: var(--error-text) !important; }
.form-errors { border-left: 3px solid var(--accent); background: #281416; color: var(--error-text); padding: 0.85rem 1rem; margin: 0 0 1.5rem; font-size: 0.875rem; }
.form-errors p:last-child { margin: 0; }
.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: 0.75rem 1.1rem; border: 1px solid transparent; border-radius: 5px; font-size: 0.88rem; font-weight: 600; line-height: 1.4; text-align: center; text-decoration: none; }
.button-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.button-secondary { background: var(--surface-raised); border-color: var(--line-strong); color: var(--text); }
.button-secondary:hover { border-color: var(--muted); background: #222228; }
.button-danger { color: var(--error-text); border-color: #773a3e; background: transparent; }
.button-danger:hover { background: #281416; border-color: var(--error-text); }
.button-wide { width: 100%; }
.subtle-link { font-size: 0.85rem; color: var(--muted); }
.recovery-link { display: block; width: fit-content; margin: 1.5rem auto 0; text-align: center; }
.form-main { width: 100%; display: flex; flex-direction: column; align-items: center; padding-top: 3.5rem; }
.form-card { max-width: 490px; width: 100%; }
.form-card-wide { max-width: 560px; }
.form-card > h1 + p { color: var(--muted); }
.qr-container { margin: 1.5rem auto; width: fit-content; padding: 0.7rem; background: #fff; border-radius: 5px; }
.qr-code { display: block; object-fit: contain; }
.manual-setup { border: 1px solid var(--line); border-radius: 5px; padding: 0.9rem 1rem; margin-bottom: 1.8rem; font-size: 0.875rem; }
.manual-setup summary { color: var(--muted); }
.manual-setup[open] summary { margin-bottom: 1rem; }
.manual-setup p { color: var(--muted); margin-bottom: 0.6rem; }
.setup-secret { overflow-wrap: anywhere; letter-spacing: 0.06em; }
.recovery-codes { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1rem; row-gap: 0.8rem; list-style: none; padding: 1.5rem; margin: 1.5rem 0; border: 1px solid var(--line); border-radius: 5px; background: var(--page); }
.recovery-codes li { text-align: center; overflow-wrap: anywhere; }
.recovery-codes code { font-size: 0.9rem; }
.security-note { color: var(--muted); font-size: 0.875rem; line-height: 1.65; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 2.4rem; }
.page-heading p { color: var(--muted); margin: 0; }
.page-heading .status-badge { margin-top: 0.4rem; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 1.75rem; min-width: 0; }
.panel > p { color: var(--muted); font-size: 0.9rem; }
.status-badge { display: inline-flex; flex: 0 0 auto; align-items: center; width: fit-content; gap: 0.5rem; border: 1px solid var(--line-strong); padding: 0.35rem 0.65rem; border-radius: 4px; color: var(--muted); font-size: 0.76rem; line-height: 1.4; }
.status-positive { border-color: #315441; color: var(--positive); background: var(--positive-surface); }
.status-positive::before { content: ""; display: block; width: 5px; height: 5px; border-radius: 50%; background: var(--positive); }
.form-card > .status-badge { margin-bottom: 1.2rem; }
.settings-layout { display: grid; gap: 1.5rem; max-width: 960px; }
.settings-panel h2 { padding-bottom: 1.25rem; border-bottom: 1px solid var(--line); margin-bottom: 0; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding-top: 1.5rem; }
.setting-row + .setting-row { padding-top: 1.5rem; border-top: 1px solid var(--line); margin-top: 1.5rem; }
.setting-row p { font-size: 0.875rem; color: var(--muted); margin: 0; }
.setting-row .button { flex-shrink: 0; }
.settings-panel > p { margin: 1.4rem 0; max-width: 650px; }
.settings-panel > form { margin-top: 1.5rem; }
.invitation-layout { display: grid; grid-template-columns: minmax(280px, 0.85fr) minmax(360px, 1.3fr); gap: 1.5rem; align-items: start; }
.table-scroll { overflow-x: auto; width: 100%; }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; text-align: left; }
th { font-weight: 500; color: var(--muted); font-size: 0.78rem; }
th, td { padding: 0.9rem 1rem 0.9rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
td { overflow-wrap: anywhere; }
th:last-child, td:last-child { padding-right: 0; }
tbody tr:last-child td { border-bottom: 0; }
.empty-state { padding: 1.4rem 0; margin: 0; color: var(--muted); font-size: 0.875rem; }
.home-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.5rem; }
.section-label { color: var(--muted); font-size: 0.825rem; margin-bottom: 0.8rem; }
.workspace-panel h2 { font-size: 1.75rem; margin-bottom: 1.5rem; }
.detail-list { margin: 0; }
.detail-list > div { display: grid; grid-template-columns: minmax(100px, 0.7fr) minmax(160px, 1.3fr); gap: 1rem; border-top: 1px solid var(--line); padding: 0.9rem 0; font-size: 0.875rem; }
.detail-list > div:last-child { padding-bottom: 0; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; overflow-wrap: anywhere; }
.account-callout { display: flex; flex-direction: column; align-items: start; justify-content: center; }
.account-callout h2 { margin-bottom: 0.75rem; }
.account-callout p { max-width: 300px; line-height: 1.65; margin-bottom: 1.5rem; }
.organization-list { margin-top: 1.5rem; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.8rem; }
.section-heading h2 { margin: 0; }
.organization-details { max-width: 800px; }
.organization-details .detail-list > div:first-child { border-top: 0; padding-top: 0; }
.back-link { display: inline-block; color: var(--muted); font-size: 0.875rem; margin-bottom: 1.5rem; }
.messages { width: 100%; margin-bottom: 1.5rem; }
.message { border: 1px solid var(--line-strong); background: var(--surface-raised); border-radius: 5px; font-size: 0.9rem; padding: 1rem 1.25rem; margin: 0 0 0.75rem; }
.message.success { border-color: #315441; color: var(--positive); background: var(--positive-surface); }
.message.error { border-color: #773a3e; color: var(--error-text); background: #281416; }

@media (max-width: 900px) {
  .site-header { flex-wrap: wrap; }
  .top-navigation { gap: 1rem; }
  .access-layout { gap: 2.5rem; }
  .access-introduction h1 { font-size: 3rem; }
  .access-note { margin-top: 2.5rem; }
  .invitation-layout { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .site-header { min-height: 76px; padding: 1.15rem 1.25rem; gap: 1rem; }
  .brand { font-size: 1.1rem; }
  .brand img { width: 30px; height: 30px; }
  .header-context { font-size: 0.75rem; }
  .top-navigation { justify-content: flex-start; gap: 0.55rem 1.1rem; width: 100%; }
  .main { padding: 2rem 1.25rem 3rem; }
  .access-layout { display: block; }
  .access-introduction h1 { font-size: 2.3rem; max-width: 400px; margin: 1.25rem 0 1rem; }
  .access-introduction > p { font-size: 1rem; margin-bottom: 1.7rem; max-width: 100%; }
  .access-note { display: none; }
  .access-card { max-width: 100%; }
  .card-heading h1, .card-heading h2 { font-size: 1.5rem; }
  .page-heading { margin-bottom: 1.7rem; }
  .page-heading p { font-size: 0.9rem; }
  .panel { padding: 1.35rem; }
  .home-layout { grid-template-columns: 1fr; }
  .setting-row { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .setting-row .button { width: 100%; }
  .settings-panel .button-danger { width: 100%; }
  .site-footer { font-size: 0.7rem; }
  .detail-list > div { grid-template-columns: 1fr; gap: 0.3rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

.account-menu{position:relative;color:var(--muted)}
.account-menu>summary{list-style:none;display:flex;gap:.8rem;align-items:center;padding:.45rem .65rem;border:1px solid var(--line);border-radius:5px}
.account-menu>summary::-webkit-details-marker{display:none}
.account-menu-content{position:absolute;right:0;top:calc(100% + .65rem);min-width:245px;max-width:calc(100vw - 2rem);z-index:20;background:var(--surface-raised);border:1px solid var(--line-strong);border-radius:7px;padding:.8rem;box-shadow:0 14px 30px #0008;display:flex;flex-direction:column;gap:.2rem}
.account-menu-content a{padding:.45rem .55rem;text-decoration:none;border-radius:3px;color:var(--text)}
.account-menu-content a:hover{background:var(--line)}
.account-identity{font-size:.76rem;overflow-wrap:anywhere;padding:0 .55rem;color:var(--text)}
.account-role{font-size:.7rem;padding:0 .55rem .6rem;border-bottom:1px solid var(--line);margin-bottom:.3rem}
.account-menu-content form{margin:.4rem .55rem 0;padding-top:.5rem;border-top:1px solid var(--line)}
.account-menu-content button{width:100%}
