@layer modules {
  /* Accounts: the sign-in pages are one card on the editor's own canvas, then the members page and the account menu. */
  body.is-auth { min-height: 100dvh; }
  .auth { display: grid; grid-template-rows: auto 1fr; justify-items: center; gap: 2.4rem; min-height: 100dvh; padding: 2.4rem 3.2rem 4.8rem; background-color: var(--surface-2); background-image: radial-gradient(rgb(var(--ink-rgb) / .13) 1px, transparent 1.2px); background-size: 20px 20px; }
  .auth-mark { justify-self: start; }
  /* An input screen's violet stripe across the top: the one nod to the canvas the card sits on. */
  .auth-card { position: relative; align-self: center; width: min(44rem, 100%); padding: 2.6rem 3rem 2.4rem; border: 1px solid var(--line-strong); border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow-float); }
  /* The four kinds of screen, as the header wears them. */
  .auth-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; border-radius: var(--r-card) var(--r-card) 0 0; background: var(--spectrum); }
  .auth-title { margin: 0 0 .6rem; font-size: 2.6rem; font-weight: 700; letter-spacing: -.02em; }
  /* Where else to go from here, each a link that looks like one. */
  .auth-links { display: grid; gap: .7rem; margin: 2rem 0 0; padding: 1.6rem 0 0; border-top: 1px solid var(--line); list-style: none; font-size: 1.4rem; color: var(--ink-2); }
  .auth-links a, .auth-foot a { color: var(--link); font-weight: 600; text-decoration-color: currentColor; }
  .auth-links a:hover, .auth-foot a:hover { text-decoration-thickness: 2px; }
  @media (max-width: 560px) { .auth { padding: 1.6rem 1.6rem 3.2rem; } .auth-card { padding: 2rem 1.8rem 1.8rem; } }
  .auth-form { display: grid; gap: 1.4rem; margin-top: 1.8rem; }
  .auth-form .hint { display: block; margin-top: .4rem; }
  .auth-submit { width: 100%; margin-top: .4rem; }
  .auth-foot { margin: 1.4rem 0 0; font-size: 1.35rem; color: var(--ink-2); }
  .auth-foot + .auth-foot { margin-top: .4rem; }
  /* Between the password form and the passkey button, on the sign-in page. */
  .auth-divider { position: relative; display: grid; place-items: center; margin: 1.8rem 0; font-size: 1.25rem; color: var(--ink-3); }
  .auth-divider::before { content: ""; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--line); }
  .auth-divider span { position: relative; padding: 0 1rem; background: var(--surface); }
  .avatar { display: inline-grid; place-items: center; flex: none; width: 3.2rem; height: 3.2rem; border-radius: 50%; background: var(--input-soft); color: var(--input-ink); font-size: 1.25rem; font-weight: 700; letter-spacing: .02em; }
  .avatar.is-pending { background: var(--surface-2); color: var(--ink-3); border: 1px dashed var(--line-strong); }
  .avatar-button { display: grid; place-items: center; border-radius: 50%; cursor: pointer; }
  .account-menu .menu-items { min-width: 24rem; }
  .menu-heading { display: grid; gap: .1rem; margin: 0 0 .4rem; padding: .6rem .9rem .8rem; border-bottom: 1px solid var(--line); font-size: 1.3rem; }
  .menu-heading span { color: var(--ink-3); }
  .menu-items .button_to .menu-item { width: 100%; }
  .members { margin-top: 3.2rem; max-width: 80rem; }
  .member-list { list-style: none; margin: 0 0 1rem; padding: 0; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); }
  .member-row { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.2rem; padding: 1rem 1.4rem; }
  .member-row + .member-row { border-top: 1px solid var(--line); }
  .member-name { display: grid; flex: 1; min-width: 16rem; }
  .member-name .hint { margin: 0; }
  .member-role .field { min-height: 3.2rem; padding-block: .2rem; }
  .member-row .button_to { display: inline; }
  .invite-form { display: flex; flex-wrap: wrap; gap: .8rem; margin-bottom: .6rem; }
  .invite-form .field { flex: 1; min-width: 20rem; }
  .invite-form select.field { flex: 0 0 16rem; min-width: 0; }
  .link-share { max-width: 80rem; margin: 1.6rem 0; padding: 1.2rem 1.4rem; border: 1px solid var(--ok-line); border-radius: var(--r-card); background: var(--ok-soft); }
  .link-share p { margin: 0 0 .8rem; font-weight: 600; }
  /* The account page: a few groups, and inside Signing in one row per way in - what it is, how it stands, what to do. */
  /* Line tabs: one concern a tab, so a page holds one thing to read and at most one thing to save. */
  .tabs { display: flex; flex-wrap: wrap; max-width: 80rem; margin: .8rem 0 0; border-bottom: 1px solid var(--line); }
  .tab { display: inline-flex; align-items: center; gap: .8rem; margin-bottom: -1px; padding: 1.1rem 1.6rem; border-bottom: 2px solid transparent; color: var(--ink-2); font-size: 1.4rem; text-decoration: none; }
  .tab:hover { color: var(--ink); border-bottom-color: var(--line-strong); }
  .tab.is-active { border-bottom-color: var(--focus); color: var(--ink); font-weight: 600; }
  .tab:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
  .tabs + .members { margin-top: 2.4rem; }

  /* Settings, after Carbon's left panel: tabs hold one level and settings have two, so each group is a labelled list with a divider between. */
  .settings-layout { display: grid; grid-template-columns: 24rem minmax(0, 80rem); gap: 4.8rem; align-items: start; margin-top: 2.4rem; }
  .settings-nav { position: sticky; top: 2.4rem; }
  .settings-nav-group + .settings-nav-group { margin-top: 1.6rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
  .settings-nav-heading { margin: 0 0 .4rem; padding: .8rem 1.6rem; font-size: 1.2rem; font-weight: 600; letter-spacing: .032rem; color: var(--ink-3); }
  .settings-nav ul { margin: 0; padding: 0; list-style: none; }
  .settings-nav-link { display: flex; align-items: center; justify-content: space-between; gap: .8rem; min-height: 4rem; padding: 0 1.6rem; border-left: 3px solid transparent; color: var(--ink-2); font-size: 1.4rem; text-decoration: none; }
  .settings-nav-link:hover { background: var(--surface-2); color: var(--ink); }
  .settings-nav-link[aria-current="page"] { border-left-color: var(--focus); background: var(--surface); color: var(--ink); font-weight: 600; }
  .settings-nav-link:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
  .settings-body > .members:first-child, .settings-body > .link-share:first-child { margin-top: 0; }
  @media (max-width: 860px) {
    .settings-layout { grid-template-columns: minmax(0, 1fr); gap: 2.4rem; }
    .settings-nav { position: static; }
  }
  /* A row's lesser actions fold into one menu, so a list reads as its people rather than its buttons. */
  .overflow-button { display: grid; place-items: center; width: 3.2rem; height: 3.2rem; border-radius: var(--r-control); color: var(--ink-2); cursor: pointer; list-style: none; }
  .overflow-button::-webkit-details-marker { display: none; }
  .overflow-button:hover, .member-menu[open] .overflow-button { background: var(--surface-2); color: var(--ink); }
  .overflow-button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
  .overflow-button .icon { width: 2rem; height: 2rem; }
  /* A setting that is on or off saves itself when flipped. */
  .setting-title { margin-top: 3.2rem; }
  .setting-row { display: flex; align-items: center; gap: 2.4rem; max-width: 80rem; padding: 1.6rem 2rem; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); }
  .setting-text { display: grid; gap: .3rem; flex: 1; min-width: 0; font-size: 1.45rem; }
  .setting-text .hint { margin: 0; }
  .onoff { display: inline-flex; align-items: center; gap: 1rem; flex: none; cursor: pointer; }
  .onoff input { appearance: none; position: relative; width: 4.8rem; height: 2.4rem; margin: 0; border-radius: 999px; background: var(--ink-3); cursor: pointer; transition: background .12s; }
  .onoff input::after { content: ""; position: absolute; left: .3rem; top: .3rem; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: #fff; transition: translate .12s; }
  .onoff input:checked { background: var(--ok); }
  .onoff input:checked::after { translate: 2.4rem 0; }
  .onoff input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
  .onoff-state { min-width: 2.4rem; font-size: 1.35rem; color: var(--ink-2); }
  .onoff-state::after { content: attr(data-off); }
  .onoff input:checked + .onoff-state::after { content: attr(data-on); }
  @media (prefers-reduced-motion: reduce) { .onoff input, .onoff input::after { transition: none; } }
  /* One of a few, each with what it means: a list to choose from rather than a select to open. */
  .choice-list { display: grid; max-width: 80rem; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); }
  .choice { display: flex; align-items: flex-start; gap: 1.4rem; padding: 1.4rem 2rem; cursor: pointer; }
  .choice + .choice { border-top: 1px solid var(--line); }
  .choice:hover { background: var(--surface-2); }
  .choice:has(input:checked) { box-shadow: inset 3px 0 0 var(--focus); }
  .choice input { width: 1.8rem; height: 1.8rem; margin: .2rem 0 0; accent-color: var(--focus); flex: none; }
  .choice-text { display: grid; gap: .3rem; font-size: 1.45rem; }
  .choice-text .hint { margin: 0; max-width: 62rem; }
  .form-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }
  .account-lede { max-width: 62rem; margin: 0 0 1.4rem; }
  /* What a team may have, said as plainly as the settings beside it. */
  .allowance { display: grid; grid-template-columns: repeat(auto-fit, minmax(24rem, 1fr)); gap: 1.2rem; max-width: 80rem; margin: 0 0 1.6rem; }
  .allowance > div { padding: 1.6rem 2rem; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); }
  .allowance dt { color: var(--ink-3); font-size: 1.3rem; }
  .allowance dd { margin: .4rem 0 0; font-size: 2rem; font-variant-numeric: tabular-nums; }
  .account-rows { display: grid; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); list-style: none; }
  .account-row { display: grid; grid-template-columns: 4.4rem minmax(0, 1fr) auto; gap: 1.2rem 1.4rem; align-items: start; padding: 1.6rem 2rem; scroll-margin-top: 8rem; }
  .account-row + .account-row { border-top: 1px solid var(--line); }
  .account-row:target { box-shadow: inset 3px 0 0 var(--link); }
  .account-row-icon { display: grid; place-items: center; width: 4.4rem; height: 4.4rem; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface-2); }
  .account-row-icon .icon { width: 2.4rem; height: 2.4rem; }
  .account-row-head { display: grid; gap: .4rem; min-width: 0; }
  .account-row-head .hint { margin: 0; max-width: 56rem; }
  .account-row-title { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin: 0; font-size: 1.6rem; font-weight: 600; }
  .account-row-action { display: grid; justify-items: end; gap: .6rem; }
  .account-row-extra { grid-column: 2 / -1; min-width: 0; margin: 0; }
  .account-row-extra .link-share { margin: 0; }
  .members[id] { scroll-margin-top: 8rem; }
  .account-connector { margin-top: 2rem; }
  .account-connector .mcp-snippets > .more { margin: 0; }
  @media (max-width: 640px) { .account-row { grid-template-columns: 4.4rem minmax(0, 1fr); } .account-row-action { grid-column: 2; justify-items: start; } }
  /* The welcome page: one row per thing worth setting up, ticked once it is. */
  .setup-progress { display: grid; gap: .6rem; max-width: 80rem; margin: 0 0 1.6rem; }
  .setup-progress-label { font-size: 1.3rem; color: var(--ink-2); }
  .setup-progress-bar { appearance: none; display: block; width: 100%; height: .4rem; border: 0; background: var(--line); }
  .setup-progress-bar::-webkit-progress-bar { background: var(--line); }
  .setup-progress-bar::-webkit-progress-value { background: var(--focus); }
  .setup-progress-bar::-moz-progress-bar { background: var(--focus); }
  .setup-steps { display: grid; max-width: 80rem; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); list-style: none; }
  /* Laid out as the account page's rows are: what it is, how it stands, and the one thing to do on the right. */
  .setup-step { display: grid; grid-template-columns: 4.4rem minmax(0, 1fr) auto; gap: 1.2rem 1.6rem; align-items: start; padding: 1.8rem 2rem; scroll-margin-top: 28rem; }
  .setup-step + .setup-step { border-top: 1px solid var(--line); }
  /* The step put forward: the first still to do, marked the way a chosen row is elsewhere. */
  .setup-step.is-current { box-shadow: inset 3px 0 0 var(--focus); }
  /* Each step's own glyph in a tile, which turns green once the step is done. */
  .setup-icon { display: grid; place-items: center; width: 4.4rem; height: 4.4rem; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface-2); color: var(--ink); }
  .setup-icon > .icon { width: 2.4rem; height: 2.4rem; }
  .setup-step.is-done .setup-icon { border-color: var(--ok-line); background: var(--ok-soft); color: var(--ok); }
  .setup-body { display: grid; gap: .5rem; min-width: 0; }
  .setup-body .hint { margin: 0; max-width: 54rem; }
  .setup-title { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin: 0; font-size: 1.6rem; font-weight: 600; }
  .setup-step.is-done .setup-title { color: var(--ink-2); }
  .pill.is-next { border-color: var(--focus); color: var(--focus); }
  .setup-actions { display: grid; justify-items: end; gap: .8rem; }
  .setup-actions .flash { max-width: 28rem; }
  .setup-extra { grid-column: 2 / -1; min-width: 0; }
  .setup-extra .link-share { margin: 0; }
  @media (max-width: 720px) { .setup-step { grid-template-columns: 4.4rem minmax(0, 1fr); } .setup-actions { grid-column: 2; justify-items: start; } }
  .setup-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 1.2rem; margin-top: 2.4rem; }
  .setup-foot .hint { margin: 0; }
  /* What the avatar's dot is about, first thing in the menu it opens: the same dot, and the step to take next. */
  .menu-nudge { position: relative; display: grid; gap: .2rem; margin: .2rem 0 .4rem; padding: 1rem 1.2rem 1rem 3rem; border: 1px solid var(--warning-line, var(--line-strong)); border-radius: var(--r-control); background: var(--warning-soft); color: var(--ink); font-size: 1.35rem; line-height: 1.35; text-decoration: none; }
  .menu-nudge::before { content: ""; position: absolute; left: 1.2rem; top: 1.5rem; width: .9rem; height: .9rem; border-radius: 50%; background: var(--warning); }
  .menu-nudge strong { font-size: 1.4rem; font-weight: 650; }
  .menu-nudge span { color: var(--ink-2); }
  .menu-nudge:hover, .menu-nudge:focus-visible { border-color: var(--warning); }
  /* A dot on the avatar while the account has one way in and no way back. */
  .avatar-button.has-nudge { position: relative; }
  .avatar-button.has-nudge::after { content: ""; position: absolute; right: -.1rem; top: -.1rem; width: 1rem; height: 1rem; border: 2px solid var(--surface); border-radius: 50%; background: var(--warning); }
  .otp-enrol { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3.2rem; align-items: start; }
  /* A literal white, in dark mode too: a phone camera reads a QR code as dark squares on a light ground. */
  .otp-qr-frame { padding: 1.2rem; border: 1px solid var(--line); border-radius: var(--r-card); background: #fff; }
  .otp-qr { display: block; width: 20rem; height: 20rem; }
  @media (max-width: 640px) { .otp-enrol { grid-template-columns: minmax(0, 1fr); } }
  .mcp-snippets { display: grid; gap: 1.4rem; margin: 1.4rem 0 1.8rem; }
  .mcp-snippets .callback { align-items: flex-start; }
  .mcp-snippet { flex: 1; min-width: 0; }
  .mcp-tools { display: grid; gap: .5rem; margin: 0; padding: 0; list-style: none; font-size: 1.3rem; }
  .mcp-tools li { display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: 1rem; align-items: baseline; }
  .mcp-tools code { justify-self: start; color: var(--router-ink); }
  .mcp-tools span { color: var(--ink-2); }
}
