/**
 * Bug FAB, modal, inbox — compact / manage palette.
 */

.rbbe-bug-fab {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 2147482900;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.85rem;
  border: none;
  border-radius: 999px;
  background: var(--rbbe-ink, #1a2b36);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(26, 43, 54, 0.28);
  transition: transform 0.15s ease, background 0.15s ease;
}

.rbbe-bug-fab svg {
  width: 16px;
  height: 16px;
}

.rbbe-bug-fab:hover {
  background: var(--rbbe-sea-deep, #2c5f6b);
  transform: translateY(-1px);
}

.rbbe-bug-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.75rem;
  border: 1px solid #e2e9ee;
  border-radius: 10px;
  background: #fff;
  color: #1a2b36;
  font-size: 0.8125rem;
  font-weight: 550;
  cursor: pointer;
  line-height: 1.2;
}

.rbbe-bug-btn--primary {
  background: #52a9b8;
  border-color: #52a9b8;
  color: #fff;
}

.rbbe-bug-modal[hidden] {
  display: none !important;
}

.rbbe-bug-modal.is-open,
.rbbe-bug-modal:not([hidden]) {
  display: flex !important;
}

html.rbbe-bug-modal-open {
  overflow: hidden;
}

.rbbe-bug-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
}

.rbbe-bug-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 43, 54, 0.45);
}

.rbbe-bug-modal__panel {
  position: relative;
  width: min(440px, 100%);
  max-height: min(88vh, 640px);
  overflow: auto;
  margin-bottom: 3.5rem;
  padding: 1rem 1.1rem 1.15rem;
  background: var(--rbbe-surface, #fff);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(26, 43, 54, 0.22);
  animation: rbbe-bug-in 0.18s ease;
}

@keyframes rbbe-bug-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.rbbe-bug-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.rbbe-bug-modal__head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
}

.rbbe-bug-modal__x {
  border: none;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--rbbe-muted, #6d7f8c);
}

.rbbe-bug-modal__form label {
  display: block;
  margin-bottom: 0.7rem;
}

.rbbe-bug-modal__form label span {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--rbbe-muted, #6d7f8c);
}

.rbbe-bug-modal__form input,
.rbbe-bug-modal__form textarea,
.rbbe-bug-modal__form select {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--rbbe-line, #e2e9ee);
  border-radius: 8px;
  font: inherit;
}

.rbbe-bug-drop {
  margin: 0.5rem 0 0.75rem;
  padding: 0.85rem;
  border: 1px dashed var(--rbbe-line, #e2e9ee);
  border-radius: 10px;
  background: var(--rbbe-sand, #f4f7f9);
  text-align: center;
}

.rbbe-bug-drop p {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  color: var(--rbbe-muted, #6d7f8c);
}

.rbbe-bug-drop.is-drag {
  border-color: var(--rbbe-sea, #52a9b8);
  background: var(--rbbe-sea-soft, #e9f4f6);
}

.rbbe-bug-preview {
  margin-top: 0.65rem;
}

.rbbe-bug-preview img {
  display: block;
  max-width: 100%;
  max-height: 160px;
  margin: 0 auto 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--rbbe-line, #e2e9ee);
}

.rbbe-bug-modal__meta {
  margin: 0 0 0.75rem;
  font-size: 0.7rem;
  color: var(--rbbe-muted, #6d7f8c);
  word-break: break-all;
}

.rbbe-bug-modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.rbbe-bug-toast {
  margin: 0.75rem 0 0;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  background: var(--rbbe-sea-soft, #e9f4f6);
  color: var(--rbbe-sea-deep, #2c5f6b);
  font-size: 0.8125rem;
}

.rbbe-bugs__table-wrap {
  overflow: auto;
  background: var(--rbbe-surface, #fff);
  border: 1px solid var(--rbbe-line, #e2e9ee);
  border-radius: var(--rbbe-radius-sm, 10px);
}

.rbbe-bugs__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.rbbe-bugs__table th,
.rbbe-bugs__table td {
  padding: 0.55rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--rbbe-line, #e2e9ee);
}

.rbbe-bugs__table th {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--rbbe-muted, #6d7f8c);
  background: var(--rbbe-sand, #f4f7f9);
}

.rbbe-bugs__table a {
  color: var(--rbbe-sea-deep, #2c5f6b);
  text-decoration: none;
  font-weight: 550;
}

.rbbe-bugs__link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--rbbe-sea-deep, #2c5f6b);
  font: inherit;
  font-weight: 550;
  text-align: left;
  cursor: pointer;
}

.rbbe-bugs__link:hover,
.rbbe-bugs__link:focus-visible {
  text-decoration: underline;
}

.rbbe-bugs__comment-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  margin-left: 0.35rem;
  padding: 0 0.32rem;
  border-radius: 999px;
  background: var(--rbbe-sea-soft, #e9f4f6);
  color: var(--rbbe-sea-deep, #2c5f6b);
  font-size: 0.65rem;
  font-weight: 750;
  vertical-align: middle;
}

.rbbe-bugs__comment-count[hidden] {
  display: none;
}

.rbbe-bug-btn--small {
  padding: 0.28rem 0.55rem;
  font-size: 0.75rem;
}

.rbbe-bugs__status {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border: 0;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.6875rem;
  font-weight: 650;
  line-height: 1.35;
  background: var(--rbbe-sand, #f4f7f9);
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.rbbe-bugs__status:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(26, 43, 54, 0.12);
}

.rbbe-bugs__status:focus-visible,
.rbbe-bugs__status[aria-expanded="true"] {
  outline: 2px solid rgba(82, 169, 184, 0.35);
  outline-offset: 2px;
}

.rbbe-bugs__status--open {
  background: #fff4e5;
  color: #9a5b00;
}

.rbbe-bugs__status--in_progress {
  background: var(--rbbe-sea-soft, #e9f4f6);
  color: var(--rbbe-sea-deep, #2c5f6b);
}

.rbbe-bugs__status--resolved,
.rbbe-bugs__status--closed {
  background: #e8f5e9;
  color: #1b5e20;
}

.rbbe-bug-status-picker[hidden] {
  display: none !important;
}

.rbbe-bug-status-picker {
  position: fixed;
  z-index: 2147483050;
  width: 210px;
  box-sizing: border-box;
  padding: 0.45rem;
  border: 1px solid rgba(26, 43, 54, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 45px rgba(26, 43, 54, 0.18), 0 2px 8px rgba(26, 43, 54, 0.08);
  backdrop-filter: blur(12px);
  animation: rbbe-status-picker-in 0.14s ease;
}

@keyframes rbbe-status-picker-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.rbbe-bug-status-picker__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.45rem 0.45rem;
  color: var(--rbbe-ink, #1a2b36);
  font-size: 0.75rem;
  font-weight: 700;
}

.rbbe-bug-status-picker__head small {
  color: var(--rbbe-muted, #6d7f8c);
  font-size: 0.6875rem;
  font-weight: 600;
}

.rbbe-bug-status-picker__options {
  display: grid;
  gap: 0.15rem;
}

.rbbe-bug-status-picker__options button {
  display: grid;
  grid-template-columns: 10px 1fr 16px;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.55rem 0.6rem;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--rbbe-ink, #1a2b36);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.rbbe-bug-status-picker__options button:hover,
.rbbe-bug-status-picker__options button:focus-visible {
  outline: none;
  background: var(--rbbe-sand, #f4f7f9);
}

.rbbe-bug-status-picker__options button.is-current {
  background: var(--rbbe-sea-soft, #e9f4f6);
}

.rbbe-bug-status-picker__options button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.rbbe-bug-status-picker__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9ba9b2;
}

.rbbe-bug-status-picker__dot--open {
  background: #d58a1f;
}

.rbbe-bug-status-picker__dot--in_progress {
  background: #52a9b8;
}

.rbbe-bug-status-picker__dot--resolved {
  background: #4d8fd6;
}

.rbbe-bug-status-picker__dot--closed {
  background: #3c9a55;
}

.rbbe-bug-status-picker__check {
  visibility: hidden;
  color: var(--rbbe-sea-deep, #2c5f6b);
  font-weight: 800;
  text-align: center;
}

.rbbe-bug-status-picker__options button.is-current .rbbe-bug-status-picker__check {
  visibility: visible;
}

.rbbe-bug-status-picker__message {
  margin: 0.35rem 0.35rem 0.1rem;
  color: #a23b3b;
  font-size: 0.7rem;
  line-height: 1.35;
}

.rbbe-bugs__detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.9fr);
  gap: 0.85rem;
}

.rbbe-bugs__card {
  padding: 1rem 1.1rem;
  background: var(--rbbe-surface, #fff);
  border: 1px solid var(--rbbe-line, #e2e9ee);
  border-radius: var(--rbbe-radius-sm, 10px);
}

.rbbe-bugs__card h2 {
  margin: 0 0 0.65rem;
  font-size: 0.8125rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--rbbe-muted, #6d7f8c);
}

.rbbe-bugs__desc {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.55;
  font-size: 0.9375rem;
}

.rbbe-bugs__meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 0.75rem;
  margin: 0;
  font-size: 0.8125rem;
}

.rbbe-bugs__meta dt {
  color: var(--rbbe-muted, #6d7f8c);
}

.rbbe-bugs__meta dd {
  margin: 0;
  word-break: break-word;
}

.rbbe-bugs__ua {
  font-size: 0.7rem;
  color: var(--rbbe-muted, #6d7f8c);
}

.rbbe-bugs__shot img {
  display: block;
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--rbbe-line, #e2e9ee);
}

.rbbe-bugs__status-select {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--rbbe-muted, #6d7f8c);
}

.rbbe-bugs__status-select select {
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--rbbe-line, #e2e9ee);
  font: inherit;
}

.rbbe-bug-edit-modal {
  align-items: center;
}

.rbbe-bug-edit-modal__panel {
  width: min(680px, 100%);
  max-height: min(92vh, 760px);
  margin-bottom: 0;
}

.rbbe-bug-edit-modal__number {
  margin: 0 0 0.15rem;
  color: var(--rbbe-sea-deep, #2c5f6b);
  font-size: 0.75rem;
  font-weight: 700;
}

.rbbe-bug-edit-modal__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0 0.75rem;
}

.rbbe-bug-edit-modal__wide {
  grid-column: 1 / -1;
}

.rbbe-bug-edit-modal__context {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin: 0 0 0.8rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  background: var(--rbbe-sand, #f4f7f9);
  color: var(--rbbe-muted, #6d7f8c);
  font-size: 0.75rem;
}

.rbbe-bug-edit-modal__context p {
  margin: 0;
}

.rbbe-bug-edit-modal__context a {
  color: var(--rbbe-sea-deep, #2c5f6b);
  font-weight: 600;
}

.rbbe-bug-edit-tabs {
  display: flex;
  gap: 0.25rem;
  margin: 0 0 0.9rem;
  padding: 0.25rem;
  border-radius: 10px;
  background: var(--rbbe-sand, #f4f7f9);
}

.rbbe-bug-edit-tabs button {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.25rem;
  padding: 0.4rem 0.7rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--rbbe-muted, #6d7f8c);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.rbbe-bug-edit-tabs button.is-active {
  background: #fff;
  color: var(--rbbe-ink, #1a2b36);
  box-shadow: 0 1px 4px rgba(26, 43, 54, 0.1);
}

.rbbe-bug-edit-tabs button span {
  min-width: 1.15rem;
  padding: 0.08rem 0.3rem;
  border-radius: 999px;
  background: var(--rbbe-sea-soft, #e9f4f6);
  color: var(--rbbe-sea-deep, #2c5f6b);
  font-size: 0.64rem;
}

[data-rbbe-bug-tab-panel][hidden] {
  display: none !important;
}

.rbbe-bug-discussion__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.rbbe-bug-discussion__head h3 {
  margin: 0 0 0.18rem;
  color: var(--rbbe-ink, #1a2b36);
  font-size: 0.92rem;
}

.rbbe-bug-discussion__head p {
  margin: 0;
  color: var(--rbbe-muted, #6d7f8c);
  font-size: 0.72rem;
}

.rbbe-bug-discussion__thread {
  max-height: 290px;
  overflow: auto;
  padding: 0.2rem 0.25rem 0.2rem 0;
  scrollbar-width: thin;
}

.rbbe-bug-discussion__empty {
  margin: 0;
  padding: 1.4rem 0.75rem;
  border: 1px dashed var(--rbbe-line, #e2e9ee);
  border-radius: 10px;
  color: var(--rbbe-muted, #6d7f8c);
  font-size: 0.78rem;
  text-align: center;
}

.rbbe-bug-discussion__empty--error {
  border-color: #f2c7c7;
  background: #fff7f7;
  color: #a23b3b;
}

.rbbe-bug-comment {
  --rbbe-comment-depth: 0;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 0.55rem;
  margin: 0 0 0.55rem calc(var(--rbbe-comment-depth) * 1.25rem);
}

.rbbe-bug-comment__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rbbe-sea, #52a9b8), var(--rbbe-sea-deep, #2c5f6b));
  color: #fff;
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.rbbe-bug-comment__content {
  min-width: 0;
  padding: 0.62rem 0.72rem;
  border: 1px solid var(--rbbe-line, #e2e9ee);
  border-radius: 4px 12px 12px;
  background: #fff;
}

.rbbe-bug-comment--reply .rbbe-bug-comment__content {
  background: var(--rbbe-sand, #f4f7f9);
}

.rbbe-bug-comment__content header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.28rem;
}

.rbbe-bug-comment__content strong {
  color: var(--rbbe-ink, #1a2b36);
  font-size: 0.74rem;
}

.rbbe-bug-comment__content time {
  color: var(--rbbe-muted, #6d7f8c);
  font-size: 0.63rem;
  white-space: nowrap;
}

.rbbe-bug-comment__content p {
  margin: 0;
  color: var(--rbbe-ink, #1a2b36);
  font-size: 0.8rem;
  line-height: 1.48;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.rbbe-bug-comment__reply {
  margin: 0.38rem 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--rbbe-sea-deep, #2c5f6b);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
}

.rbbe-bug-comment-form {
  margin-top: 0.65rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--rbbe-line, #e2e9ee);
}

.rbbe-bug-comment-form textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 76px;
  resize: vertical;
  padding: 0.65rem 0.72rem;
  border: 1px solid var(--rbbe-line, #e2e9ee);
  border-radius: 10px;
  background: #fff;
  color: var(--rbbe-ink, #1a2b36);
  font: inherit;
  font-size: 0.8rem;
  line-height: 1.45;
}

.rbbe-bug-comment-form textarea:focus {
  border-color: var(--rbbe-sea, #52a9b8);
  outline: 3px solid rgba(82, 169, 184, 0.13);
}

.rbbe-bug-comment-form__reply {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
  padding: 0.4rem 0.55rem;
  border-left: 3px solid var(--rbbe-sea, #52a9b8);
  border-radius: 6px;
  background: var(--rbbe-sea-soft, #e9f4f6);
  color: var(--rbbe-sea-deep, #2c5f6b);
  font-size: 0.7rem;
}

.rbbe-bug-comment-form__reply[hidden] {
  display: none;
}

.rbbe-bug-comment-form__reply button {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.rbbe-bug-comment-form__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.rbbe-bug-comment-form__foot > span {
  color: var(--rbbe-muted, #6d7f8c);
  font-size: 0.66rem;
}

.rbbe-bug-dashboard-discussions {
  margin: 0 0 1rem;
  padding: 0.9rem;
  border: 1px solid color-mix(in srgb, var(--rbbe-sea, #52a9b8) 28%, var(--rbbe-line, #e2e9ee));
  border-radius: 14px;
  background:
    radial-gradient(circle at 100% 0, rgba(82, 169, 184, 0.12), transparent 34%),
    #fff;
  box-shadow: 0 8px 24px rgba(26, 43, 54, 0.06);
}

.rbbe-bug-dashboard-discussions__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
}

.rbbe-bug-dashboard-discussions__eyebrow {
  display: block;
  margin-bottom: 0.1rem;
  color: #a45d08;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.rbbe-bug-dashboard-discussions__head h2 {
  margin: 0;
  color: var(--rbbe-ink, #1a2b36);
  font-size: 0.95rem;
}

.rbbe-bug-dashboard-discussions__head > a,
.rbbe-bug-dashboard-quote footer a {
  color: var(--rbbe-sea-deep, #2c5f6b);
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
}

.rbbe-bug-dashboard-discussions__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.rbbe-bug-dashboard-quote {
  min-width: 0;
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--rbbe-line, #e2e9ee);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
}

.rbbe-bug-dashboard-quote__title {
  display: block;
  overflow: hidden;
  color: var(--rbbe-ink, #1a2b36);
  font-size: 0.74rem;
  font-weight: 750;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rbbe-bug-dashboard-quote blockquote {
  margin: 0.4rem 0;
  color: var(--rbbe-body, #344b59);
  font-size: 0.78rem;
  font-style: normal;
  line-height: 1.45;
}

.rbbe-bug-dashboard-quote footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  color: var(--rbbe-muted, #6d7f8c);
  font-size: 0.63rem;
}

.rbbe-bug-dashboard-quote footer span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 800px) {
  .rbbe-bugs__detail-grid {
    grid-template-columns: 1fr;
  }

  .rbbe-bug-fab span {
    display: none;
  }

  .rbbe-bug-fab {
    padding: 0.7rem;
    border-radius: 50%;
  }

  .rbbe-bug-edit-modal__grid {
    grid-template-columns: 1fr;
  }

  .rbbe-bug-edit-modal__wide {
    grid-column: auto;
  }

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

  .rbbe-bug-comment {
    margin-left: calc(min(var(--rbbe-comment-depth), 1) * 0.65rem);
  }
}
