:root {
  color-scheme: light;
  --ink: #06265a;
  --muted: #5e739c;
  --line: #d1daf4;
  --border: var(--line);
  --panel: #ffffff;
  --page: #f5f9ff;
  --accent: #1f58de;
  --accent-dark: #1646b4;
  --accent-soft: #eef4ff;
  --orange: #fc6e20;
  --rose: #c43d4d;
  --blue: #1f58de;
  --navy: #011b46;
  --sidebar: #061f4f;
  --sidebar-muted: #aebde2;
  --shadow: 0 0 10px rgba(211, 218, 234, 0.9);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #ffffff 0, var(--page) 320px),
    var(--page);
  color: var(--ink);
  font-family:
    "IBM Plex Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 64px;
}

.brand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
  margin-bottom: 24px;
  border: 1px solid rgba(209, 218, 244, 0.82);
  border-radius: 4px;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.brand-bar img {
  display: block;
  width: min(280px, 58vw);
  height: auto;
}

.brand-bar span {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  text-align: right;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow);
}

.input-panel {
  position: relative;
  overflow: hidden;
  padding: 38px;
}

.dashboard-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 20px;
  min-height: calc(100vh - 48px);
}

.dashboard-sidebar {
  position: sticky;
  top: 24px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 28px;
  align-self: start;
  min-height: calc(100vh - 48px);
  border-radius: 4px;
  padding: 24px 20px;
  background: var(--sidebar);
  color: white;
  box-shadow: 0 18px 44px rgba(1, 27, 70, 0.2);
}

.sidebar-brand {
  display: grid;
  gap: 12px;
  color: white;
  text-decoration: none;
}

.sidebar-brand img {
  display: block;
  width: min(230px, 100%);
  height: auto;
  border-radius: 2px;
  background: white;
}

.sidebar-brand span {
  color: var(--sidebar-muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.dashboard-main {
  display: grid;
  align-content: start;
  gap: 18px;
  min-width: 0;
}

.dashboard-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 86px;
  border: 1px solid rgba(209, 218, 244, 0.82);
  border-radius: 4px;
  padding: 18px 22px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.dashboard-topbar h1 {
  font-size: clamp(1.55rem, 2.2vw, 2.35rem);
  line-height: 1;
}

.community-view-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid rgba(225, 135, 62, 0.34);
  border-left: 5px solid var(--orange);
  border-radius: 4px;
  padding: 16px 18px;
  background: #fff6ed;
  color: var(--text);
  box-shadow: 0 12px 26px rgba(116, 73, 28, 0.08);
}

.community-view-banner strong {
  display: block;
  margin-top: 4px;
  font-size: 1rem;
}

.community-view-banner span {
  flex: 0 0 auto;
  color: var(--muted);
  font-weight: 800;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  gap: 18px;
  align-items: start;
}

.dashboard-content {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.profile-panel {
  position: sticky;
  top: 24px;
  padding: 22px;
}

.profile-panel::before {
  background: linear-gradient(90deg, var(--orange), var(--accent));
}

.profile-panel h2 {
  font-size: 1.2rem;
}

.login-role-panel,
.auth-panel {
  position: relative;
  overflow: hidden;
  padding: 38px;
}

.admin-panel,
.community-panel {
  position: relative;
  overflow: hidden;
  padding: 38px;
}

.login-role-panel,
.auth-panel,
.onboarding-panel,
.admin-panel,
.community-panel {
  max-width: 920px;
  margin: 0 auto;
}

.input-panel::before {
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--accent), var(--orange));
  content: "";
}

.login-role-panel::before,
.auth-panel::before {
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--orange), var(--accent));
  content: "";
}

.login-role-panel {
  display: grid;
  gap: 22px;
  margin-bottom: 18px;
}

.login-role-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.login-role-button {
  display: grid;
  gap: 6px;
  min-height: 92px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbff;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.login-role-button strong {
  font-size: 0.98rem;
}

.login-role-button span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.login-role-button:hover,
.login-role-button.is-active {
  border-color: var(--accent);
  background: #eef6ff;
}

.login-role-button:focus-visible,
.logout-button:focus-visible {
  border-color: var(--accent);
  outline: 3px solid rgba(31, 88, 222, 0.16);
}

.onboarding-panel::before {
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--accent), var(--orange));
  content: "";
}

.admin-panel::before {
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--accent), var(--navy));
  content: "";
}

.community-panel::before {
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--blue), var(--orange));
  content: "";
}

.onboarding-panel {
  position: relative;
  overflow: hidden;
  padding: 38px;
}

.onboarding-panel .title-row {
  align-items: flex-start;
}

.onboarding-panel h1 {
  max-width: min(100%, 1080px);
  font-size: clamp(2rem, 3.2vw, 3rem);
  line-height: 1.22;
}

.onboarding-panel .criteria-note {
  max-width: 1320px;
  margin: 28px 0 0;
  font-size: 1.05rem;
  line-height: 1.45;
}

.booking-list {
  display: grid;
  gap: 10px;
  margin: 24px 0;
}

.onboarding-expert-groups {
  display: grid;
  gap: 10px;
  margin: 24px 0 12px;
}

.linked-expert-groups {
  margin: 18px 0 0;
}

.linked-expert-groups-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  padding: 14px;
}

.linked-expert-groups-card > span {
  color: var(--muted);
}

.linked-expert-group-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.booking-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--ink);
  padding: 16px 18px;
  text-decoration: none;
}

.booking-item:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.booking-item.is-requested {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.booking-item span {
  color: var(--muted);
  font-size: 0.9rem;
}

.booking-item > div:first-child {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.booking-item strong,
.booking-item span {
  overflow-wrap: anywhere;
}

.booking-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.booking-actions .submit-button {
  width: auto;
  min-height: 36px;
  padding: 0 12px;
}

.booking-actions .booking-confirm-button {
  background: var(--orange);
  box-shadow: 0 8px 16px rgba(252, 110, 32, 0.18);
}

.booking-actions .booking-confirm-button:hover {
  background: #dc5711;
}

.booking-actions .booking-confirm-button.is-requested[disabled] {
  background: var(--accent);
  cursor: default;
  opacity: 1;
}

.expert-group-signup {
  display: grid;
  gap: 12px;
}

.expert-group-signup-panel {
  padding: 24px;
}

.expert-group-signup .criteria-note {
  margin: 0;
}

.expert-group-signup-form {
  display: grid;
  grid-template-columns: minmax(280px, 460px) auto;
  gap: 12px;
  align-items: end;
  border: 1px solid rgba(209, 218, 244, 0.84);
  border-radius: 4px;
  background: #f8fbff;
  padding: 12px;
}

.expert-group-signup-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.expert-group-signup-form .submit-button {
  width: auto;
  min-width: 136px;
  min-height: 46px;
  padding: 0 18px;
}

.expert-group-signup-message {
  color: var(--muted);
  font-weight: 700;
}

.expert-group-signup-bookings {
  margin: 4px 0 0;
}

.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--accent);
  padding: 0 14px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.secondary-action[disabled] {
  cursor: not-allowed;
  opacity: 0.62;
}

.secondary-action:hover:not([disabled]) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.booking-actions .logout-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--accent);
  padding: 0 14px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.booking-actions .logout-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.title-row,
.section-head,
.criteria-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 920px;
  color: var(--navy);
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 700;
  line-height: 1.22;
}

.login-role-panel h1,
.auth-panel h1,
.community-panel h1,
.admin-panel h1 {
  max-width: 980px;
  font-size: clamp(2rem, 3.2vw, 3rem);
  line-height: 1.22;
}

h2 {
  color: var(--navy);
  font-size: 1.35rem;
  font-weight: 700;
}

.status-pill,
.result-count {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

form {
  display: grid;
  gap: 16px;
  margin-top: 34px;
}

.field-label {
  color: var(--navy);
  font-weight: 700;
}

.text-input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 14px;
}

.text-input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(31, 88, 222, 0.16);
}

.code-input {
  max-width: 180px;
  font-weight: 700;
  letter-spacing: 0;
}

.session-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.logout-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--accent);
  padding: 0 14px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.logout-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.danger-button {
  border-color: #f0b4a8;
  color: #b83224;
}

.danger-button:hover {
  border-color: #b83224;
  background: #fff1ef;
}

.drop-zone {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 16px;
  align-items: center;
  min-height: 112px;
  border: 1px dashed var(--line);
  border-radius: 4px;
  padding: 20px;
  background: #ffffff;
  cursor: pointer;
}

.drop-zone:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.drop-zone input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 4px;
  background: var(--accent);
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
}

.drop-copy {
  display: grid;
  gap: 4px;
}

.drop-copy strong {
  font-size: 1.08rem;
  font-weight: 700;
}

.drop-copy small {
  color: var(--muted);
}

.criteria-head label {
  color: var(--navy);
  font-weight: 700;
}

.criteria-note {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.error-note {
  color: var(--rose);
}

.expert-group-field {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  margin: 0;
  padding: 16px;
}

.expert-group-field legend {
  padding: 0 6px;
  color: var(--navy);
  font-weight: 700;
}

.expert-group-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.check-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px 12px;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.check-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.check-option.is-disabled {
  background: #f8f9fd;
  color: var(--muted);
  cursor: not-allowed;
}

.check-option small {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.78rem;
}

.check-option input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}

.admin-workspace,
.community-workspace {
  display: grid;
  gap: 22px;
  margin-top: 28px;
}

.community-dashboard-shell .community-workspace {
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  margin-top: 0;
}

.dashboard-message {
  min-height: 22px;
  margin: 0;
}

.community-dashboard-shell .panel {
  padding: 24px;
}

.community-dashboard-shell .community-managed-groups {
  gap: 14px;
}

.community-dashboard-shell .community-users-manager {
  display: grid;
  gap: 16px;
}

.community-inbox {
  display: grid;
  gap: 16px;
}

.community-inbox-layout {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 18px;
  min-height: 520px;
}

.community-inbox-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  border-right: 1px solid var(--line);
  padding-right: 16px;
}

.community-inbox-item {
  display: grid;
  gap: 5px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: white;
  color: var(--ink);
  padding: 12px;
  cursor: pointer;
  text-align: left;
}

.community-inbox-item:hover,
.community-inbox-item.is-active {
  border-color: rgba(31, 88, 222, 0.42);
  background: #f4f7ff;
}

.community-inbox-item.has-open-question {
  border-left: 4px solid var(--orange);
}

.community-inbox-item span,
.community-inbox-item time {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-inbox-item strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-inbox-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.community-inbox-item .community-inbox-preview {
  color: var(--ink);
}

.inbox-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--orange);
  color: white !important;
  font-size: 0.78rem !important;
  font-weight: 700;
}

.community-inbox-thread {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
}

.compact-button {
  width: auto;
  min-height: 42px;
  padding: 10px 14px;
}

.inline-form {
  margin-top: 0;
}

.inline-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.admin-list {
  display: grid;
  gap: 10px;
}

.community-managed-groups {
  display: grid;
  gap: 12px;
}

.community-managed-groups .expert-group-picker {
  max-width: 360px;
  border-bottom: 0;
  padding-bottom: 0;
  margin: 4px 0 0;
}

.community-managed-groups .expert-group-picker label {
  color: var(--muted);
}

.community-managed-groups .expert-group-picker select {
  border-color: var(--line);
  background: #ffffff;
  color: var(--ink);
}

.admin-list-section {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.admin-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 14px;
  background: #ffffff;
}

.admin-list-item.is-inactive {
  background: #f8f9fd;
  color: var(--muted);
}

.admin-list-main {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.admin-list-item strong {
  overflow-wrap: anywhere;
}

.admin-list-item span {
  color: var(--muted);
  font-size: 0.9rem;
}

.admin-row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.community-manager-row {
  display: grid;
  gap: 7px;
}

.community-manager-row > span,
.muted-inline {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.community-manager-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.community-manager-tag {
  border-radius: 4px;
}

.community-manager-tag small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(1, 27, 70, 0.34);
}

.modal-panel {
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 18px 60px rgba(1, 27, 70, 0.24);
  padding: 24px;
}

.announcement-modal {
  align-items: start;
  overflow: auto;
}

.announcement-modal-panel {
  display: grid;
  gap: 18px;
  width: min(940px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
}

.announcement-modal .announcement-form {
  border: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.modal-head h2 {
  font-size: 1.25rem;
}

.assignment-detail-head-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.assignment-detail-logo-block {
  display: grid;
  justify-items: end;
  gap: 5px;
  max-width: 360px;
}

.assignment-detail-logo {
  display: block;
  width: auto;
  max-width: 180px;
  height: 56px;
  object-fit: contain;
}

.assignment-detail-logo[hidden] {
  display: none;
}

.assignment-detail-logo-link {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: right;
  overflow-wrap: anywhere;
}

.assignment-detail-logo-link[hidden] {
  display: none;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--muted);
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.role-editor {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.profile-panel .role-editor {
  grid-template-columns: 1fr;
}

.profile-panel form {
  margin-top: 20px;
}

.profile-panel .drop-zone {
  grid-template-columns: 44px 1fr;
  min-height: 92px;
  padding: 16px;
}

.profile-panel .drop-icon {
  width: 44px;
  height: 44px;
}

.profile-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.profile-field {
  display: grid;
  gap: 8px;
}

.profile-fields[hidden],
.role-editor[hidden],
.criteria-note[hidden] {
  display: none;
}

.role-editor .criteria-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  grid-column: 1 / -1;
}

.compact-secondary-action {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.82rem;
  white-space: nowrap;
}

.editable-role-group {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 132px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  padding: 14px;
}

.editable-role-head h2 {
  margin: 0;
  color: var(--navy);
  font-size: 0.96rem;
  font-weight: 700;
}

.editable-tags {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  align-items: flex-start;
  gap: 8px;
  min-height: 36px;
}

.editable-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  padding: 6px 7px 6px 10px;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
}

.editable-tag span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.editable-tag-edit,
.editable-tag-remove {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: var(--soft);
  font-weight: 700;
  cursor: pointer;
}

.editable-tag-edit {
  padding: 0 8px;
  color: var(--accent);
  font-size: 0.76rem;
}

.editable-tag-remove {
  width: 22px;
  color: var(--rose);
  font-size: 1rem;
}

.add-chip {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px dashed var(--accent);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.15rem;
  font-weight: 800;
  cursor: pointer;
}

.input-chip {
  padding: 4px 10px;
}

.input-chip[hidden] {
  display: none;
}

.input-chip input {
  width: clamp(120px, 28vw, 220px);
  min-height: 26px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
}

.input-chip input::placeholder {
  color: var(--muted);
}

.submit-button:focus,
.icon-button:focus,
.logout-button:focus,
.secondary-action:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(31, 88, 222, 0.16);
  outline-offset: 2px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: white;
  color: var(--accent);
  font-size: 1.3rem;
  font-weight: 700;
  cursor: pointer;
}

.remove-button {
  color: var(--rose);
}

.submit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  border: 0;
  border-radius: 4px;
  background: var(--accent);
  color: white;
  padding: 0 26px;
  font-weight: 700;
  cursor: pointer;
  justify-self: start;
}

.submit-button:hover {
  background: var(--accent-dark);
}

.submit-button[disabled] {
  cursor: progress;
  opacity: 0.72;
}

.results-layout {
  display: grid;
  gap: 22px;
  margin-top: 24px;
}

.results-menu {
  display: grid;
  gap: 8px;
  align-content: start;
}

.expert-group-picker {
  display: grid;
  gap: 7px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 14px;
  margin-bottom: 6px;
}

.expert-group-picker label {
  color: var(--sidebar-muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.expert-group-picker select {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  padding: 0 10px;
  font: inherit;
  font-weight: 700;
}

.expert-group-picker select:disabled {
  color: var(--sidebar-muted);
  cursor: default;
  opacity: 1;
}

.expert-group-picker select:focus {
  border-color: rgba(255, 255, 255, 0.44);
  outline: 3px solid rgba(31, 88, 222, 0.38);
  outline-offset: 2px;
}

.expert-group-picker option {
  color: var(--ink);
}

.results-menu-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--sidebar-muted);
  padding: 0 12px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
}

.results-menu-item:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.results-menu-item:focus {
  border-color: rgba(255, 255, 255, 0.44);
  outline: 3px solid rgba(31, 88, 222, 0.38);
  outline-offset: 2px;
}

.results-menu-item.is-active {
  border-color: rgba(255, 255, 255, 0.18);
  background: var(--accent);
  color: white;
}

.community-chat-panel {
  grid-column: 1 / -1;
  padding: 24px;
}

.community-events-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 18px;
  padding: 24px;
}

.community-announcements-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 18px;
  padding: 24px;
}

.knowledge-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 18px;
  padding: 24px;
}

.auto-apply-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 18px;
  padding: 24px;
}

.auto-apply-list {
  display: grid;
  gap: 14px;
}

.auto-apply-source {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.auto-apply-card {
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  padding: 16px;
}

.auto-apply-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.auto-apply-card-head h3 {
  margin: 0;
  color: var(--navy);
  font-size: 1.08rem;
  line-height: 1.25;
}

.auto-apply-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.auto-apply-field {
  display: grid;
  gap: 7px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f9fbff;
  padding: 10px 12px;
}

.auto-apply-field span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.auto-apply-field input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 9px 10px;
}

.auto-apply-field input:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(33, 118, 255, 0.16);
  outline-offset: 1px;
}

.auto-apply-slider-field,
.auto-apply-hours-field {
  gap: 12px;
}

.auto-apply-hours-field {
  grid-column: span 2;
}

.auto-apply-field-head,
.auto-apply-slider-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auto-apply-field-head strong,
.auto-apply-slider-control output {
  min-width: 54px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--navy);
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1;
  padding: 8px 9px;
  text-align: center;
}

.auto-apply-slider-control input[type="range"] {
  min-width: 0;
  height: 28px;
  border: 0;
  background: transparent;
  padding: 0;
  accent-color: var(--accent);
}

.auto-apply-slider-control input[type="range"]:focus {
  outline: 2px solid rgba(31, 88, 222, 0.16);
  outline-offset: 2px;
}

.auto-apply-slider-control {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
}

.auto-apply-dual-range {
  position: relative;
  height: 28px;
  border-radius: 999px;
  background:
    linear-gradient(
      90deg,
      transparent 0,
      transparent 100%
    );
}

.auto-apply-dual-range::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 8px;
  border-radius: 999px;
  background:
    linear-gradient(
      90deg,
      #dbe4f8 0%,
      #dbe4f8 var(--min-percent),
      var(--accent) var(--min-percent),
      var(--accent) var(--max-percent),
      #dbe4f8 var(--max-percent),
      #dbe4f8 100%
    );
  transform: translateY(-50%);
}

.auto-apply-dual-range input[type="range"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 28px;
  border: 0;
  background: transparent;
  margin: 0;
  padding: 0;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
}

.auto-apply-dual-range input[type="range"]:focus {
  outline: 2px solid rgba(31, 88, 222, 0.16);
  outline-offset: 3px;
}

.auto-apply-dual-range input[type="range"]::-webkit-slider-runnable-track {
  height: 28px;
  background: transparent;
}

.auto-apply-dual-range input[type="range"]::-moz-range-track {
  height: 28px;
  background: transparent;
}

.auto-apply-dual-range input[type="range"]::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 2px 7px rgba(6, 38, 90, 0.22);
  cursor: pointer;
  pointer-events: auto;
  -webkit-appearance: none;
  appearance: none;
}

.auto-apply-dual-range input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 2px 7px rgba(6, 38, 90, 0.22);
  cursor: pointer;
  pointer-events: auto;
}

.auto-apply-form {
  display: grid;
  gap: 12px;
}

.auto-apply-filters {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.auto-apply-filters-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auto-apply-filters-head h4 {
  margin: 0;
  color: var(--navy);
  font-size: 1rem;
}

.auto-apply-filter-add,
.auto-apply-match-button,
.auto-apply-actions .secondary-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 850;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.auto-apply-filter-add,
.auto-apply-match-button {
  background: #ffffff;
  color: var(--accent);
  padding: 0 14px;
}

.auto-apply-actions .secondary-button {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  padding: 0 18px;
  box-shadow: 0 8px 18px rgba(31, 88, 222, 0.18);
}

.auto-apply-filter-add:hover,
.auto-apply-match-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.auto-apply-actions .secondary-button:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  box-shadow: 0 10px 22px rgba(22, 70, 180, 0.22);
}

.auto-apply-filter-add:focus-visible,
.auto-apply-match-button:focus-visible,
.auto-apply-actions .secondary-button:focus-visible {
  outline: 3px solid rgba(31, 88, 222, 0.18);
  outline-offset: 2px;
}

.auto-apply-filter-add:active,
.auto-apply-match-button:active,
.auto-apply-actions .secondary-button:active {
  transform: translateY(1px);
}

.auto-apply-match-button:disabled,
.auto-apply-actions .secondary-button:disabled {
  border-color: var(--line);
  background: #dbe4f8;
  color: var(--muted);
  cursor: wait;
  box-shadow: none;
}

.auto-apply-match-status {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  min-width: 84px;
}

.auto-apply-matches {
  display: grid;
  gap: 12px;
}

.auto-apply-match-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.auto-apply-match-head h4 {
  margin: 0;
  color: var(--navy);
  font-size: 1rem;
}

.auto-apply-match-head span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  text-align: right;
}

.auto-apply-match-list {
  display: grid;
  gap: 10px;
}

.auto-apply-filter-summary {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f8fafc;
  padding: 10px 12px;
}

.auto-apply-filter-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.auto-apply-filter-summary strong {
  color: var(--navy);
}

.auto-apply-excluded-results {
  display: grid;
  gap: 10px;
}

.auto-apply-assignment-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 4px;
  background: #ffffff;
  padding: 13px 14px;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.auto-apply-assignment-card.is-excluded {
  border-left-color: #94a3b8;
  background: #f8fafc;
}

.auto-apply-assignment-card:hover,
.auto-apply-assignment-card:focus-visible {
  border-color: rgba(31, 88, 222, 0.36);
  box-shadow: 0 10px 22px rgba(24, 34, 48, 0.08);
  transform: translateY(-1px);
  outline: none;
}

.auto-apply-assignment-card h5 {
  margin: 0;
  color: var(--navy);
  font-size: 0.98rem;
  line-height: 1.25;
}

.auto-apply-assignment-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.4;
}

.auto-apply-filter-list {
  display: grid;
  gap: 8px;
}

.auto-apply-filter-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(160px, 1.1fr) minmax(110px, 0.55fr) 36px;
  align-items: end;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f9fbff;
  padding: 12px;
}

.auto-apply-filter-row label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.auto-apply-filter-row span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.auto-apply-filter-row input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 9px 10px;
}

.auto-apply-filter-row input:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(31, 88, 222, 0.16);
  outline-offset: 1px;
}

.auto-apply-filter-remove {
  align-self: end;
  width: 36px;
  height: 36px;
}

.auto-apply-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.section-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.auto-apply-save-status {
  min-height: 1.2em;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.community-events-manager,
.community-announcements-manager,
.knowledge-manager {
  display: grid;
  gap: 16px;
}

.event-form,
.announcement-form {
  display: grid;
  gap: 14px;
  margin-top: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #ffffff 0, #f9fbff 100%);
  padding: 18px;
  box-shadow: 0 8px 24px rgba(6, 38, 90, 0.06);
}

.event-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.event-form textarea {
  min-height: 112px;
  padding-top: 12px;
  resize: vertical;
}

.wysiwyg-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: #eef4ff;
  padding: 8px;
}

.wysiwyg-toolbar .icon-button {
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-color: transparent;
  background: transparent;
  color: var(--ink);
  font-size: 0.98rem;
  box-shadow: none;
}

.wysiwyg-toolbar .icon-button:hover,
.wysiwyg-toolbar .icon-button:focus-visible {
  border-color: rgba(31, 88, 222, 0.26);
  background: #ffffff;
  color: var(--accent);
}

.wysiwyg-select {
  min-width: 138px;
  height: 38px;
  border: 1px solid rgba(31, 88, 222, 0.16);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 0 32px 0 10px;
}

.toolbar-divider {
  width: 1px;
  height: 28px;
  background: rgba(94, 115, 156, 0.28);
}

.wysiwyg-editor {
  min-height: 240px;
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 18px 20px;
  line-height: 1.6;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.wysiwyg-editor:empty::before {
  color: var(--muted);
  content: attr(data-placeholder);
  pointer-events: none;
}

.wysiwyg-editor:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(31, 88, 222, 0.14);
  outline-offset: 0;
}

.wysiwyg-editor h2,
.wysiwyg-editor h3,
.announcement-body h2,
.announcement-body h3 {
  margin: 0.85em 0 0.35em;
  line-height: 1.2;
}

.wysiwyg-editor h2,
.announcement-body h2 {
  font-size: 1.32rem;
}

.wysiwyg-editor h3,
.announcement-body h3 {
  font-size: 1.08rem;
}

.wysiwyg-editor blockquote,
.announcement-body blockquote {
  margin: 12px 0;
  border-left: 4px solid var(--accent);
  border-radius: 0 6px 6px 0;
  padding: 10px 14px;
  background: var(--accent-soft);
  color: var(--ink);
}

.wysiwyg-editor ul,
.wysiwyg-editor ol,
.announcement-body ul,
.announcement-body ol {
  padding-left: 24px;
}

.wysiwyg-editor figure,
.announcement-body figure {
  margin: 16px 0;
}

.wysiwyg-editor img,
.announcement-body img,
.wysiwyg-editor video,
.announcement-body video,
.wysiwyg-editor iframe,
.announcement-body iframe {
  display: block;
  width: 100%;
  max-width: 760px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5f9ff;
  box-shadow: 0 10px 28px rgba(6, 38, 90, 0.08);
}

.wysiwyg-editor img,
.announcement-body img {
  height: auto;
}

.wysiwyg-editor video,
.announcement-body video,
.wysiwyg-editor iframe,
.announcement-body iframe {
  aspect-ratio: 16 / 9;
  height: min(52vw, 428px);
  min-height: 220px;
}

.wysiwyg-editor video,
.announcement-body video {
  height: auto;
  min-height: 0;
}

.event-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.event-list-toolbar {
  display: flex;
  justify-content: flex-end;
}

.calendar-board {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  padding: 16px;
}

.calendar-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.calendar-head h3 {
  margin: 0;
  color: var(--navy);
  font-size: 1.05rem;
}

.calendar-head span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.calendar-weekdays span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.calendar-day {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  padding: 8px;
}

.calendar-day.is-muted {
  background: #f7f9fe;
  color: var(--muted);
}

.calendar-day > span {
  color: var(--navy);
  font-size: 0.86rem;
  font-weight: 800;
}

.calendar-day strong,
.calendar-day small {
  display: block;
  min-width: 0;
  overflow: hidden;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 3px 5px;
  font-size: 0.72rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-day small {
  background: #fff4ed;
  color: var(--orange);
  font-weight: 800;
}

.event-list,
.announcement-list {
  display: grid;
  gap: 10px;
}

.knowledge-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 460px) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  border: 1px solid rgba(209, 218, 244, 0.84);
  border-radius: 4px;
  background: #f8fbff;
  padding: 12px;
}

.knowledge-toolbar .criteria-note {
  margin: 0;
  text-align: right;
}

.knowledge-search {
  position: relative;
  display: block;
}

.knowledge-search span {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 14px;
  color: var(--accent);
  font-size: 1.05rem;
  font-weight: 800;
  transform: translateY(-50%);
}

.knowledge-search .text-input {
  min-height: 44px;
  padding-left: 40px;
}

.knowledge-list {
  display: grid;
  gap: 12px;
}

.knowledge-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  padding: 16px;
  box-shadow: 0 8px 20px rgba(6, 38, 90, 0.04);
}

.knowledge-card:hover {
  border-color: rgba(31, 88, 222, 0.34);
  box-shadow: 0 12px 26px rgba(6, 38, 90, 0.08);
}

.knowledge-card-main {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.knowledge-card-main h3 {
  margin: 0;
  color: var(--navy);
  font-size: 1.1rem;
  line-height: 1.25;
}

.knowledge-card-main p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.knowledge-body {
  min-width: 0;
  color: var(--ink);
}

.knowledge-body img,
.knowledge-body video,
.knowledge-body iframe {
  max-width: 100%;
}

.knowledge-meta,
.knowledge-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.knowledge-meta {
  gap: 8px;
}

.knowledge-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 3px 9px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: capitalize;
}

.knowledge-source {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.knowledge-tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  padding: 2px 8px;
  font-size: 0.76rem;
  font-weight: 700;
}

.knowledge-link {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  min-height: 34px;
  border: 1px solid rgba(31, 88, 222, 0.24);
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0 12px;
  font-weight: 800;
  text-decoration: none;
}

.knowledge-link:hover {
  border-color: var(--accent);
  background: #e6efff;
  text-decoration: none;
}

.event-card {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  padding: 14px;
}

.event-card-selectable {
  cursor: pointer;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.event-card-selectable:hover,
.event-card-selectable:focus-visible,
.event-card-selectable.is-expanded {
  border-color: rgba(31, 88, 222, 0.36);
  box-shadow: 0 10px 22px rgba(24, 34, 48, 0.08);
}

.event-card-selectable:hover,
.event-card-selectable:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.event-date-badge {
  display: grid;
  place-items: center;
  min-height: 58px;
  border-radius: 4px;
  background: var(--navy);
  color: white;
  padding: 7px;
  text-align: center;
}

.event-date-badge strong {
  font-size: 1.25rem;
  line-height: 1;
}

.event-date-badge span {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.event-card-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.event-card-main h3 {
  margin: 0;
  color: var(--navy);
  font-size: 1.02rem;
  line-height: 1.25;
}

.event-card-main p,
.event-description {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.event-description {
  color: var(--ink);
}

.event-details {
  display: grid;
  gap: 8px;
}

.announcement-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  border: 1px solid rgba(209, 218, 244, 0.94);
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
  box-shadow: 0 10px 28px rgba(6, 38, 90, 0.07);
}

.announcement-card .admin-row-actions {
  grid-column: 3;
}

.announcement-author-avatar,
.announcement-comment-avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: 1px solid #dfe7fb;
  border-radius: 999px;
  background: linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
}

.announcement-card-main {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.announcement-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.announcement-card-header div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.announcement-card-header strong {
  color: var(--navy);
  line-height: 1.25;
}

.announcement-card-header span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.35;
}

.announcement-card-main h3 {
  margin: 0;
  color: var(--navy);
  font-size: 1.18rem;
  line-height: 1.25;
}

.announcement-card-main > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.announcement-body {
  border: 1px solid #edf2ff;
  border-radius: 8px;
  background: #fbfdff;
  color: var(--ink);
  line-height: 1.58;
  padding: 14px;
}

.announcement-body :first-child {
  margin-top: 0;
}

.announcement-body :last-child {
  margin-bottom: 0;
}

.announcement-body a {
  color: var(--accent);
  font-weight: 800;
}

.announcement-comments {
  display: grid;
  gap: 12px;
  border-top: 1px solid #e4ebfb;
  margin-top: 2px;
  padding-top: 14px;
}

.announcement-comments-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.announcement-comments-head strong {
  color: var(--navy);
  font-size: 0.9rem;
}

.announcement-comments-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--accent);
  padding: 0 12px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.announcement-comments-toggle:hover,
.announcement-comments-toggle:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  outline: none;
}

.announcement-comments-toggle span:last-child {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1;
}

.announcement-comments-panel {
  display: grid;
  gap: 12px;
}

.announcement-comments-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.announcement-comment {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.announcement-comment-avatar {
  width: 32px;
  height: 32px;
  font-size: 0.68rem;
}

.announcement-comment-main {
  display: grid;
  gap: 6px;
  min-width: 0;
  border: 1px solid #edf2ff;
  border-radius: 8px;
  background: #f8fbff;
  padding: 10px 12px;
}

.announcement-comment-main div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
}

.announcement-comment strong {
  color: var(--navy);
}

.announcement-comment span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.announcement-comment p {
  margin: 0;
  line-height: 1.45;
}

.announcement-comment-form {
  display: grid;
  gap: 9px;
  border: 1px solid #e4ebfb;
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.announcement-comment-form textarea {
  min-height: 90px;
  resize: vertical;
  padding-top: 12px;
  line-height: 1.45;
}

.announcement-comment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.announcement-comment-actions .submit-button {
  min-height: 42px;
  padding: 0 18px;
}

.announcement-comment-status {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.community-chat-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
  min-height: 520px;
}

.community-manager-list {
  display: grid;
  align-content: start;
  gap: 8px;
  border-right: 1px solid var(--border);
  padding-right: 16px;
}

.community-manager-chat-item {
  display: grid;
  gap: 4px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: white;
  color: var(--ink);
  padding: 12px;
  cursor: pointer;
  text-align: left;
}

.community-manager-chat-item:hover,
.community-manager-chat-item.is-active {
  border-color: rgba(47, 111, 237, 0.42);
  background: #f4f7ff;
}

.community-manager-chat-item strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-manager-chat-item span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-chat-thread {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
}

.community-chat-empty {
  border: 1px dashed var(--border);
  border-radius: 4px;
  color: var(--muted);
  padding: 18px;
  font-weight: 700;
}

.community-chat-messages {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 260px;
  max-height: 420px;
  overflow-y: auto;
  padding: 4px 2px 16px;
}

.community-chat-message {
  display: flex;
}

.community-chat-message.is-own {
  justify-content: flex-end;
}

.community-chat-bubble {
  max-width: min(620px, 82%);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  padding: 12px 14px;
}

.community-chat-message.is-own .community-chat-bubble {
  border-color: rgba(47, 111, 237, 0.36);
  background: #ecf3ff;
}

.community-chat-sender {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 0.82rem;
}

.community-chat-bubble p {
  margin: 0;
  line-height: 1.5;
}

.community-chat-bubble time {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.community-chat-form {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.community-chat-form textarea {
  min-height: 112px;
  resize: vertical;
}

.sidebar-status {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 18px;
  color: var(--sidebar-muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.sidebar-status span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #24b47e;
  box-shadow: 0 0 0 4px rgba(36, 180, 126, 0.16);
}

.monthly-chart-panel {
  padding: 24px;
}

.monthly-chart {
  display: grid;
  gap: 22px;
  margin-top: 18px;
}

.monthly-metric {
  display: grid;
  gap: 10px;
}

.monthly-metric h3 {
  margin: 0;
  color: var(--navy);
  font-size: 0.98rem;
  font-weight: 700;
}

.monthly-metric-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.monthly-rate-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.monthly-rate-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.monthly-rate-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.monthly-rate-legend-swatch.is-rate-range {
  background: #1f2937;
}

.monthly-rate-legend-swatch.is-rate-average {
  background: #2f6fed;
}

.monthly-rate-legend-swatch.is-assignment-total {
  background: linear-gradient(180deg, #78a8ff, var(--accent));
}

.monthly-rate-legend-swatch.is-assignment-rate {
  background: linear-gradient(180deg, var(--orange), #f0b429);
}

.monthly-rate-candlestick {
  min-width: 0;
  overflow-x: auto;
  padding: 2px 0 0;
}

.monthly-rate-candlestick svg {
  display: block;
  width: 100%;
  min-width: 720px;
  height: auto;
}

.rate-grid-line {
  stroke: rgba(15, 23, 42, 0.11);
  stroke-width: 1;
}

.rate-axis-line {
  stroke: rgba(15, 23, 42, 0.28);
  stroke-width: 1.2;
}

.rate-axis-label {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.rate-range-line,
.rate-range-cap {
  stroke: #1f2937;
  stroke-width: 3;
  stroke-linecap: round;
}

.rate-average-body {
  fill: rgba(47, 111, 237, 0.76);
  stroke: #174ea6;
  stroke-width: 1;
}

.rate-candle:hover .rate-range-line,
.rate-candle:hover .rate-range-cap {
  stroke: #b42318;
}

.rate-candle:hover .rate-average-body {
  fill: rgba(180, 35, 24, 0.78);
  stroke: #7a271a;
}

.rate-month-label {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: capitalize;
}

.rate-year-label {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.monthly-bars {
  display: grid;
  grid-template-columns: repeat(12, minmax(42px, 1fr));
  gap: 10px;
  align-items: end;
  min-width: 0;
  overflow-x: auto;
  padding: 4px 2px 0;
}

.monthly-bar-item {
  display: grid;
  grid-template-rows: 24px 150px auto;
  gap: 7px;
  min-width: 42px;
  text-align: center;
}

.monthly-bar-value {
  color: var(--navy);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 24px;
}

.monthly-bar-track {
  display: flex;
  align-items: end;
  justify-content: center;
  border-radius: 4px;
  background: var(--accent-soft);
  overflow: hidden;
}

.monthly-bar-fill {
  width: 100%;
  min-height: 0;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #78a8ff, var(--accent));
}

.monthly-bar-fill-rate {
  background: linear-gradient(180deg, var(--orange), #f0b429);
}

.monthly-bars-count-comparison {
  grid-template-columns: repeat(12, minmax(42px, 1fr));
}

.monthly-count-group {
  min-width: 42px;
}

.monthly-count-stack {
  height: 150px;
}

.monthly-bar-fill-total {
  position: relative;
  background: linear-gradient(180deg, #78a8ff, var(--accent));
  overflow: hidden;
}

.monthly-bar-fill-with-rate {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(180deg, var(--orange), #f0b429);
}

.monthly-bars-rate-comparison {
  grid-template-columns: repeat(12, minmax(54px, 1fr));
}

.monthly-rate-group {
  grid-template-rows: 150px auto;
  min-width: 54px;
}

.monthly-rate-bars {
  display: grid;
  grid-template-columns: repeat(4, minmax(7px, 1fr));
  gap: 3px;
  align-items: end;
  height: 150px;
}

.monthly-rate-track {
  height: 150px;
  min-width: 0;
}

.monthly-bar-fill-rate.is-average-max,
.monthly-rate-legend-swatch.is-average-max {
  background: linear-gradient(180deg, #12805c, #47b881);
}

.monthly-bar-fill-rate.is-average-min,
.monthly-rate-legend-swatch.is-average-min {
  background: linear-gradient(180deg, #2f6fed, #78a8ff);
}

.monthly-bar-fill-rate.is-maximum-max,
.monthly-rate-legend-swatch.is-maximum-max {
  background: linear-gradient(180deg, #b42318, #ff8a65);
}

.monthly-bar-fill-rate.is-minimum-min,
.monthly-rate-legend-swatch.is-minimum-min {
  background: linear-gradient(180deg, #805ad5, #b794f4);
}

.monthly-bar-label {
  display: grid;
  gap: 1px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.15;
  text-transform: capitalize;
}

.monthly-bar-label small {
  color: var(--muted);
  font-size: 0.72rem;
}

.progress-panel {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  width: min(390px, calc(100vw - 32px));
  max-height: min(460px, calc(100vh - 36px));
  padding: 24px;
  box-shadow: 0 18px 48px rgba(1, 27, 70, 0.22);
}

.progress-panel.is-collapsed {
  max-height: none;
}

.progress-toggle {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  font-size: 1.15rem;
  line-height: 1;
}

.advice-panel {
  padding: 24px;
}

.progress-log {
  display: grid;
  gap: 8px;
  max-height: 300px;
  margin-top: 18px;
  overflow: auto;
}

.progress-item {
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--ink);
  padding: 9px 11px;
  font-size: 0.92rem;
  line-height: 1.35;
}

.progress-debug {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.progress-error {
  border-left-color: var(--rose);
  color: var(--rose);
}

.advice-grid {
  display: grid;
  gap: 14px;
}

.advice-background {
  display: grid;
  gap: 18px;
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.advice-background-head {
  gap: 14px;
}

.advice-background-head h3 {
  margin: 0;
  color: var(--navy);
  font-size: 1.08rem;
}

.background-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 4px;
  background: var(--soft);
}

.background-tab {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
}

.background-tab:hover {
  color: var(--accent);
}

.background-tab:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(31, 88, 222, 0.16);
  outline-offset: 2px;
}

.background-tab.is-active {
  border-color: var(--line);
  background: white;
  color: var(--accent);
}

.background-panel {
  min-width: 0;
}

.advice-background .matches,
.advice-background .all-results {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.advice-background .sticky-head {
  margin: 0 0 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 0 0 14px;
  background: var(--panel);
}

.advice-block {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.advice-block h3 {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 0.95rem;
  font-weight: 700;
}

.advice-block ul {
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
  line-height: 1.45;
}

.advice-meta {
  color: var(--muted);
  font-size: 0.9em;
}

.training-panel {
  padding: 24px;
}

.training-list {
  display: grid;
  gap: 14px;
}

.matching-assignments-panel {
  padding: 24px;
}

.matching-assignment-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 240px);
  gap: 14px;
  align-items: end;
  margin: 14px 0 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.matching-assignment-filters label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.matching-radius-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px;
  gap: 12px;
  align-items: center;
}

.matching-radius-control input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.matching-radius-control output,
.matching-freelancer-filter select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--ink);
}

.matching-radius-control output {
  display: grid;
  place-items: center;
  font-weight: 800;
}

.matching-freelancer-filter select {
  padding: 0 10px;
  font: inherit;
}

.matching-assignments-note {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.matching-assignment-list {
  display: grid;
  gap: 12px;
}

.matching-assignment-card {
  position: relative;
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 18px 18px 16px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(24, 34, 48, 0.05);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.matching-assignment-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent);
  opacity: 0.85;
}

.matching-assignment-card:hover,
.matching-assignment-card:focus-visible {
  border-color: rgba(31, 88, 222, 0.34);
  box-shadow: 0 12px 28px rgba(24, 34, 48, 0.09);
  transform: translateY(-1px);
  outline: none;
}

.matching-assignment-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, auto);
  gap: 18px;
  align-items: start;
  min-width: 0;
}

.matching-assignment-title-block {
  min-width: 0;
}

.matching-assignment-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  max-width: 420px;
}

.matching-badge {
  display: inline-grid;
  min-height: 28px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 5px 9px;
  background: #ffffff;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.matching-badge.is-positive {
  border-color: rgba(37, 128, 90, 0.25);
  background: rgba(37, 128, 90, 0.1);
  color: #1f6b4d;
}

.matching-badge.is-negative {
  border-color: rgba(190, 71, 85, 0.25);
  background: rgba(190, 71, 85, 0.1);
  color: #9f3342;
}

.matching-badge.is-deadline {
  border-color: rgba(38, 95, 166, 0.22);
  background: rgba(38, 95, 166, 0.08);
  color: #265fa6;
}

.matching-assignment-details {
  display: grid;
  grid-template-columns: repeat(5, minmax(108px, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 4px;
  margin: 0;
  overflow: hidden;
}

.matching-assignment-details > div {
  min-width: 0;
  padding: 10px 11px;
  background: #fbfcfd;
}

.matching-assignment-details dt {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.matching-assignment-details dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.matching-criteria-row {
  padding-top: 0;
}

.assignment-detail-modal {
  z-index: 40;
}

.assignment-detail-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1280px, calc(100vw - 32px));
  height: min(940px, calc(100vh - 32px));
  max-height: calc(100vh - 32px);
}

.assignment-detail-body {
  min-height: 0;
  margin-top: 18px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
}

.assignment-detail-html {
  color: var(--ink);
  font-size: 0.96rem;
  line-height: 1.6;
  max-width: none;
}

.assignment-detail-html > :first-child {
  margin-top: 0;
}

.assignment-detail-html > :last-child {
  margin-bottom: 0;
}

.assignment-detail-html h1,
.assignment-detail-html h2,
.assignment-detail-html h3 {
  margin: 22px 0 10px;
  color: var(--navy);
  font-size: 1.05rem;
  line-height: 1.3;
}

.assignment-detail-html p,
.assignment-detail-html ul,
.assignment-detail-html ol {
  margin: 0 0 12px;
}

.assignment-detail-html ul,
.assignment-detail-html ol {
  padding-left: 22px;
}

.assignment-detail-html a {
  color: var(--accent);
  font-weight: 700;
}

.members-panel {
  padding: 24px;
}

.member-search {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  max-width: 420px;
}

.member-search span {
  color: var(--ink);
  font-weight: 800;
}

.member-chat-layout {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
  min-height: 520px;
}

.member-list {
  display: grid;
  align-content: start;
  gap: 12px;
  border-right: 1px solid var(--border);
  padding-right: 16px;
}

.member-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 14px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.member-card:hover,
.member-card.is-active {
  border-color: rgba(47, 111, 237, 0.42);
  background: #f4f7ff;
}

.member-avatar {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
}

.group-avatar {
  background: #e7f7ef;
  color: #16784a;
}

.member-main {
  min-width: 0;
}

.member-main h3 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.25;
}

.member-main span {
  display: inline-block;
  max-width: 100%;
  color: var(--accent-dark);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.member-main p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}

.training-section {
  display: grid;
  gap: 12px;
}

.training-section h3 {
  margin: 0;
  color: var(--blue);
  font-size: 0.95rem;
  font-weight: 800;
}

.training-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 18px;
  background: white;
}

.certification-card {
  border-left: 4px solid var(--accent);
}

.training-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.training-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
}

.training-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.certification-steps {
  margin: 0;
  padding-left: 22px;
  color: var(--ink);
  line-height: 1.45;
}

.training-links,
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.training-link {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 10px;
  background: var(--soft);
  color: var(--blue);
  font-size: 0.86rem;
  font-weight: 750;
  text-decoration: none;
}

.training-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.training-link.is-muted {
  color: var(--muted);
}

.matches {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 24px;
}

.all-results {
  padding: 24px;
}

.sticky-head {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: -24px -24px 0;
  border-bottom: 1px solid var(--line);
  padding: 18px 24px;
  background: var(--panel);
}

.match-list {
  display: grid;
  gap: 14px;
}

.score-filter {
  display: grid;
  gap: 8px;
  margin: 18px 0 16px;
  border-bottom: 1px solid var(--line);
  padding: 0 0 16px;
}

.score-filter[hidden] {
  display: none;
}

.score-filter label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.score-filter-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 12px;
  align-items: center;
}

.score-filter input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.score-filter output {
  display: grid;
  place-items: center;
  min-height: 32px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.all-result-list {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.result-group {
  display: grid;
  gap: 10px;
}

.result-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.result-group-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
}

.result-group-list {
  display: grid;
  gap: 10px;
}

.match-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 4px;
  padding: 18px;
  background: white;
  box-shadow: var(--shadow);
}

.match-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.match-actions {
  display: flex;
  align-items: start;
  gap: 8px;
}

.match-remove-button {
  width: 36px;
  height: 36px;
  color: var(--rose);
  font-size: 1.15rem;
}

.match-title {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.25;
}

.matching-assignment-card .match-title {
  font-size: 1.02rem;
  line-height: 1.3;
}

.meta {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.matching-assignment-card .meta {
  margin-top: 6px;
  font-size: 0.88rem;
  font-weight: 700;
}

.score {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.small-score {
  width: 46px;
  height: 46px;
  font-size: 0.9rem;
}

.all-result-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 14px;
  background: #ffffff;
}

.all-result-main {
  min-width: 0;
}

.all-result-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.all-result-reason {
  margin: 8px 0 10px;
  color: var(--ink);
  line-height: 1.4;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--muted);
  padding: 5px 9px;
  font-size: 0.8rem;
  font-weight: 700;
}

.reason-list {
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
  line-height: 1.45;
}

.concerns {
  margin: 0;
  color: var(--rose);
  line-height: 1.45;
}

.assignment-link {
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
}

.title-link {
  color: inherit;
  text-decoration: none;
}

.matching-assignment-card .title-link {
  color: var(--ink);
}

.assignment-link:hover {
  text-decoration: underline;
}

.title-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.empty {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 18px;
  background: white;
  color: var(--muted);
}

.loading-state {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 84px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 18px;
  background: white;
  color: var(--muted);
  font-weight: 750;
}

.spinner {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border: 3px solid #d8dfda;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation: none;
  }
}

@media (max-width: 820px) {
  .shell {
    width: min(100% - 20px, 720px);
    padding-top: 14px;
  }

  .dashboard-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .dashboard-sidebar {
    position: static;
    min-height: auto;
    padding: 16px;
  }

  .sidebar-brand {
    grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
    align-items: center;
  }

  .results-menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .matching-assignment-filters {
    grid-template-columns: 1fr;
  }

  .matching-assignment-head {
    grid-template-columns: 1fr;
  }

  .matching-assignment-badges {
    justify-content: flex-start;
    max-width: none;
  }

  .matching-assignment-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .login-role-options {
    grid-template-columns: 1fr;
  }

  .expert-group-picker {
    grid-column: 1 / -1;
  }

  .dashboard-topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  .community-view-banner {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .profile-panel {
    position: static;
    order: -1;
  }

  .brand-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .brand-bar span {
    text-align: left;
  }

  .input-panel,
  .login-role-panel,
  .auth-panel,
  .onboarding-panel,
  .admin-panel,
  .community-panel,
  .progress-panel,
  .monthly-chart-panel,
  .advice-panel {
    padding: 18px;
  }

  .matches {
    padding: 18px;
  }

  .title-row,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .booking-item {
    align-items: stretch;
    flex-direction: column;
  }

  .booking-actions {
    justify-content: flex-start;
  }

  .expert-group-signup-form {
    grid-template-columns: 1fr;
  }

  .expert-group-signup-form .submit-button {
    width: 100%;
  }

  .role-editor {
    grid-template-columns: 1fr;
  }

  .role-editor .criteria-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .profile-fields {
    grid-template-columns: 1fr;
  }

  .inline-control {
    grid-template-columns: 1fr;
  }

  .admin-list-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .modal-panel {
    padding: 18px;
  }

  .modal-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .results-menu-item {
    grid-template-columns: 24px minmax(0, 1fr);
    min-height: 38px;
    padding: 0 10px;
    font-size: 0.92rem;
  }

  .progress-panel,
  .monthly-chart-panel,
  .advice-panel,
  .matches {
    grid-column: auto;
    grid-row: auto;
  }

  .progress-panel {
    right: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
    max-height: 42vh;
  }

  .progress-log {
    max-height: calc(42vh - 112px);
  }

  .all-results {
    padding: 18px;
  }

  .community-chat-panel {
    padding: 18px;
  }

  .community-events-panel,
  .community-announcements-panel {
    padding: 18px;
  }

  .community-dashboard-shell .panel {
    padding: 18px;
  }

  .knowledge-panel {
    padding: 18px;
  }

  .knowledge-toolbar {
    grid-template-columns: 1fr;
  }

  .knowledge-toolbar .criteria-note {
    text-align: left;
  }

  .event-form-grid {
    grid-template-columns: 1fr;
  }

  .event-form-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .calendar-board {
    padding: 12px;
    overflow-x: auto;
  }

  .calendar-weekdays,
  .calendar-grid {
    min-width: 680px;
  }

  .event-card {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .event-card .admin-row-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .knowledge-card {
    grid-template-columns: 1fr;
  }

  .knowledge-card .admin-row-actions {
    justify-content: flex-start;
  }

  .announcement-card {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 10px;
    padding: 14px;
  }

  .announcement-author-avatar {
    width: 36px;
    height: 36px;
    font-size: 0.7rem;
  }

  .announcement-card-main {
    gap: 9px;
  }

  .announcement-card .admin-row-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .community-chat-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .member-chat-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .community-inbox-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .community-inbox-list {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding-right: 0;
    padding-bottom: 14px;
  }

  .community-manager-list {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding-right: 0;
    padding-bottom: 14px;
  }

  .member-list {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding-right: 0;
    padding-bottom: 14px;
  }

  .community-chat-messages {
    max-height: 360px;
  }

  .community-chat-bubble {
    max-width: 92%;
  }

  .sticky-head {
    margin: -18px -18px 0;
    padding: 16px 18px;
  }

  .advice-background .sticky-head {
    margin: 0 0 18px;
    padding: 0 0 14px;
  }

  .background-tabs {
    width: 100%;
  }

  .background-tab {
    flex: 1 1 140px;
  }

  .match-top {
    grid-template-columns: 1fr;
  }

  .auto-apply-filter-row {
    grid-template-columns: 1fr;
  }

  .auto-apply-hours-field {
    grid-column: auto;
  }

  .auto-apply-filters-head,
  .auto-apply-match-head,
  .auto-apply-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .auto-apply-match-head span {
    text-align: left;
  }

  .all-result-title-row {
    flex-direction: column;
    gap: 6px;
  }

  .result-group-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .score {
    width: 52px;
    height: 52px;
  }
}
