[hidden] { display: none !important; }
#toastRegion {
  position: fixed; inset: auto max(12px, env(safe-area-inset-right)) calc(96px + env(safe-area-inset-bottom)) auto;
  z-index: 20; display: grid; gap: 8px; max-width: min(360px, calc(100vw - 24px)); pointer-events: none;
}
.toast { padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line2);
  background: var(--surface2); color: var(--text); box-shadow: 0 8px 22px #0008; animation: appear .2s ease both; overflow-wrap: anywhere; }
.toast-error { border-color: #e68a91; }
.notification-button { position: relative; display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border-radius: 50%; }
.notification-button > span { position: absolute; top: -4px; right: -5px; min-width: 17px; min-height: 17px;
  border-radius: 999px; padding: 1px 4px; background: var(--brand); color: var(--on-brand); font-size: 10px; font-weight: 700; }
.community-dialog { max-height: min(85dvh, 700px); width: min(540px, 94%); padding: 20px; }
dialog[open] { animation: appear .18s ease both; }
.dialog-header { margin-bottom: 12px; }
.dialog-header h2 { margin: 0; }
.dialog-header button { padding: 5px 12px; font-size: 20px; }
#actionError { border: 1px solid #e68a91; border-radius: 10px; padding: 8px 12px; color: var(--text); }
#actionFields textarea { resize: vertical; }
#actionSubmit { margin-top: 12px; }
.profile-dialog { width: min(500px, 94%); max-height: 86dvh; overflow-y: auto; }
.profile-summary { display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; }

.profile-name { overflow-wrap: anywhere; }
.profile-actions { justify-content: center; margin-bottom: 12px; }
.community-page .community-title { margin-bottom: 16px; }
.community-page h1, .community-record h3, .community-line { overflow-wrap: anywhere; }
.community-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.community-empty { padding: 10px 0; }
.community-record h3 { margin: 0; font-size: 21px; }
.content-text { white-space: pre-wrap; overflow-wrap: anywhere; word-break: normal; }
.community-meta { color: var(--muted); gap: 8px 12px; }
.community-meta time, .community-line time { color: var(--muted); font-size: 11px; }
.community-line { border-top: 1px solid var(--line2); padding: 10px 0; }
.community-line p { margin: 8px 0; }
.compact-button, .comments-heading select { display: inline-flex; align-items: center; justify-content: center; border-radius: 9px;
  padding: 7px 9px; min-height: 34px; font-size: 12px; }
.compact-button:disabled { opacity: .6; cursor: wait; }
.list-more { margin: 8px 0; }
.person-button { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; min-width: 0; padding: 1px;
  border: 0; box-shadow: none; background: none; text-align: start; }
.person-button > span:not(.profile-avatar) { min-width: 0; overflow-wrap: anywhere; }
.person-button .profile-avatar, .people-result .profile-avatar { width: 29px; height: 29px; flex: 0 0 29px; font-size: 11px; }
.person-button:hover { background: none; text-decoration: underline; }
#actionForm .people-result { display: flex; margin: 8px 0; }
#actionForm .people-result input { width: auto; display: inline; margin: 0; }
.people-result input { accent-color: var(--brand); }
.notification-line.unread { box-shadow: inset 2px 0 var(--brand2); padding-left: 9px; }
.notifications-summary { margin-bottom: 10px; }
.notification-line .person-button { color: var(--text); }
.moderation-reason { padding: 6px 9px; border-radius: 7px; background: var(--surface2); }
.connection-status { font-size: 11px; color: var(--muted); white-space: nowrap; }
.connection-status::before { display: inline-block; content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); margin-right: 5px; }
.connection-status[data-mode="online"]::before { background: #61c9a4; }
.connection-status[data-mode="offline"]::before { background: #e68a91; }
.chat-history { text-align: center; }
.chat-history button { margin-bottom: 6px; }
#messageItems { position: relative; }
#chatJump { text-align: right; }
.discussion-focus { box-shadow: inset 0 0 0 1px var(--brand2); border-radius: 10px; }
.discussion-item .person-button { align-self: start; }
.discussion-item .discussion-actions { flex-wrap: wrap; }
.discussion-item .discussion-actions .compact-button { padding: 4px 7px; min-height: 28px; }
.discussion-item .compact-button .ico { width: 15px; height: 15px; }
.discussion-more { margin-top: 10px; }
.skeleton-list { display: grid; gap: 9px; padding: 8px 0; }
.skeleton { height: 46px; border-radius: 10px; background: var(--surface2); animation: skeleton-fade 1.45s ease-in-out infinite alternate; }
.skeleton:nth-child(2n) { width: 88%; }
@keyframes skeleton-fade { from { opacity: .58; } to { opacity: 1; } }
@media (max-width: 520px) {
  .community-dialog { padding: 14px; }
  .community-page .community-title { gap: 8px; }
  .chat-route main { width: min(1180px, 98%); }
  .chat-panel { padding: 8px; }
  .chat-heading h1 { font-size: clamp(17px, 5vw, 25px); }
  .comment-meta { gap: 5px; }
  .comment-meta time { font-size: 10px; }
  .discussion-item p, .reply-quote { overflow-wrap: anywhere; }
}
@media (prefers-reduced-motion: reduce) {
  dialog[open], .skeleton, .toast { animation: none; }
}
.reply-quote .person-button { padding: 0; font-size: 12px; }
.reply-quote .person-button .profile-avatar { width: 18px; height: 18px; flex-basis: 18px; font-size: 8px; }
.add-project { margin-top: 18px; padding: 10px 18px; border-radius: 12px; }
.card-vote-counts .ico, .community-meta .ico { width: 13px; height: 13px; vertical-align: -2px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.download-count { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--line2); border-radius: 10px; color: var(--muted); font-size: 13px; }
.download-count b { color: var(--text); }
.download-row { padding: 12px 0; border-top: 1px solid var(--line); }
.download-row:first-of-type { border-top: 0; padding-top: 0; }
.project-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.project-gallery.single { grid-template-columns: 1fr; }
.project-gallery button { padding: 0; border: 0; background: none; border-radius: 14px; overflow: hidden; aspect-ratio: 16 / 10; }
.project-gallery button:hover { background: none; filter: brightness(1.08); }
.project-gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-view { display: block; max-width: 100%; max-height: 75vh; margin: 0 auto 12px; border-radius: 12px; }
.media-set { border: 1px solid var(--line2); border-radius: 12px; padding: 12px; margin: 15px 0; }
.media-set legend { padding: 0 6px; color: var(--muted); }
.media-row { flex-wrap: nowrap; margin-bottom: 8px; }
.media-row input { flex: 1; min-width: 0; padding: 10px; }
.media-row input[name="link_label"] { flex: 0 1 38%; }
.media-thumb { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 8px; background: var(--surface2); overflow: hidden; }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
form label.upload-button { display: inline-flex; margin: 0; cursor: pointer; }
.upload-button.busy { opacity: .6; pointer-events: none; }
.manage-filters { padding: 10px 14px; }
form label.filter-row { display: flex; margin: 8px 0; }
.filter-row input { width: auto !important; margin: 0 !important; }
.filter-swatch { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.card-vote-counts { display: inline-flex; align-items: center; gap: 4px; }
.project-author { margin: 12px 0; }
.project-author > .profile-avatar { width: 28px; height: 28px; flex: 0 0 28px; font-size: 11px; }

/* Guests: writing, voting and downloads need Discord */
.comment-form[hidden], .guest-gate[hidden] { display: none; }
.guest-gate { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border-top: 1px solid var(--line); padding: 12px 2px 2px; color: var(--muted); }
.guest-gate-text { display: inline-flex; align-items: center; gap: 8px; }
.guest-gate .discord-login, .login-gate .discord-login { display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; border: 0; border-radius: 14px; background: #5865f2; color: #fff; font-weight: 650; cursor: pointer; }
.guest-gate .discord-login:hover, .login-gate .discord-login:hover { background: #6d79ff; }
.guest-gate .discord-login { padding: 9px 18px; }
.chat-panel .guest-gate { padding: 10px clamp(10px,3vw,20px); background: var(--surface2); }
.login-gate { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 8px 4px 4px; }
.login-gate h2 { margin: 6px 0 0; }
.login-gate p { margin: 0 0 10px; color: var(--muted); }
.login-gate-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--surface2); border: 1px solid var(--line2); }
.login-gate .discord-login { width: 100%; }
.download-locked { opacity: .92; }

/* Users (staff) */
.users-stats { margin-bottom: 12px; }
.users-search { gap: 8px; margin-bottom: 6px; flex-wrap: nowrap; }
.users-search input { flex: 1; min-width: 0; }
.users-hint { margin: 4px 2px 14px; font-size: 13px; color: var(--muted); }
.users-panel { padding: 6px 16px; }
.user-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 0; border-top: 1px solid var(--line); }
.user-row:first-child { border-top: 0; }
.user-row.is-banned { opacity: .75; }
.user-main { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 260px; }
.user-main .person-button .profile-avatar { width: 42px; height: 42px; }
.user-info { display: grid; gap: 3px; min-width: 0; }
.user-name { gap: 6px; flex-wrap: wrap; }
.user-name b { overflow-wrap: anywhere; }
.user-handle { color: var(--muted); overflow-wrap: anywhere; }
.user-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: 12px; }
.user-actions { gap: 6px; }
.badge.role-owner, .badge.role-administrator { color: var(--text); border-color: var(--brand); }
.badge.role-moderator { color: var(--text); }
.badge-danger { color: #ff8f8f; border-color: color-mix(in srgb, #ff6b6b 55%, transparent); }
.action-note { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
@media (max-width: 560px) { .users-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ===== v5: roles, profile hub, users, project form, filters ===== */
.role-badge { --role: #8a8f9e; color: color-mix(in srgb, var(--role) 82%, var(--text)); border-color: color-mix(in srgb, var(--role) 55%, transparent);
  background: color-mix(in srgb, var(--role) 13%, transparent); }
:root[data-mode="light"] .role-badge { color: color-mix(in srgb, var(--role) 70%, #000); }
.icon-button { display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; border-radius: 12px; color: var(--muted); flex: none; }
.icon-button:hover:not(:disabled) { color: var(--text); }
.icon-button:disabled { opacity: .35; cursor: not-allowed; }
.icon-button .ico { width: 18px; height: 18px; }
.icon-button.danger:hover:not(:disabled) { color: #ff6b6b; border-color: color-mix(in srgb, #ff6b6b 50%, transparent); background: #ff6b6b14; }
.icon-button.ok { color: var(--on-brand); background: var(--brand); border-color: transparent; }
.pill-button { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 15px; border-radius: 999px; font-weight: 600; font-size: 14px; white-space: nowrap; }
.pill-button .ico { width: 17px; height: 17px; }
.pill-button.danger { color: #ff7b7b; }
.pill-button.danger.fill, .danger-fill { background: #e5484d; border-color: transparent; color: #fff; }
.pill-button.danger.fill:hover, .danger-fill:hover { background: #f05257; filter: none; }
.field-label { margin: 16px 0 8px; font-size: 15px; }
.action-note { margin: 0 0 12px; font-size: 13px; line-height: 1.5; color: var(--muted); }

/* profile: centred card with the role's colour and a control centre for staff */
.profile-dialog { --role: var(--brand); text-align: center; padding-top: 14px;
  background: radial-gradient(130% 170px at 50% -20px, color-mix(in srgb, var(--role) 30%, transparent), transparent 75%), var(--bg); }
.profile-dialog .profile-heading h2 { font-size: 17px; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.profile-dialog .profile-avatar { width: 96px; border: 3px solid color-mix(in srgb, var(--role) 70%, var(--bg)); box-shadow: 0 10px 34px -12px var(--role); }
.profile-name { font-size: 22px; font-weight: 750; letter-spacing: -.02em; margin-bottom: 8px; }
.profile-summary { gap: 6px 10px; margin-bottom: 18px; }
.profile-summary small { font-size: 13px; }
.profile-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 16px; }
.profile-stats div { display: grid; justify-items: center; gap: 2px; min-width: 0; padding: 12px 4px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.profile-stats .ico { width: 17px; height: 17px; color: var(--muted); margin-bottom: 2px; }
.profile-stats dd { margin: 0; font-size: 20px; font-weight: 750; font-variant-numeric: tabular-nums; }
.profile-stats dt { font-size: 12px; color: var(--muted); }
.hub { text-align: left; margin-top: 4px; }
.hub-title { margin: 0 0 8px 4px; font: 600 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.hub-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.hub-tile { display: flex; align-items: center; gap: 11px; min-width: 0; padding: 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); text-align: left; }
.hub-tile:hover { border-color: var(--line2); background: var(--surface2); transform: translateY(-1px); }
.hub-text { display: flex; flex-direction: column; min-width: 0; }
.hub-text b { font-size: 14px; }
.hub-text small { font-size: 12px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.hub-action { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 16px; font-weight: 600; }
.hub-action.danger { color: #ff7b7b; }
.profile-dialog .profile-logout { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; border-radius: 16px;
  background: transparent; color: #ff7b7b; border: 1px solid color-mix(in srgb, #ff6b6b 35%, transparent); box-shadow: none; font-weight: 600; }
.profile-dialog .profile-logout:hover { background: #ff6b6b12; filter: none; }
@media (max-width: 380px) { .hub-grid { grid-template-columns: 1fr; } }

/* users */
.users-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 14px; }
.users-stats div { position: relative; overflow: hidden; display: grid; gap: 2px; padding: 14px 16px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); }
.users-stats div::after { content: ""; position: absolute; inset: auto -30px -40px auto; width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--brand) 14%, transparent), transparent 70%); }
.stat-icon { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 6px; border-radius: 11px; background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); }
.stat-icon .ico { width: 17px; height: 17px; }
.users-stats dd { margin: 0; font-size: 28px; font-weight: 750; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.users-stats dt { font-size: 13px; color: var(--muted); }
@media (max-width: 640px) { .users-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.users-search { display: flex; gap: 8px; margin: 0 0 6px; }
.users-search .searchfield { flex: 1; min-width: 0; height: 52px; padding: 0 18px; }
.users-search .searchfield input { font-size: 15px; }
.users-search .white { border-radius: 999px; padding: 0 20px; }
.users-hint { margin: 6px 4px 14px; font-size: 13px; color: var(--muted); }
.users-list { display: grid; gap: 10px; }
.user-card { --role: #8a8f9e; display: grid; gap: 12px; padding: 14px 16px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--role) 75%, transparent); animation: appear .25s ease both; }
.user-card.is-banned { opacity: .7; }
.user-card .user-main { display: flex; align-items: center; gap: 12px; min-width: 0; flex: initial; }
.user-avatar { position: relative; flex: none; }
.user-avatar .person-button .profile-avatar { width: 48px; height: 48px; flex-basis: 48px; font-size: 15px; }
.user-avatar.online::after { content: ""; position: absolute; right: 1px; bottom: 1px; width: 12px; height: 12px; border-radius: 50%; background: #2de3a0; border: 2px solid var(--surface); }
.user-card .user-info { display: grid; gap: 3px; min-width: 0; }
.user-card .user-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.user-card .user-name b { font-size: 16px; overflow-wrap: anywhere; }
.user-handle { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.user-handle span { font: 11px var(--mono); opacity: .8; }
.user-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.user-chips span { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; background: var(--surface2); color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.user-chips .ico { width: 13px; height: 13px; }
.user-chips .is-online { color: #2de3a0; }
.user-card .user-actions { display: flex; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.user-card .user-actions .pill-button { flex: 1; justify-content: center; }
@media (min-width: 720px) {
  .user-card { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .user-card .user-chips { grid-column: 1; }
  .user-card .user-actions { grid-column: 2; grid-row: 1 / span 2; padding: 0; border: 0; }
  .user-card .user-actions .pill-button { flex: none; }
}

/* roles */
.roles-list { display: grid; gap: 10px; }
.role-card { --role: #8a8f9e; display: flex; align-items: center; gap: 14px; padding: 14px 14px 14px 18px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); animation: appear .25s ease both; }
.role-dot { width: 14px; height: 14px; flex: none; border-radius: 50%; background: var(--role); box-shadow: 0 0 0 4px color-mix(in srgb, var(--role) 22%, transparent); }
.role-info { flex: 1; min-width: 0; display: grid; gap: 7px; }
.role-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.role-head b { font-size: 16px; color: color-mix(in srgb, var(--role) 55%, var(--text)); }
.role-head small { font-size: 12px; }
.perm-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.perm-chip { padding: 3px 9px; border-radius: 999px; font-size: 11.5px; background: var(--surface2); color: var(--muted); }
.perm-chip.all { background: color-mix(in srgb, var(--role) 18%, transparent); color: var(--text); }
.role-tools { display: grid; grid-template-columns: repeat(2, 40px); gap: 6px; }
.role-lock { display: grid; place-items: center; width: 40px; height: 40px; color: var(--muted); opacity: .7; }
@media (min-width: 600px) { .role-tools { grid-template-columns: repeat(4, 40px); } }
.perm-list { margin-top: 4px; }
.perm-list .setting-row { min-height: 58px; cursor: pointer; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { position: relative; width: 34px; height: 34px; padding: 0; border-radius: 50%; background: var(--sw); border: 2px solid transparent; box-shadow: inset 0 0 0 1px #0003; }
.swatch:hover { background: var(--sw); transform: scale(1.08); }
.swatch[aria-pressed="true"], .swatch-custom.on { border-color: var(--bg); box-shadow: 0 0 0 2px var(--text); }
form label.swatch-custom { display: inline-block; margin: 0; cursor: pointer; background: conic-gradient(#ff6b6b, #f5c542, #2de3a0, #4dd0e1, #5c8dff, #a77bff, #ff5fa2, #ff6b6b); }
.swatch-custom.on { background: var(--sw); }
.swatch-custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; padding: 0; border: 0; }
.choice-set { border: 0; padding: 0; margin: 0 0 8px; min-width: 0; }
.choice-set legend { padding: 0; margin-bottom: 8px; font-size: 15px; }
.choice-chips { display: flex; flex-wrap: wrap; gap: 8px; }
form label.choice-chip { margin: 0; }
.choice-chip input, .role-choice input, .pf-chip input { position: absolute; opacity: 0; pointer-events: none; }
.choice-chip span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 15px; border-radius: 999px; border: 1px solid var(--line2); background: var(--surface); cursor: pointer; font-weight: 550; }
.choice-chip input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.choice-chip input:focus-visible + span, .pf-chip input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.role-choices { display: grid; gap: 8px; }
form label.role-choice { --role: #8a8f9e; position: relative; display: flex; align-items: center; gap: 12px; margin: 0; padding: 12px 14px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; }
form label.role-choice:has(input:checked) { border-color: var(--role); background: color-mix(in srgb, var(--role) 9%, var(--surface)); }
.role-choice-text { display: grid; min-width: 0; }
.role-choice-text small { font-size: 12px; }

/* action dialog: big sticky main button */
.action-dialog { padding-bottom: 0; }
.action-dialog #actionForm { display: flex; flex-direction: column; }
.action-dialog #actionSubmit { position: sticky; bottom: 0; z-index: 2; width: 100%; min-height: 54px; margin: 14px 0 0; border-radius: 18px; font-size: 16px;
  box-shadow: 0 -18px 18px 2px var(--bg); }
.action-dialog #actionForm::after { content: ""; display: block; height: 18px; }
.action-dialog.wide { width: min(640px, 94%); }
@media (max-width: 600px) {
  .action-dialog { width: 100%; max-width: none; max-height: 92dvh; margin: auto 0 0; border-radius: 28px 28px 0 0; border-bottom: 0; padding: 12px 16px 0; }
  .action-dialog::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line2); margin: 0 auto 10px; }
  .action-dialog[open] { animation: sheet-up .26s cubic-bezier(.2,.8,.2,1) both; }
  .action-dialog #actionForm::after { height: calc(14px + env(safe-area-inset-bottom)); }
}

/* project form */
.pf { display: grid; gap: 12px; }
.pf-section { padding: 14px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.pf-section label { margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.pf-section label input, .pf-section label textarea { background: var(--bg); color: var(--text); }
.pf-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; font-size: 16px; letter-spacing: -.01em; }
.pf-title small { margin-left: auto; font-weight: 400; font-size: 12px; }
.pf-num { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: var(--brand); color: var(--on-brand); font: 700 12px var(--mono); }
.pf-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pf-section label.pf-chip { margin: 0; color: var(--text); }
.pf-chip span { --c: var(--brand); display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 15px; border-radius: 999px; border: 1px solid var(--line2); background: var(--bg); cursor: pointer; font-weight: 550; }
.pf-chip span::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.pf-chip input:checked + span { border-color: var(--c); background: color-mix(in srgb, var(--c) 16%, var(--bg)); }
.pf-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 12px; }
.pf-photo, .pf-add-photo { position: relative; aspect-ratio: 1; border-radius: 16px; overflow: hidden; }
.pf-photo { background: var(--surface2); border: 1px solid var(--line); }
.pf-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pf-cover-tag { display: none; position: absolute; left: 6px; bottom: 6px; padding: 2px 7px; border-radius: 999px; background: #000a; color: #fff; font: 600 10px var(--mono); text-transform: uppercase; }
.pf-photos > .pf-photo[data-image-row]:first-child .pf-cover-tag { display: block; }
.pf-remove { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 0; background: #000b; color: #fff; }
.pf-remove:hover { background: #e5484d; }
.pf-remove .ico { width: 14px; height: 14px; }
.pf-section label.pf-add-photo { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; margin: 0; border: 2px dashed var(--line2); color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; text-align: center; }
.pf-add-photo:hover { border-color: var(--brand); color: var(--brand); }
.pf-add-photo .ico { width: 26px; height: 26px; }
.pf-busy { display: grid; place-content: center; justify-items: center; gap: 6px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line2); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pf-files { display: grid; gap: 8px; margin-top: 12px; }
.pf-files:empty { display: none; }
.pf-file { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); }
.pf-file .file-type { width: 42px; height: 42px; border-radius: 12px; }
.pf-file .file-type.is-link { background: color-mix(in srgb, var(--brand2) 18%, transparent); color: var(--brand2); }
.pf-file-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.pf-file-main input { width: 100%; min-width: 0; padding: 7px 10px; border-radius: 10px; font-size: 14px; background: var(--surface); }
.pf-file-main input[name="link_label"] { font-weight: 600; }
.pf-file-main small { font: 11px var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left: 2px; }
.pf-file-name { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress { display: block; height: 6px; border-radius: 3px; background: var(--surface2); overflow: hidden; }
.progress i { display: block; width: 0; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--brand), var(--brand2)); transition: width .2s; }
.pf-percent { width: 42px; text-align: right; font: 12px var(--mono); }
.pf-add-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.pf-section label.pf-add, .pf-add { display: flex; align-items: center; gap: 10px; margin: 0; padding: 12px; min-height: 60px; border-radius: 16px; border: 2px dashed var(--line2); background: transparent; color: var(--text); cursor: pointer; text-align: left; font-size: 14px; }
.pf-add:hover { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, transparent); }
.pf-add .ico { width: 22px; height: 22px; color: var(--brand); }
.pf-add span { display: grid; min-width: 0; }
.pf-add small { font-size: 12px; }
.pf-note { margin: 0; font-size: 12px; text-align: center; }
@media (max-width: 420px) { .pf-add-row { grid-template-columns: 1fr; } .pf-title small { margin-left: 34px; width: 100%; } }

/* filters */
.flt-list { display: grid; gap: 6px; }
.flt-row { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 8px 8px 8px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.flt-row.editing, .flt-row.confirming { border-color: var(--line2); }
.flt-row.confirming { background: #e5484d12; border-color: #e5484d55; }
.flt-swatch { width: 16px; height: 16px; flex: none; border-radius: 6px; }
.flt-name { flex: 1; min-width: 0; display: grid; }
.flt-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flt-name small { font-size: 12px; }
.flt-input { flex: 1; min-width: 0; padding: 9px 12px; border-radius: 12px; background: var(--bg); }
.flt-color { width: 40px; height: 40px; padding: 3px; border-radius: 12px; flex: none; cursor: pointer; }
.flt-new { margin-top: 14px; padding: 4px 14px 14px; border-radius: 18px; border: 2px dashed var(--line2); }
.flt-new > input { width: 100%; margin-bottom: 12px; background: var(--surface); }
.manage-filters { display: inline-flex; align-items: center; gap: 6px; }
.manage-filters .ico { width: 15px; height: 15px; }
.add-project { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 999px; }
.add-project .ico { width: 18px; height: 18px; }
.role-card { flex-direction: row; }
.role-card:hover, .user-card:hover { transform: none; }
.users-search { align-items: center; }
form label.searchfield, .users-search .searchfield { display: flex; margin: 0; }
.users-search .white { height: 52px; padding: 0 22px; flex: none; }
.flt-row.editing { display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px 40px; padding-left: 8px; }
.flt-row.confirming { flex-wrap: wrap; }
.flt-row.confirming .flt-name { min-width: 140px; }
.icon-button.ok .ico { stroke-width: 2.6; }
