/* bounty dashboard: command palette, status dots, unsaved-changes dialog,
   loading skeletons and toasts. Same materials as motion.css: soft gradient
   fills with the smooth --edge border. */

/* ------------------------------------------------------------ topbar button */
.topbar { gap: 12px; }
.cmdk-open {
  margin-left: auto; display: inline-flex; align-items: center; gap: 10px; height: 36px; padding: 0 8px 0 12px;
  border-radius: 11px; font-size: 13px; color: var(--muted); border: 1px solid transparent;
  background: linear-gradient(180deg, #0f1219, #0b0e15) padding-box, var(--edge) border-box;
  transition: color .15s, background .2s;
}
.cmdk-open:hover { color: #e3eafa; background: linear-gradient(180deg, #12161e, #0d1017) padding-box, var(--edge-hi) border-box; }
.cmdk-open i { font-size: 12px; }
.cmdk-open kbd, .cmdk kbd {
  font-family: var(--mono, ui-monospace, monospace); font-size: 10.5px; color: #9ba5bb; padding: 2px 6px; border-radius: 6px;
  background: #141820; box-shadow: inset 0 0 0 1px #1e232e;
}
@media (max-width: 640px) { .cmdk-open span, .cmdk-open kbd { display: none; } .cmdk-open { padding: 0 11px; } }

/* ------------------------------------------------------------ status dots */
.group a .sdot, .cmdk-item .sdot {
  margin-left: auto; width: 6px; height: 6px; border-radius: 99px; flex: none; background: #252b37;
  box-shadow: inset 0 0 0 1px #2e3546; transition: background .3s, box-shadow .3s;
}
.group a .sdot.on, .cmdk-item .sdot.on { background: var(--good); box-shadow: 0 0 8px rgba(74, 222, 128, .6); }

/* ------------------------------------------------------------ command palette */
.cmdk-bg {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: start center; padding: 12vh 16px 16px;
  background: rgba(4, 5, 6, .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: cmdk-fade .18s var(--ease) both;
}
.cmdk-bg.out { animation: cmdk-fade .16s var(--ease) reverse both; }
.cmdk {
  width: min(620px, 100%); border-radius: 18px; overflow: hidden; border: 1px solid transparent;
  background: linear-gradient(180deg, #11141b, #0c0f16) padding-box, var(--edge-hi) border-box;
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, .85);
  animation: cmdk-pop .26s var(--spring, cubic-bezier(.34, 1.4, .64, 1)) both;
}
.cmdk-bg.out .cmdk { animation: cmdk-pop .16s var(--ease) reverse both; }
@keyframes cmdk-fade { from { opacity: 0; } }
@keyframes cmdk-pop { from { opacity: 0; transform: translateY(-8px) scale(.97); } }
.cmdk-top { display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid #191d25; }
.cmdk-top > i { color: #6e7b95; font-size: 14px; }
.cmdk-input { flex: 1; height: 56px; background: transparent; border: 0; outline: 0; color: #eff3fc; font-size: 15.5px; font-family: inherit; }
.cmdk-input::placeholder { color: #4e576a; }
.cmdk-list { max-height: min(420px, 52vh); overflow-y: auto; padding: 6px 8px 8px; }
.cmdk-list::-webkit-scrollbar { width: 8px; }
.cmdk-list::-webkit-scrollbar-thumb { background: #1e232e; border-radius: 99px; }
.cmdk-group { padding: 12px 10px 6px; font-size: 12px; font-weight: 500; color: var(--muted); }
.cmdk-item {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border-radius: 11px;
  text-align: left; color: #cbd4e6; font-size: 14px; border: 1px solid transparent; transition: color .12s;
}
.cmdk-item.on { color: #fff; background: linear-gradient(180deg, #1a1e26, #131720) padding-box, var(--edge-hi) border-box; }
.cmdk-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; font-size: 13px; color: #9eadce; background: linear-gradient(180deg, #151923, #10131a); }
.cmdk-item.on .cmdk-ic { color: #fff; }
.cmdk-gi { width: 30px; height: 30px; border-radius: 9px; font-size: 12px; flex: none; }
.cmdk-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-sub { font-size: 12px; color: #6e7b95; white-space: nowrap; }
.cmdk-item .sdot { margin-left: auto; }
.cmdk-item .sdot + .cmdk-enter { margin-left: 10px; }
.cmdk-enter { margin-left: auto; font-size: 11px; color: #8a96af; opacity: 0; transform: translateX(-4px); transition: opacity .15s, transform .2s var(--ease); }
.cmdk-item.on .cmdk-enter { opacity: 1; transform: none; }
.cmdk-empty { padding: 32px 0; text-align: center; color: #6e7b95; font-size: 13.5px; }
.cmdk-foot { display: flex; gap: 18px; padding: 10px 16px; border-top: 1px solid #151923; font-size: 12px; color: #6e7b95; }
.cmdk-foot span { display: inline-flex; align-items: center; gap: 5px; }
@media (max-width: 640px) { .cmdk-foot { display: none; } .cmdk-bg { padding-top: 8vh; } }

/* ------------------------------------------------------------ unsaved-changes dialog */
.modal-bg {
  position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 16px;
  background: rgba(4, 5, 6, .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: cmdk-fade .18s var(--ease) both;
}
.modal-bg.out { animation: cmdk-fade .18s var(--ease) reverse both; }
.modal {
  width: min(420px, 100%); padding: 26px; border-radius: 20px; text-align: center; border: 1px solid transparent;
  background: linear-gradient(180deg, #11151d, #0c0f16) padding-box, var(--edge-hi) border-box;
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, .85);
  animation: cmdk-pop .3s var(--spring, cubic-bezier(.34, 1.4, .64, 1)) both;
}
.modal-ic { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 14px; border-radius: 14px; font-size: 18px; color: #e3eafa; border: 1px solid transparent; background: linear-gradient(180deg, #1a1e26, #11141b) padding-box, var(--edge-hi) border-box; }
.modal h3 { font-size: 18px; font-weight: 700; }
.modal p { margin-top: 8px; color: var(--muted); line-height: 1.55; font-size: 14px; }
.modal-actions { display: flex; gap: 8px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }
.btn.danger-text:hover { color: #fca5a5; }

/* ------------------------------------------------------------ skeleton */
.skeleton { display: grid; gap: 16px; animation: cmdk-fade .3s var(--ease) both; }
.skel-head { display: flex; align-items: center; gap: 12px; }
.skel {
  display: block; border-radius: 8px;
  background: linear-gradient(90deg, #0f1219 25%, #161a25 50%, #0f1219 75%); background-size: 200% 100%;
  animation: skel-shimmer 1.5s linear infinite;
}
@keyframes skel-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 8px; }
.skel-card { display: grid; gap: 12px; padding: 20px; border-radius: var(--radius); border: 1px solid transparent; background: linear-gradient(180deg, #0d1017, #0b0e13) padding-box, var(--edge) border-box; }
.skel-card.tall { gap: 14px; }
@media (max-width: 760px) { .skel-grid { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ toasts */
.toast { position: relative; overflow: hidden; padding-right: 10px; }
.toast .tmsg { flex: 1; min-width: 0; line-height: 1.45; }
.toast .tx { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; color: #8a96af; flex: none; transition: background .15s, color .15s; }
.toast .tx:hover { background: #1c2028; color: #fff; }
.toast .tx i { color: inherit !important; font-size: 12px; }
.toast .tbar { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; transform-origin: left; animation: tbar var(--life, 4s) linear both; }
.toast.ok .tbar { background: linear-gradient(90deg, rgba(74, 222, 128, .8), rgba(74, 222, 128, .2)); }
.toast.err .tbar { background: linear-gradient(90deg, rgba(248, 113, 113, .8), rgba(248, 113, 113, .2)); }
.toast:hover .tbar { animation-play-state: paused; }
@keyframes tbar { to { transform: scaleX(0); } }
.toast.out { animation: tout .26s var(--ease) both; }
@keyframes tout { to { opacity: 0; transform: translateX(16px) scale(.97); } }

@media (prefers-reduced-motion: reduce) {
  .cmdk-bg, .cmdk, .modal-bg, .modal, .skeleton, .toast.out { animation: none !important; }
  .skel { animation: none; }
}

/* Keyboard focus: a soft ring in place of the browser's orange outline. */
.btn:focus-visible, .cmdk-open:focus-visible, .toast .tx:focus-visible {
  outline: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, .14), 0 0 0 1px rgba(255, 255, 255, .35);
}


/* ============================================================ fake permissions */
.fp-card { padding-bottom: 22px; }
.fp-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.fp-list { display: grid; gap: 8px; }
.fp-role { border-radius: 14px; border: 1px solid transparent; overflow: hidden; background: linear-gradient(180deg, #10131a, #0d1017) padding-box, var(--edge) border-box; animation: rise .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
.fp-role.open { background: linear-gradient(180deg, #11151d, #0e1118) padding-box, var(--edge-hi) border-box; }
.fp-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; }
.fp-dot { width: 10px; height: 10px; border-radius: 99px; flex: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, .04); }
.fp-head b { font-size: 14px; white-space: nowrap; }
.fp-count { font-size: 12px; color: var(--dim); white-space: nowrap; }
.fp-sum { display: flex; gap: 5px; flex-wrap: wrap; flex: 1; justify-content: flex-end; min-width: 0; }
.fp-mini { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: #161a25; color: #cbd4e6; box-shadow: inset 0 0 0 1px #212733; white-space: nowrap; }
.fp-mini.more { color: var(--muted); }
.fp-none { font-size: 12px; color: var(--dim); }
.fp-caret { color: #6e7b95; font-size: 11px; transition: transform .25s var(--ease); }
.fp-role.open .fp-caret { transform: rotate(180deg); }
.fp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; padding: 4px 14px 14px; border-top: 1px solid #161a25; padding-top: 14px; animation: rise .35s var(--ease) both; }
.fp-perm { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 12px; text-align: left; border: 1px solid transparent;
  background: linear-gradient(180deg, #0e1118, #0b0e15) padding-box, var(--edge) border-box; transition: background .2s, transform .2s var(--spring, cubic-bezier(.34, 1.4, .64, 1)); }
.fp-perm:hover:not(:disabled) { background: linear-gradient(180deg, #12161e, #0e1118) padding-box, var(--edge-hi) border-box; transform: translateY(-1px); }
.fp-perm:active:not(:disabled) { transform: scale(.98); }
.fp-perm:disabled { cursor: default; opacity: .75; }
.fp-check { display: grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 7px; font-size: 10px; color: #8a96af; background: #151923; box-shadow: inset 0 0 0 1px #212733; transition: all .2s var(--ease); }
.fp-perm.on .fp-check { color: #080a0e; background: #e3eafa; box-shadow: none; }
.fp-perm.on { background: linear-gradient(180deg, #151923, #10131a) padding-box, var(--edge-hi) border-box; }
.fp-perm.admin.on .fp-check { background: #fca5a5; }
.fp-text b { display: block; font-size: 13px; color: #e3eafa; }
.fp-text small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.35; }
@media (max-width: 640px) { .fp-sum { display: none; } }

.fp-list.quiet .fp-role, .fp-list.still .fp-grid { animation: none; }

/* ---------------------------------------------------------------- tag input (automod) */
.tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; width: 100%; min-height: 42px; padding: 6px 8px; border-radius: 12px; background: #0a0c10; border: 1px solid #1e232e; cursor: text; transition: border-color .15s, box-shadow .15s; }
.tags:focus-within { border-color: #4c5568; box-shadow: 0 0 0 3px rgba(255, 255, 255, .05); }
.tags.bad { animation: tags-shake .35s; border-color: #7a3a3a; }
@keyframes tags-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 8px; background: #141820; border: 1px solid #232935; font-size: 12.5px; color: #e3eafa; animation: tag-in .22s var(--ease, ease) backwards; }
@keyframes tag-in { from { opacity: 0; transform: scale(.85); } }
.tag button { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; color: #8a96af; font-size: 10px; transition: background .15s, color .15s; }
.tag button:hover { background: #212733; color: #fff; }
.tags.secret .tag > span { filter: blur(4px); transition: filter .2s; }
.tags.secret:hover .tag > span, .tags.secret:focus-within .tag > span { filter: none; }
.tags-in { flex: 1; min-width: 160px; height: 28px; background: none; border: 0; outline: 0; color: #e3eafa; font: inherit; font-size: 13px; }
.tags-in::placeholder { color: #4f596d; }
.tags-clear { margin-left: auto; padding: 4px 10px; border-radius: 8px; font-size: 12px; color: #99a3b9; transition: color .15s, background .15s; }
.tags-clear:hover { color: #fff; background: #151923; }

/* ---------------------------------------------------------------- autoresponders */
.ar-grid { display: grid; grid-template-columns: 2fr 1.4fr 1fr; gap: 12px; margin: 14px 0 12px; }
.ar-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ar-field > span { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.ar-vars { margin-top: 10px; }
.ar-vars .chip { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; }
.ar-vars .chip:hover { color: #fff; border-color: #343e54; }
.ar-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.ar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.ar-row .grow span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; }
@media (max-width: 720px) {
  .ar-grid { grid-template-columns: 1fr; }
  .ar-row .badge:not(:last-of-type) { display: none; }
}
