.team-button { margin-left: auto; min-height: 36px; padding: 7px 9px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; border-radius: 9px; font-size: 12px; font-weight: 650; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-border); }
.team-button .icon { width: 15px; height: 15px; }
.team-members { display: grid; gap: 7px; margin-bottom: 20px; }
.team-member { display: flex; align-items: center; gap: 8px; padding: 9px 10px; background: white; border: 1px solid #e4eef2; border-radius: 11px; font-size: 13px; min-width: 0; }
.team-member-name { flex: 1; overflow-wrap: anywhere; min-width: 0; }
.team-history { border-top: 1px solid #e1edf2; margin-top: 22px; padding-top: 15px; }
.team-history h3 { margin: 0 0 10px; font-size: 13px; }
#team-dialog, #check-edit-dialog { max-height: calc(100dvh - 32px); }
#team-dialog .close-button, #check-edit-dialog .close-button, #check-edit-dialog .delete-round-button { min-height: 44px; }
.permission-section { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 16px; }
.team-role-settings { border: 1px solid #dbeaf0; border-radius: 12px; background: white; }
.team-role-settings > summary { min-height: 44px; padding: 11px; font-size: 12px; font-weight: 650; cursor: pointer; }
.team-role-content { padding: 0 12px 12px; }
.permission-section h3 { margin: 0 0 7px; font-size: 14px; }
.permission-note { color: var(--muted); font-size: 12px; margin: 7px 0 13px; }
.permission-members { display: grid; gap: 9px; margin-bottom: 15px; }
.permission-member { background: white; border: 1px solid #dbeaf0; border-radius: 12px; min-width: 0; overflow: hidden; }
.permission-member summary, .permission-owner { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 10px; font-size: 12px; }
.permission-member summary { cursor: pointer; list-style: none; }
.permission-member summary::-webkit-details-marker { display: none; }
.permission-person-name { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 650; }
.permission-count { font-size: 11px; color: var(--muted); white-space: nowrap; }
.permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 0 10px 11px; }
.permission-choice { display: flex; align-items: center; gap: 7px; min-width: 0; min-height: 44px; padding: 7px; background: #f6fbfd; border: 1px solid #e6f0f4; border-radius: 9px; font-size: 12px; }
.permission-choice input { margin: 0; width: 17px; height: 17px; flex-shrink: 0; }
.permission-choice span { overflow-wrap: anywhere; }
#team-dialog, #round-dialog { max-height: calc(100dvh - 32px); }

@media (min-width: 960px) {
  #detail-dialog .team-button { min-height: 34px; padding: 5px 8px; font-size: 11px; }
}

@media (max-width: 959px) {
  #detail-dialog .team-button { width: 44px; height: 44px; min-height: 44px; padding: 0; display: grid; place-items: center; font-size: 11px; }
  #detail-dialog .team-button-label { display: none; }
  #detail-dialog .team-button .icon { width: 19px; height: 19px; }
}

.avatar-face { display: inline-grid; place-items: center; width: 100%; height: 100%; border-radius: inherit; overflow: hidden; background: inherit; }
.avatar.avatar-with-role { position: relative; overflow: visible; }
.avatar-role-mark { position: absolute; right: -3px; bottom: -2px; z-index: 2; display: grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; border: 1px solid white; box-shadow: 0 1px 2px #183b4e25; pointer-events: none; }
.avatar-role-mark .icon { width: 10px; height: 10px; stroke-width: 2; }
.avatar-role-leader { background: #fff3cc; color: #8a5c13; }
.avatar-role-deputy { background: #e1f6ff; color: #0a7195; }
.card-bottom .avatar-role-mark { width: 13px; height: 13px; }
.card-bottom .avatar-role-mark .icon { width: 9px; height: 9px; }
.avatar-group:has(.avatar-with-role) { gap: 5px; }
.avatar-group:has(.avatar-with-role) .avatar + .avatar { margin-left: 0; }
.avatar-role-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); margin: 0 0 12px; }
.avatar-role-legend span { display: inline-flex; align-items: center; gap: 5px; }
.avatar-role-legend .icon { width: 15px; height: 15px; }
.avatar-role-legend span:first-child .icon { color: #8a5c13; }
.avatar-role-legend span:last-child .icon { color: #0a7195; }
