/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.08s var(--ease), box-shadow 0.08s var(--ease), background 0.15s;
}

.btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--ink);
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--ink);
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: var(--shadow-sm);
}

.btn-primary {
  background: var(--ink);
  color: #fff;
}

.btn-accent {
  background: var(--yellow);
}

.btn-danger {
  background: var(--red);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.btn-ghost:hover {
  background: var(--surface);
  border-color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 14px 32px;
  font-size: 1rem;
  box-shadow: var(--shadow);
}

.btn-lg:hover {
  box-shadow: var(--shadow-lg);
}

.btn-block {
  width: 100%;
}

.icon-btn {
  width: 38px;
  height: 38px;
  padding: 0;
}

.icon-btn.btn-sm {
  width: 30px;
  height: 30px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: #fff;
}

.search {
  position: relative;
  flex: 1;
  max-width: 460px;
  margin-inline: auto;
}

.search > svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.search .input {
  padding-left: 38px;
}

.search-validator {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  padding: 6px 12px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--danger);
  background: var(--surface);
  border: var(--border-thin);
  border-radius: var(--radius-xs);
  box-shadow: var(--shadow-sm);
  z-index: 100;
  animation: pickerSlideDown 0.15s ease-out;
}

.picker-validator-hint {
  color: var(--danger) !important;
  font-weight: 600 !important;
}

.header-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.avatar-lg {
  width: 64px;
  height: 64px;
  font-size: 1.3rem;
  border: var(--border);
  background: var(--yellow);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.user-menu-wrap {
  position: relative;
}

.menu-btn {
  gap: 6px;
  padding: 4px 8px 4px 4px;
  border-radius: var(--pill);
}

.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 60;
  min-width: 220px;
  padding: 6px;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.menu-head {
  display: flex;
  flex-direction: column;
  padding: 8px 12px 10px;
  margin-bottom: 6px;
  border-bottom: var(--border);
  font-size: 0.85rem;
}

.menu-head span {
  color: var(--muted);
  font-size: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  font-size: 0.88rem;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.menu-item:hover {
  background: var(--yellow);
}

.demo-banner {
  padding: 6px 16px;
  background: var(--yellow);
  border-bottom: var(--border);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
}

/* ---------- Inputs ---------- */
.input,
.select {
  width: 100%;
  padding: 10px 14px;
  border: var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 0.9rem;
}

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

textarea.input {
  min-height: 110px;
  resize: vertical;
  line-height: 1.5;
}

.input[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 2px 2px 0 var(--danger);
}

.select {
  appearance: none;
  width: auto;
  padding: 8px 36px 8px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.select-block {
  width: 100%;
  padding: 10px 36px 10px 14px;
  font-size: 0.9rem;
  font-weight: 400;
}

.input-icon {
  position: relative;
}

.input-icon > svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.input-icon .input {
  padding-left: 38px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field-label {
  font-size: 0.85rem;
  font-weight: 700;
}

.field-label .optional {
  font-weight: 400;
  color: var(--muted);
}

.field-hint {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--muted);
}

.field-error {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--danger);
}

.field-error::before {
  content: "⚠ ";
}

.form-error {
  padding: 12px 16px;
  border: var(--border);
  border-radius: var(--radius);
  background: var(--red);
  box-shadow: var(--shadow-sm);
  font-size: 0.88rem;
  font-weight: 600;
}

/* ---------- Chips & badges ---------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border: var(--border-thin);
  border-radius: var(--pill);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

.chip-more {
  background: var(--surface-alt);
}

.chip-match {
  background: var(--green);
}

.chip-tag {
  border-radius: var(--radius-xs);
  font-family: var(--mono);
  font-size: 0.7rem;
}

.chip[data-tone="yellow"] { background: var(--yellow-soft); }
.chip[data-tone="green"] { background: var(--green); }
.chip[data-tone="blue"] { background: var(--blue); }
.chip[data-tone="pink"] { background: var(--pink); }
.chip[data-tone="purple"] { background: var(--purple); }
.chip[data-tone="orange"] { background: var(--orange); }

.filter-chip {
  padding: 6px 14px;
  border: var(--border);
  border-radius: var(--pill);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.08s var(--ease), box-shadow 0.08s var(--ease);
}

.filter-chip:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--ink);
}

.filter-chip[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
}

.count-badge {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: var(--border-thin);
  border-radius: var(--radius-xs);
  background: var(--yellow);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
}

.match-badge {
  flex-shrink: 0;
  padding: 2px 8px;
  border: var(--border-thin);
  border-radius: var(--pill);
  background: var(--green);
  box-shadow: var(--shadow-xs);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.status {
  display: inline-block;
  padding: 0 8px;
  border: var(--border-thin);
  border-radius: var(--radius-xs);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.6;
  vertical-align: middle;
}

.status-open { background: var(--green); }
.status-closed { background: var(--surface-alt); }
.status-filled { background: var(--surface-alt); }

/* ---------- Feed ---------- */
.page-head {
  margin-bottom: 20px;
}

.page-head h1:focus {
  outline: none;
}

.page-head p {
  margin-top: 4px;
  color: var(--muted);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toolbar-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.segmented {
  display: inline-flex;
  overflow: hidden;
  border: var(--border);
  border-radius: var(--pill);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.segmented button {
  padding: 7px 14px;
  border: 0;
  background: transparent;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.segmented button + button {
  border-left: var(--border);
}

.segmented button[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
}

.result-meta {
  min-height: 1.5em;
  margin-bottom: 14px;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}

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

@media (max-width: 1023px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 639px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Card ---------- */
.card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px;
  border: var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease);
}

.card:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-lg);
}

.card:active {
  transform: translate(1px, 1px);
  box-shadow: var(--shadow-sm);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.card-title {
  font-size: 1.05rem;
}

.card .label {
  margin-top: 8px;
}

.card-summary {
  display: -webkit-box;
  min-height: 2.9em;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.card .chips {
  margin-top: 4px;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
  border-top: var(--border);
  font-size: 0.78rem;
}

.card-matched,
.card-foot-spacer {
  margin-bottom: 12px;
}

.card-roles,
.card-lead {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.card-lead strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Skeleton ---------- */
.skeleton {
  pointer-events: none;
}

.sk {
  border-radius: var(--radius-xs);
  background: var(--surface-alt);
  animation: pulse 1.2s ease-in-out infinite;
}

.sk-title { height: 20px; width: 70%; margin-bottom: 14px; }
.sk-line { height: 12px; width: 100%; margin-top: 8px; }
.sk-line.short { width: 60%; }
.sk-chips { display: flex; gap: 6px; margin-top: 18px; }
.sk-chip { height: 22px; width: 56px; border-radius: var(--pill); }

@keyframes pulse {
  50% { opacity: 0.45; }
}

/* ---------- Empty / error states ---------- */
.state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px 24px;
  border: var(--border);
  border-style: dashed;
  border-radius: var(--radius-lg);
  background: var(--surface);
  text-align: center;
}

.state-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: var(--border);
  border-radius: 14px;
  background: var(--yellow);
  box-shadow: var(--shadow-sm);
}

.state-error .state-icon {
  background: var(--red);
}

.state p {
  max-width: 420px;
  color: var(--muted);
}

.state-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 32px;
  padding-top: 16px;
  border-top: var(--border);
}

.page-info {
  font-size: 0.85rem;
  font-weight: 700;
}

.page-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  list-style: none;
}

.page-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border: var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.page-btn:hover:not([disabled]) {
  background: var(--yellow);
}

.page-btn[aria-current="page"] {
  background: var(--ink);
  color: #fff;
}

.page-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.page-gap {
  padding: 0 4px;
  font-weight: 700;
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  padding: 32px 16px;
  overflow-y: auto;
  background: rgba(17, 17, 17, 0.55);
  animation: fade-in 0.15s ease-out;
}

.modal {
  position: relative;
  width: min(660px, 100%);
  margin: auto;
  padding: 28px;
  border: var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xl);
  animation: pop-in 0.18s var(--ease);
}

.modal:focus {
  outline: none;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
}

.modal-head {
  padding-right: 48px;
  margin-bottom: 18px;
}

.modal-title {
  font-size: 1.4rem;
  margin-bottom: 8px;
}

.modal-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.modal-meta + .modal-meta {
  margin-top: 4px;
}

.modal-meta .sep {
  color: var(--muted);
}

.modal-summary {
  margin-bottom: 18px;
  font-size: 0.95rem;
  font-weight: 500;
}

.modal-section {
  margin-top: 22px;
}

.modal-section > h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.desc-box {
  padding: 14px 16px;
  border: var(--border);
  border-radius: var(--radius);
  font-size: 0.88rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.repo-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  padding: 10px 14px;
  border: var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  font-family: var(--mono);
  font-size: 0.78rem;
}

.repo-stats span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.role-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
}

.role-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 12px;
  padding: 12px 14px;
  border: var(--border);
  border-radius: var(--radius);
}

.role-item.is-filled {
  background: var(--bg);
}

.role-item.is-filled .role-title {
  text-decoration: line-through;
}

.role-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: var(--border);
  border-radius: var(--radius-sm);
  background: var(--yellow-soft);
}

.role-title {
  font-size: 0.92rem;
  font-weight: 700;
}

.role-skills {
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-soft);
}

.role-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.suggest-list {
  grid-column: 2 / -1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 10px;
  border-top: 1.5px dashed var(--ink);
  list-style: none;
}

.suggest-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
  font-size: 0.8rem;
}

.suggest-item .muted {
  font-size: 0.74rem;
}

.owner-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px;
  border: var(--border);
  border-style: dashed;
  border-radius: var(--radius);
  background: var(--yellow-soft);
}

.owner-tools .label {
  width: 100%;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: var(--border);
}

.modal-actions .btn {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.82rem;
}

.modal-loading {
  padding-top: 8px;
}

@keyframes fade-in {
  from { opacity: 0; }
}

@keyframes pop-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
}

@media (max-width: 639px) {
  .modal { padding: 22px 18px; }
  .modal-actions { grid-template-columns: 1fr; }
  .role-item { grid-template-columns: 1fr auto; }
  .role-icon { display: none; }
  .suggest-list { grid-column: 1 / -1; }
}

/* ---------- Skill picker with Searchable Dropdown ---------- */
.picker {
  position: relative;
  width: 100%;
}

.picker-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 6px 12px;
  border: var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}

.picker-box:hover {
  border-color: var(--ink);
  box-shadow: var(--shadow);
}

.picker-box:focus-visible,
.picker-box.is-open {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.picker:has(input[aria-invalid="true"]) .picker-box {
  border-color: var(--danger);
  box-shadow: 2px 2px 0 var(--danger);
}

.picker-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.picker-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--pill);
  border: 1.5px solid var(--ink);
  background: var(--yellow-soft);
  color: var(--ink);
}

.picker-chip button {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.picker-chip button:hover {
  background: var(--ink);
  color: #ffffff;
}

.picker-trigger-wrap {
  flex: 1;
  min-width: 120px;
  display: flex;
  align-items: center;
}

.picker-trigger-placeholder {
  font-size: 0.85rem;
  color: var(--placeholder);
  pointer-events: none;
}

.picker-box-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.picker-count-badge {
  font-size: 0.72rem;
  font-family: var(--mono);
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--pill);
  background: var(--surface-alt);
  color: var(--ink-soft);
  border: 1px solid var(--ink);
}

.picker-toggle-btn {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--ink);
  transition: transform 0.2s ease;
}

.picker-box.is-open .picker-toggle-btn {
  transform: rotate(180deg);
}

/* Floating Dropdown */
.picker-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 60;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: pickerSlideDown 0.15s ease-out;
}

@keyframes pickerSlideDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.picker-dropdown-header {
  padding: 10px;
  background: var(--surface-alt);
  border-bottom: var(--border-thin);
}

.picker-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.picker-search-icon {
  position: absolute;
  left: 10px;
  color: var(--muted);
  pointer-events: none;
  display: grid;
  place-items: center;
}

.picker-search-input {
  width: 100%;
  padding: 8px 30px 8px 32px;
  font-size: 0.85rem;
  font-family: var(--font);
  border: var(--border-thin);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  outline: none;
}

.picker-search-input:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 2px var(--focus);
}

.picker-search-clear {
  position: absolute;
  right: 8px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}

.picker-search-clear:hover {
  background: var(--ink);
  color: #fff;
}

.picker-dropdown-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}

.picker-dropdown-close {
  border: 1.5px solid var(--ink);
  border-radius: var(--pill);
  background: var(--surface);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 10px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.picker-dropdown-close:hover {
  background: var(--ink);
  color: #fff;
}

.picker-options {
  list-style: none;
  margin: 0;
  padding: 8px;
  max-height: 240px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 6px;
}

.picker-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  background: var(--surface);
  transition: background 0.12s ease, border-color 0.12s ease;
}

.picker-option:hover,
.picker-option.is-focused {
  background: var(--surface-alt);
  border-color: var(--ink);
}

.picker-option.is-selected {
  background: var(--yellow-soft);
  border-color: var(--ink);
  font-weight: 700;
}

.picker-option-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.picker-option-checkbox {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  display: grid;
  place-items: center;
  background: var(--surface);
  flex-shrink: 0;
}

.picker-option.is-selected .picker-option-checkbox {
  background: var(--ink);
  color: #fff;
}

.picker-option-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.picker-option-badge {
  font-size: 0.68rem;
  font-family: var(--mono);
  color: var(--muted);
  flex-shrink: 0;
}

.picker-empty {
  grid-column: 1 / -1;
  padding: 24px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
}

.picker-status:empty {
  display: none;
}

.picker-status {
  margin-top: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--danger);
}

/* ---------- Feed page "More skills" dropdown filter ---------- */
.feed-skill-dropdown-wrap {
  position: relative;
  display: inline-block;
}

.feed-skill-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.feed-skill-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 55;
  width: 260px;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 8px;
  animation: pickerSlideDown 0.15s ease-out;
}

.feed-skill-search-input {
  width: 100%;
  padding: 6px 10px;
  font-size: 0.82rem;
  font-family: var(--font);
  border: var(--border-thin);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  color: var(--ink);
  outline: none;
  margin-bottom: 6px;
}

.feed-skill-search-input:focus {
  border-color: var(--focus);
  background: var(--surface);
}

.feed-skill-menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.feed-skill-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: var(--radius-xs);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
}

.feed-skill-menu-item:hover {
  background: var(--surface-alt);
  border-color: var(--ink);
}

.feed-skill-menu-item.is-active {
  background: var(--yellow-soft);
  border-color: var(--ink);
  font-weight: 700;
}

.feed-skill-menu-empty {
  padding: 12px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
}

/* ---------- Forms & pages ---------- */
.form-page {
  max-width: 900px;
  margin-inline: auto;
}

.form-head {
  margin-bottom: 28px;
  text-align: center;
}

.form-head p {
  margin-top: 6px;
  color: var(--muted);
}

.form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

@media (max-width: 639px) {
  .form-row { grid-template-columns: 1fr; }
}

.section-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 6px;
  font-size: 0.95rem;
  font-weight: 700;
}

.section-title::after {
  content: "";
  flex: 1;
  height: 2px;
  background: var(--ink);
}

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

@media (max-width: 639px) {
  .role-builder { grid-template-columns: 1fr; }
}

.add-role {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  border: var(--border);
  border-style: dashed;
  border-radius: var(--radius);
  background: transparent;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.add-role:hover {
  background: var(--surface);
}

.role-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
}

.role-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.role-row-main {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 0.85rem;
}

.role-row-actions {
  display: flex;
  gap: 6px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
}

.panel {
  padding: 28px;
  border: var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-card {
  max-width: 460px;
  margin: 16px auto 0;
}

.auth-card h1 {
  font-size: 1.75rem;
}

.auth-card > p {
  margin: 6px 0 22px;
  color: var(--muted);
}

.auth-switch {
  margin-top: 20px;
  font-size: 0.88rem;
  text-align: center;
}

.auth-switch a {
  font-weight: 700;
}

.demo-hint {
  margin-bottom: 18px;
  padding: 10px 14px;
  border: var(--border);
  border-style: dashed;
  border-radius: var(--radius);
  background: var(--yellow-soft);
  font-family: var(--mono);
  font-size: 0.75rem;
}

.profile-card {
  max-width: 760px;
  margin-inline: auto;
}

.profile-top {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: var(--border);
}

.profile-top h1 {
  font-size: 1.6rem;
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.profile-section p {
  margin: 4px 0 14px;
  color: var(--muted);
  font-size: 0.88rem;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

/* ---------- Toast ---------- */
.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(420px, calc(100% - 32px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 0.88rem;
  font-weight: 600;
  animation: toast-in 0.22s var(--ease);
  word-break: break-word;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.toast p {
  flex: 1;
  padding-top: 1px;
}

.toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-message {
  margin: 0;
  padding-top: 1px;
  line-height: 1.4;
  color: var(--ink);
}

.toast-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
  flex-shrink: 0;
  padding-top: 1px;
}

.toast-success { background: var(--green); }
.toast-error { background: var(--red); }
.toast-info { background: var(--blue); }

.toast-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-family: var(--font);
  font-weight: 700;
  background: var(--surface);
  color: var(--ink);
  border: var(--border-thin);
  border-radius: var(--radius-xs);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: transform 0.1s var(--ease), box-shadow 0.1s var(--ease), background 0.15s ease, color 0.15s ease;
}

.toast-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-sm);
  background: #ffffff;
}

.toast-btn:active {
  transform: translate(1px, 1px);
  box-shadow: 0 0 0 var(--ink);
}

.toast-btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.toast-btn.is-copied {
  background: var(--green);
  border-color: var(--ink);
  color: var(--ink);
}

.toast-close {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1.5px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.toast-close:hover {
  background: var(--ink);
  color: #fff;
}

.toast-close:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.toast-out {
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  transition: opacity 0.16s var(--ease), transform 0.16s var(--ease);
}

.toast-pulse {
  animation: toast-shake 0.3s var(--ease);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-shake {
  0%, 100% { transform: scale(1); }
  30% { transform: scale(1.04) translateY(-2px); }
  60% { transform: scale(0.98) translateY(1px); }
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 18px 0;
  border-top: var(--border);
  font-size: 0.78rem;
  color: var(--muted);
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

/* ---------- Responsive header ---------- */
@media (max-width: 639px) {
  .header-inner { gap: 10px; }
  .brand-text { display: none; }
  .hide-sm { display: none; }
  .search .input { font-size: 0.85rem; }
}
