.project-participants,.participant-dialog {
  --participant-text: #173c4e; --participant-muted: #526d7a; --participant-line: #cfdee5;
  --participant-surface: #fff; --participant-soft: #f3f8fa; --participant-accent: #087c88;
}
html[data-theme="dark"] :is(.project-participants,.participant-dialog) {
  --participant-text: #e4f0f3; --participant-muted: #b0c7d0; --participant-line: #365864;
  --participant-surface: #0d2731; --participant-soft: #143540; --participant-accent: #77e7db;
}
html[data-theme] .project-participants { padding: 22px; color: var(--participant-text); border-color: var(--participant-line); background: var(--participant-surface); }
.participants-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
html[data-theme] .participants-heading h3 { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--participant-text); font-size: 22px; line-height: 1.4; }
.participants-heading h3 > span { min-width: 28px; padding: 3px 8px; border-radius: 20px; color: var(--participant-muted); background: var(--participant-soft); font-size: 13px; text-align: center; }
html[data-theme] .participants-heading p { margin: 5px 0 0; color: var(--participant-muted); font-size: 14px; line-height: 1.5; }
.participants-heading > button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 14px; font-size: 14px; font-weight: 600; }
.participants-search { max-width: 430px; display: grid; gap: 7px; margin: 22px 0 18px; }
html[data-theme] .project-participants .participants-search > span { color: var(--participant-text); font-size: 13px; font-weight: 600; text-transform: none; letter-spacing: 0; }
html[data-theme] :is(.participants-search,.participant-picker-search) > input { width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px; border: 1px solid var(--participant-line); border-radius: 9px; color: var(--participant-text); background: var(--participant-surface); font-size: 15px; line-height: 1.5; }
.participant-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,330px),1fr)); gap: 16px; }
html[data-theme] .participant-card { min-width: 0; display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 18px; border: 1px solid var(--participant-line); border-radius: 12px; color: var(--participant-text); background: var(--participant-surface); }
html[data-theme] .participant-card[hidden] { display: none; }
.participant-card > header { display: flex; align-items: center; gap: 12px; }
.participant-card > header > div { min-width: 0; }
html[data-theme] .participant-avatar { width: 46px; height: 46px; flex: 0 0 46px; border: 1px solid var(--participant-line); border-radius: 50%; color: var(--participant-text); background: var(--participant-soft); font-size: 14px; font-weight: 650; }
html[data-theme] .participant-card h4 { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin: 0; color: var(--participant-text); font-size: 16px; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
.participant-self { padding: 2px 6px; border-radius: 5px; color: var(--participant-muted); background: var(--participant-soft); font-size: 11px; font-weight: 600; }
html[data-theme] .participant-card header p { margin: 4px 0 0; color: var(--participant-muted); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.participant-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.participant-tags > span { padding: 4px 7px; border-radius: 6px; color: var(--participant-muted); background: var(--participant-soft); font-size: 12px; font-weight: 600; line-height: 1.4; }
.participant-tags .participant-availability.available { color: #126344; background: #e7f5ec; }
.participant-tags .participant-availability.limited { color: #895005; background: #fff2db; }
html[data-theme="dark"] .participant-tags .participant-availability.available { color: #9be3bf; background: #193d30; }
html[data-theme="dark"] .participant-tags .participant-availability.limited { color: #ffd599; background: #3d301d; }
html[data-theme] .participant-card .participant-region { margin: 0; color: var(--participant-muted); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.participant-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 2px; }
html[data-theme] .participant-actions > button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; margin: 0; padding: 9px 11px; border: 1px solid var(--participant-line); border-radius: 8px; color: var(--participant-text); background: var(--participant-surface); font-size: 13px; font-weight: 600; line-height: 1.5; box-shadow: none; }
.participant-actions .plan-symbol { width: 18px; height: 18px; }
html[data-theme] .participant-actions > button:hover:enabled { border-color: var(--participant-accent); background: var(--participant-soft); }
html[data-theme] .participant-actions > .participant-remove { color: #a92f3c; }
html[data-theme="dark"] .participant-actions > .participant-remove { color: #ffb0b9; }
html[data-theme] .participant-actions > button:disabled { opacity: .5; cursor: not-allowed; }
html[data-theme] .project-participants .participants-empty { margin: 0; padding: 24px; border: 1px dashed var(--participant-line); border-radius: 10px; color: var(--participant-muted); background: var(--participant-soft); font-size: 14px; line-height: 1.6; text-align: center; }
html[data-theme] body .app-dialog.participant-dialog { width: min(610px,calc(100vw - 24px)); max-width: calc(100vw - 24px); height: fit-content; min-height: 0; max-height: calc(100dvh - 24px); margin: auto; inset: 0; padding: 0; overflow: auto; border: 1px solid var(--participant-line); border-radius: 14px; color: var(--participant-text); background: var(--participant-surface); }
.participant-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 22px; border-bottom: 1px solid var(--participant-line); }
html[data-theme] .participant-dialog-head h2 { margin: 0; color: var(--participant-text); font-size: 21px; line-height: 1.4; }
.participant-dialog-head > button { width: 44px; height: 44px; padding: 0; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--participant-line); border-radius: 9px; color: var(--participant-text); background: var(--participant-soft); }
.participant-dialog-body { display: grid; gap: 18px; padding: 22px; }
html[data-theme] .participant-dialog p { margin: 0; color: var(--participant-muted); font-size: 14px; line-height: 1.6; }
.participant-profile-head { display: flex; align-items: center; gap: 14px; }
.participant-profile-head > div { min-width: 0; }
html[data-theme] .participant-profile-head h3 { margin: 0; color: var(--participant-text); font-size: 20px; line-height: 1.4; overflow-wrap: anywhere; }
.participant-profile-fields { display: grid; gap: 14px; margin: 0; }
.participant-profile-fields > div { display: grid; grid-template-columns: 125px minmax(0,1fr); gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--participant-line); }
.participant-profile-fields dt { color: var(--participant-muted); font-size: 13px; line-height: 1.5; }
.participant-profile-fields dd { margin: 0; color: var(--participant-text); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.participant-picker-search { display: grid; gap: 7px; }
html[data-theme] .participant-picker-search > span { color: var(--participant-text); font-size: 14px; text-transform: none; letter-spacing: 0; }
.participant-picker { min-width: 0; display: grid; gap: 8px; max-height: min(420px,45dvh); overflow: auto; margin: 0; padding: 0 2px 2px; border: 0; }
.participant-picker legend { margin-bottom: 10px; color: var(--participant-text); font-size: 14px; font-weight: 600; }
.participant-picker > label { display: flex; align-items: center; gap: 10px; min-height: 64px; margin: 0; padding: 10px; border: 1px solid var(--participant-line); border-radius: 9px; background: var(--participant-surface); cursor: pointer; }
.participant-picker > label[hidden] { display: none; }
.participant-picker input { width: 20px; height: 20px; min-height: 20px; flex: 0 0 20px; margin: 0; accent-color: var(--participant-accent); }
.participant-picker .participant-avatar { width: 36px; height: 36px; flex-basis: 36px; font-size: 12px; }
html[data-theme] .participant-picker label > span:last-child { min-width: 0; margin: 0; color: var(--participant-text); text-transform: none; letter-spacing: 0; }
.participant-picker strong { display: block; font-size: 14px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.participant-picker small { display: block; margin-top: 3px; color: var(--participant-muted); font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.participant-picker > label:has(input:checked) { border-color: var(--participant-accent); background: var(--participant-soft); }
.participant-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--participant-line); }
.participant-dialog-actions > button { min-height: 44px; padding: 10px 15px; font-size: 14px; font-weight: 600; line-height: 1.4; }
html[data-theme] .participant-dialog [data-participant-error] { color: #ae3040; }
html[data-theme="dark"] .participant-dialog [data-participant-error] { color: #ffb0b9; }
html[data-theme] :is(.project-participants,.participant-dialog) :is(button,input):focus-visible { outline: 3px solid var(--participant-accent); outline-offset: 3px; }
@media(max-width:600px) {
  html[data-theme] .project-participants { padding: 16px; }
  .participants-heading > button { width: 100%; }
  .participants-search { max-width: none; }
  html[data-theme] .participant-card { padding: 15px; }
  .participant-grid { grid-template-columns: minmax(0,1fr); }
  .participant-actions > button { flex: 1 1 auto; }
  .participant-dialog-head { padding: 16px; }
  .participant-dialog-body { padding: 16px; }
  .participant-profile-fields > div { grid-template-columns: minmax(0,1fr); gap: 4px; }
  .participant-dialog-actions { padding: 14px 16px; flex-wrap: wrap; }
}
