/* Team pages (Team, a member, the profile, the sign-in and invitation screens): the page-local pieces on the
   shell's tokens and components in app.css. One block per piece, named as the templates use them. */
:root, [data-theme="dark"] { --team-discord: #8b9dff; }
[data-theme="light"] { --team-discord: #4752c4; }

/* ── role pill: the owner's is accent blue (the vocabulary has no role tone, so it lives here) ── */
.rolepill { text-transform: none; }
.rolepill--owner { background: var(--accent-bg); color: var(--accent); }
.pills { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ── a person: the picture (initials when none), the name, the line under it ── */
.person { display: flex; align-items: center; gap: 11px; min-width: 0; }
.person__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.person__name { font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.person__name:hover { text-decoration: none; color: var(--accent); }
.person__sub { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person__sub.is-bad { color: var(--bad); }
.person--lg { gap: 14px; }
.person--lg .person__text { gap: 4px; }
.person--lg .page__sub { margin-top: 0; }

/* ── Team: the members table ── */
.team-count { font: 12px/1 var(--mono); color: var(--ink-3); white-space: nowrap; }
.team-table { min-width: 900px; }
.team-table td { padding-top: 12px; padding-bottom: 12px; }
.team-table .team-table__act { text-align: right; white-space: nowrap; padding-top: 8px; padding-bottom: 8px; }
.team-table__act .inline-form + .inline-form { margin-left: 6px; }
.team-table .is-off .person, .team-table .is-off .scopes, .team-table .is-off .signin, .team-table .is-off .discord { opacity: .55; }
.team-table .is-pending .bavatar { opacity: .5; }
.team-head { flex-wrap: wrap; }
.team-meta { white-space: normal; text-align: right; max-width: 60%; line-height: 1.35; }
.scopes { display: flex; flex-wrap: wrap; gap: 5px; }
.scope { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px 0 5px; border: 1px solid var(--line-2); border-radius: 7px; font-size: 11.5px; color: var(--ink-2); white-space: nowrap; }
.scope--all { padding-left: 8px; }
.scope--none { color: var(--warn); border-color: color-mix(in oklab, var(--warn) 40%, transparent); }
.scope .glogo, .scope .mlogo { width: 14px; height: 14px; border-radius: 3px; vertical-align: 0; }
.signin { white-space: nowrap; color: var(--ink-2); }
.signin--warn { color: var(--warn); }
.discord { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--team-discord); }
.discord .icon { fill: currentColor; stroke: none; }
.discord--none { color: var(--ink-3); }
.when { font: 12px/1 var(--mono); color: var(--ink-3); white-space: nowrap; }

/* ── the permission matrices: a tick on green or a grey cross, group rows, the permission's title and words ── */
.yesno { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; color: var(--ink-3); vertical-align: middle; }
.yesno--yes { background: var(--ok-bg); color: var(--ok); }
.matrix-table { min-width: 620px; }
.matrix-table--fit { min-width: 0; }
.matrix-table th.c, .matrix-table td.c { text-align: center; white-space: nowrap; }
.matrix-table td { padding-top: 9px; padding-bottom: 9px; border-bottom-color: var(--line); }
.matrix-table .group td { padding: 14px 12px 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); border-bottom: 0; }
.matrix-table .group:first-child td { padding-top: 8px; }
.panel .matrix-table .group td:first-child { padding-left: 18px; }
.perm { display: flex; flex-direction: column; min-width: 0; }
.perm__title { font-weight: 500; color: var(--ink); }
.perm__desc { font-size: 12px; color: var(--ink-3); text-wrap: pretty; }
.perm__code { font: 11px/1.4 var(--mono); color: var(--ink-3); }
.perm__override { width: 96px; margin: 0 auto; }

/* ── the invite form, folded under the Members head ── */
.invite { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--panel); }
.invite__email { flex: 1 1 240px; }
.invite .input { height: 36px; border-radius: 10px; background-color: var(--panel-2); }
.invite .seg { background: var(--panel-2); }
.invite .seg input:checked + span { background: var(--panel); }
.invite .btn--primary { height: 36px; border-radius: 10px; }
.invite__scope { flex: 1 1 280px; }
.invite__help { flex-basis: 100%; font-size: 12px; color: var(--ink-3); }
/* the marketplace and game picks: a chip each, its logo in front, the box at the end */
.pick { display: flex; flex-wrap: wrap; gap: 6px; }
.pick label { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px 0 7px; border: 1px solid var(--line-2); border-radius: 8px; font-size: 12px; color: var(--ink-2); cursor: pointer; white-space: nowrap; background: var(--panel); }
.pick label:has(input:checked) { color: var(--ink); border-color: var(--accent); background: var(--accent-bg); }
.pick input[type="checkbox"] { width: 14px; height: 14px; margin-left: 2px; }
.pick .glogo, .pick .mlogo { width: 14px; height: 14px; border-radius: 3px; vertical-align: 0; }

/* ── the profile: the passkey list and the add row ── */
.pklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.pkrow { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line-2); }
.pkrow:last-child { border-bottom: 0; }
.pkrow__icon { width: 30px; height: 30px; flex: none; border-radius: 9px; background: var(--panel-2); color: var(--ink-2); display: grid; place-items: center; }
.pkrow__text { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
.pkrow__text .faint { font-size: 12px; }
.pkadd { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pkadd .input { flex: 1 1 180px; }

/* ── the sign-in and invitation screens: the brand, one card, "Powered by" ── */
.auth { display: flex; flex-direction: column; align-items: center; gap: 22px; width: 100%; }
.auth__brand { display: flex; align-items: center; gap: 10px; }
.auth__logo { width: 36px; height: 36px; flex: none; border-radius: 11px; object-fit: cover; background: var(--panel-2); }
.auth__name { font-size: 19px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.auth__card { width: 100%; max-width: 400px; background: var(--panel-grad); border: 1px solid var(--line); border-radius: 16px; padding: 28px; display: flex; flex-direction: column; gap: 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
[data-theme="light"] .auth__card { box-shadow: var(--pop); }
.auth__mode { display: flex; flex-direction: column; gap: 18px; }
.auth .field { align-self: stretch; }
.auth__head { display: flex; flex-direction: column; gap: 4px; text-align: center; }
.auth__title { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.auth__sub { color: var(--ink-3); text-wrap: pretty; }
.auth__primary { height: 46px; border-radius: 12px; font-size: 14px; gap: 10px; }
.auth__primary .icon { width: 18px; height: 18px; }
.auth__alt { height: 40px; border-radius: 12px; font-weight: 500; }
.auth__input { height: 44px; border-radius: 11px; }
.auth__or { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 12px; }
.auth__or::before, .auth__or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth__link { height: 36px; border: 0; background: none; color: var(--accent); font-weight: 500; cursor: pointer; border-radius: 8px; }
.auth__link:hover { text-decoration: underline; }
.auth__foot { font-size: 12px; color: var(--ink-3); text-align: center; text-wrap: pretty; }
.auth__powered { display: flex; align-items: center; gap: 7px; color: var(--ink-3); font-size: 11px; }
.auth__powered a { display: block; }
.auth__powered img { height: 10px; width: auto; display: block; opacity: .55; filter: var(--logo-filter); }
.auth__powered a:hover img { opacity: .9; }
.login-shell > .flash { width: 100%; max-width: 400px; }

@media (max-width: 760px) {
  .team-meta { max-width: 100%; text-align: left; margin-left: 0; flex-basis: 100%; }
  .matrix-table { min-width: 560px; }
  .person--lg .bavatar { --sz: 38px !important; }
  .auth__card { padding: 22px 18px; }
}
