.team-shell {
  width: var(--page-width);
  max-width: 880px;
  margin: 28px auto 48px;
}

.team-page [hidden] { display: none !important; }
.team-page .rp-float, .team-page .rp-popup { display: none !important; }
body.team-page.has-rp-float { padding-bottom: 0; }
.team-heading, .team-section-heading, .team-actions, .team-input-action {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.team-heading, .team-section-heading { justify-content: space-between; }
.team-heading { margin-bottom: 20px; }
.team-heading h1 { margin-bottom: 8px; font-size: 1.75rem; }
.team-heading p, .team-section-heading p { margin-bottom: 0; color: var(--muted); }
.team-heading > div { min-width: 0; }
.team-heading-copy { flex: 1 1 480px; }
.team-heading-art { display: none; }
.team-contact { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 8px; font-size: 16px; }
.team-contact strong { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.team-contact .secondary-button { min-height: 44px; padding: 8px 12px; font-size: 16px; }
.team-heading .team-contact :is(.team-error, .team-local-status) { flex-basis: 100%; margin: 0; }
.team-heading .team-contact .team-error { color: var(--danger); }
.team-heading .team-contact .team-local-status { color: var(--accent); }
.team-shell:has(#team-unjoined:not([hidden])) .team-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  align-items: center;
  gap: 8px 16px;
  padding: 16px;
  border-radius: var(--radius-lg);
  color: var(--surface);
  background: var(--accent);
  --focus-ring: var(--surface);
}
.team-shell:has(#team-unjoined:not([hidden])) .team-heading-copy { grid-column: 1; grid-row: 1 / span 2; }
.team-shell:has(#team-unjoined:not([hidden])) .team-heading h1 { margin-bottom: 6px; font-size: 26px; line-height: 1.3; letter-spacing: -.02em; }
.team-shell:has(#team-unjoined:not([hidden])) .team-heading p { color: var(--surface); font-size: 14px; line-height: 1.5; }
.team-shell:has(#team-unjoined:not([hidden])) .team-heading-art { display: block; grid-column: 2; grid-row: 1; width: 64px; justify-self: center; margin: 0; }
.team-shell:has(#team-unjoined:not([hidden])) .team-heading-art figcaption { font-size: 12px; line-height: 1.4; }
.team-shell:has(#team-unjoined:not([hidden])) .team-heading > button { grid-column: 2; grid-row: 2; justify-self: stretch; min-height: 44px; padding: 10px 2px; border-color: var(--surface); color: var(--surface); background: transparent; font-size: 14px; }
.team-shell:has(#team-unjoined:not([hidden])) .team-heading > button:hover { color: var(--accent); background: var(--surface); }
.team-heading-art figcaption, .team-landing-art figcaption { margin-top: 8px; color: var(--surface); font-size: 14px; text-align: center; }
.team-panel {
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.team-panel h2 { margin-bottom: 16px; font-size: 20px; }
.team-panel h3 { margin-bottom: 8px; font-size: 17px; }
.team-panel.team-contact-editor { padding-block: 12px; }
.team-contact-editor h2 { margin-bottom: 8px; }
.team-contact-editor .team-actions { gap: 8px; }
#team-contact-qq-group { min-width: 0; font-size: 16px; font-variant-numeric: tabular-nums; }
#team-contact-form { gap: 6px; }
#team-contact-form > label { margin-bottom: 0; }
#team-contact-form :is(.team-error, .team-local-status) { margin-block: 0; }
#team-create-panel { padding: 24px; border-color: var(--accent); }
#team-create-panel > h2 { margin-bottom: 8px; font-size: 22px; }
#team-create-panel > p { margin-bottom: 20px; color: var(--muted); }
.team-auth { max-width: 640px; margin: 40px auto; padding: 36px; border-color: var(--accent); }
.team-auth-message { max-width: 18em; margin-bottom: 28px; font-size: 2rem; line-height: 1.5; font-weight: 750; }
.team-landing { margin-bottom: 18px; }
.team-landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  align-items: center;
  gap: 20px;
  padding: 20px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.team-landing-copy { min-width: 0; }
.team-landing h1 { margin-bottom: 8px; font-size: 26px; line-height: 1.3; letter-spacing: -.02em; }
.team-landing-lead { max-width: 34em; margin-bottom: 16px; font-size: 15px; line-height: 1.5; }
.team-landing-hero .team-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-width: 340px; }
.team-register-note { margin-block: 16px 0; }
.team-landing-art { width: 120px; min-width: 0; margin: 0; }
.team-landing-guide { padding: 32px; border-radius: 0 0 var(--radius-lg) var(--radius-lg); background: var(--surface); }
.team-landing h2 { margin-bottom: 8px; font-size: 24px; }
.team-landing-guide > :last-child { margin-bottom: 0; }
:is(.team-landing-hero, .team-auth, .team-invite-card, .team-next) {
  color: var(--surface);
  background: var(--accent);
  --focus-ring: var(--surface);
}
:is(.team-landing-hero, .team-auth, .team-invite-card, .team-next) .team-help { color: var(--surface); }
.team-page :is(.team-landing-hero, .team-auth, .team-invite-card, .team-next) .primary-button {
  min-height: 52px;
  border-color: var(--surface);
  color: var(--accent);
  background: var(--surface);
}
:is(.team-landing-hero, .team-auth, .team-invite-card, .team-next) .primary-button:hover,
:is(.team-landing-hero, .team-auth, .team-invite-card, .team-next) .primary-button:active { color: var(--accent-hover); background: var(--surface-muted); }
.team-page :is(.team-landing-hero, .team-auth, .team-invite-card) .secondary-button {
  min-height: 52px;
  border-color: var(--surface);
  color: var(--surface);
  background: transparent;
}
:is(.team-landing-hero, .team-auth, .team-invite-card) .secondary-button:hover,
:is(.team-landing-hero, .team-auth, .team-invite-card) .secondary-button:active { color: var(--accent); background: var(--surface); }
.team-page .team-landing-hero :is(.primary-button, .secondary-button) { min-height: 46px; padding: 10px 6px; font-size: 14px; }
.team-start-steps { list-style: none; counter-reset: team-step; margin: 0; padding: 0; }
.team-start-steps li { position: relative; counter-increment: team-step; padding: 20px 0 20px 44px; border-bottom: 1px solid var(--line); }
.team-start-steps li::before { content: counter(team-step); position: absolute; left: 0; top: 20px; color: var(--accent); font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.team-start-steps strong { font-size: 1.125rem; }
.team-start-steps p { margin-block: 6px 0; color: var(--muted); }
.team-privacy { margin-top: 24px; color: var(--muted); font-size: .875rem; }
.team-privacy strong { color: var(--ink); }
.team-panel > :last-child { margin-bottom: 0; }
.team-panel summary {
  min-height: 44px;
  padding-block: 9px;
  font-weight: 650;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.team-panel[open] > summary { margin-bottom: 12px; }
.team-page button, .team-page .primary-button, .team-page .secondary-button { min-height: 44px; min-width: 44px; overflow-wrap: anywhere; white-space: normal; }
.team-page button:disabled { cursor: wait; opacity: .65; }
.team-page input:disabled, .team-page textarea:disabled { background: var(--surface-muted); color: var(--muted); }
.team-form { display: grid; gap: 10px; }
.team-form input:not([type="checkbox"]), .team-form textarea, .team-form select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--surface);
  color: var(--ink);
}
.team-form textarea { resize: vertical; }
.team-form > button { justify-self: start; }
.team-form > label:not(.team-check) { font-weight: 600; }
.team-form p { margin-bottom: 0; }
#team-create-form { gap: 16px; }
#team-create-form input:not([type="checkbox"]), #team-create-form select {
  min-height: 52px;
  font-size: 16px;
}
#team-create-form > .primary-button[type="submit"] {
  width: 100%;
  min-height: 52px;
  font-size: 16px;
}
.team-input-action input { flex: 1 1 120px; width: 120px; }
.team-input-action button { flex: 1 1 180px; }
.team-input-action #team-password { font-variant-numeric: tabular-nums; letter-spacing: .2em; }
.team-check { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding-block: 9px; cursor: pointer; }
.team-check input { width: 20px; height: 20px; flex: none; margin: 3px 0 0; accent-color: var(--accent); }
.team-help, .team-quick-match p, .team-confirm p { color: var(--muted); font-size: 14px; }
.team-quick-match p { margin-bottom: 12px; }
.team-status, .team-local-status { color: var(--accent); }
.team-error, .team-danger { color: var(--danger); }
.team-error, .team-status, .team-local-status { font-size: 14px; overflow-wrap: anywhere; }
.team-error:empty, .team-status:empty, .team-local-status:empty { display: none; }
.team-error:not(:empty), .team-local-status:not(:empty) { margin-block: 10px 0; }
.team-notices { padding: 16px 20px 16px 36px; background: var(--surface-muted); border-radius: var(--radius-md); }
.team-list, .team-members { list-style: none; margin: 0; padding: 0; }
.team-list > li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding-block: 12px; border-bottom: 1px solid var(--line); }
.team-list > li:last-child { border-bottom: 0; }
.team-list > li > span { min-width: 0; overflow-wrap: anywhere; }
.team-list .team-error { width: 100%; }
.team-list .team-actions { gap: 8px; }
.team-empty { color: var(--muted); font-size: 14px; }
.team-progress { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-bottom: 24px; padding-block: 8px 24px; border-bottom: 1px solid var(--line); }
.team-progress-item { display: flex; align-items: center; gap: 16px; min-width: 0; }
.team-progress-item > div { min-width: 0; }
.team-progress p { margin-bottom: 4px; }
.team-progress-item .team-help { margin-bottom: 0; }
.team-ring { position: relative; width: 116px; height: 116px; flex: none; }
.team-ring svg { display: block; width: 100%; height: 100%; transform: rotate(-90deg); }
.team-ring-track, .team-ring-fill { fill: none; stroke-width: 10; }
.team-ring-track { stroke: var(--surface-muted); }
.team-ring-fill { stroke: var(--accent); stroke-linecap: round; }
.team-ring strong { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.team-next { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 8px; padding: 24px; border-radius: var(--radius-md); }
.team-next > div { flex: 1 1 260px; min-width: 0; }
.team-next h3 { margin-bottom: 8px; font-size: 21px; }
.team-next p { margin-bottom: 0; }
#team-members, .team-member, #team-share-text, #team-link-title, #team-invite-title { scroll-margin-top: 24px; }
.team-member { padding-block: 16px; border-bottom: 1px solid var(--line); }
.team-member:last-child { border-bottom: 0; }
.team-member-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; margin-bottom: 10px; }
.team-member-name { min-width: 0; overflow-wrap: anywhere; font-weight: 650; }
.team-member-state, .team-member-relation { color: var(--muted); font-size: 14px; }
.team-member-relation { margin-block: 10px 0; }
.team-member .team-actions { gap: 8px; }
.team-member [aria-pressed="true"] { color: var(--accent); background: var(--success-bg); }
.team-activity, .team-management { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.team-confirm { margin-top: 16px; }
.team-confirm p { margin-bottom: 12px; }
.team-invite-card { padding: 32px; border-color: var(--accent); }
.team-invite-card > h2 { margin-bottom: 12px; font-size: 28px; }
.team-invite-layout { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 32px; margin-block: 28px; }
.team-invite-credentials { flex: 1 1 220px; min-width: 0; }
.team-invite-credentials > .team-help:first-child { margin-bottom: 8px; }
.team-invite-credentials h3 { font-size: 2rem; overflow-wrap: anywhere; }
.team-password-display { width: fit-content; max-width: 100%; margin-block: 24px; padding: 12px 20px; border-radius: var(--radius-md); color: var(--accent); background: var(--surface); font-size: 14px; }
.team-password-display strong { display: block; margin-top: 4px; font-size: 3.5rem; font-weight: 800; line-height: 1.2; letter-spacing: .15em; font-variant-numeric: tabular-nums; }
.team-invite-text { padding-block: 20px; border-block: 1px solid var(--surface); color: var(--surface); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.team-qr { display: block; width: 216px; max-width: 100%; height: auto; aspect-ratio: 1; padding: 8px; border-radius: var(--radius-md); background: var(--surface); flex: 0 1 216px; object-fit: contain; }
.team-invite-card .team-confirm { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--surface); }
.team-invite-card .team-confirm p { color: var(--surface); }
.team-invite-card .team-error:not(:empty) { padding: 12px; border-radius: var(--radius-sm); color: var(--danger); background: var(--danger-bg); }
.team-invite-card .team-local-status:not(:empty) { padding: 12px; border-radius: var(--radius-sm); color: var(--accent); background: var(--surface); }
#team-login { margin-block: 12px; }

@media (min-width: 641px) {
  .team-start-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 24px; }
  .team-start-steps li { padding: 40px 0 20px; }
  .team-start-steps li::before { top: 0; }
}

@media (max-width: 640px) {
  .team-landing-hero { grid-template-columns: minmax(0, 1fr); min-height: 188px; padding: 20px 16px; }
  .team-landing h1 { font-size: 24px; }
  .team-landing-art { display: none; }
  .team-landing-guide { padding: 28px 24px; }
  .team-shell:has(#team-unjoined:not([hidden])) .team-heading { grid-template-columns: minmax(0, 1fr) 64px; padding: 12px; gap: 8px; }
  .team-shell:has(#team-unjoined:not([hidden])) .team-heading h1 { font-size: 22px; }
  .team-shell:has(#team-unjoined:not([hidden])) .team-heading-art { width: 48px; }
  .team-shell:has(#team-unjoined:not([hidden])) .team-heading-art figcaption { display: none; }
  .team-progress-item { flex-direction: column; align-items: flex-start; gap: 12px; }
}

@media (max-width: 480px) {
  .team-shell { margin-top: 20px; }
  .team-panel { padding: 16px; }
  #team-create-panel { padding: 20px; }
  .team-landing-guide { padding: 24px 20px; }
  .team-heading h1 { font-size: 1.5rem; }
  .team-progress { gap: 16px; }
  .team-ring { width: 104px; height: 104px; }
  .team-next > .primary-button { width: 100%; }
  .team-next { padding: 20px; }
  .team-invite-layout { gap: 16px; }
  .team-invite-credentials { flex-basis: 100%; }
  .team-invite-card { padding: 24px 20px; }
  .team-password-display { padding-inline: 16px; }
  .team-password-display strong { font-size: 3rem; }
  .team-auth { padding: 28px 20px; }
  .team-auth-message { font-size: 1.75rem; }
  .team-heading { align-items: flex-start; }
  .team-actions > button, .team-actions > a { flex: 1 1 auto; text-align: center; }
  .team-member .team-actions > button, .team-member .team-actions > a { flex: 1 1 100px; }
  .team-member .team-actions > [data-action="mark"] { flex-basis: 100%; }
}

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