/* ============================================================================
   JumpJump Design System — Components Layer
   See docs/design.md §6 for component spec.
   ============================================================================ */

/* ---------- Button ---------- */
.jj-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border-radius: var(--r-soft);
  font-size: var(--t-md);
  font-weight: var(--fw-semibold);
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: background var(--d-fast) var(--ease),
              color var(--d-fast) var(--ease),
              border-color var(--d-fast) var(--ease),
              transform var(--d-fast) var(--ease);
  border: 1px solid transparent;
  text-decoration: none;
}
.jj-btn--sm  { height: 28px; padding: 0 10px; font-size: var(--t-sm); border-radius: var(--r-sharp); }
.jj-btn--lg  { height: 36px; padding: 0 16px; font-size: var(--t-base); }

.jj-btn--primary {
  background: var(--jj-brand);
  color: var(--jj-paper);
}
.jj-btn--primary:hover { background: var(--jj-brand-hover); color: var(--jj-paper); }
.jj-btn--primary:active { background: var(--jj-brand-active); }

.jj-btn--secondary {
  background: var(--jj-paper);
  color: var(--jj-ink);
  border-color: var(--jj-rule-strong);
}
.jj-btn--secondary:hover { background: var(--jj-surface-2); border-color: var(--jj-ink-3); }

.jj-btn--ghost {
  background: transparent;
  color: var(--jj-ink-2);
}
.jj-btn--ghost:hover { background: var(--jj-surface-2); color: var(--jj-ink); }

.jj-btn--danger {
  background: var(--jj-danger);
  color: var(--jj-paper);
}
.jj-btn--danger:hover { filter: brightness(1.08); color: var(--jj-paper); }

.jj-btn--quiet {
  background: transparent;
  color: var(--jj-ink-3);
  height: 28px;
  padding: 0 8px;
}
.jj-btn--quiet:hover { color: var(--jj-ink); background: var(--jj-surface-2); }

.jj-btn:focus-visible {
  outline: 2px solid var(--jj-focus-ring);
  outline-offset: 2px;
}
.jj-btn[disabled], .jj-btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

.jj-btn--icon {
  width: 32px;
  padding: 0;
}
.jj-btn--icon.jj-btn--sm { width: 28px; }
.jj-btn--icon.jj-btn--lg { width: 36px; }

.jj-btn--block { width: 100%; }

/* ---------- Input / Textarea / Select ---------- */
.jj-input,
.jj-textarea,
.jj-select {
  display: block;
  width: 100%;
  height: 36px;
  padding: 0 12px;
  background: var(--jj-paper);
  border: 1px solid var(--jj-rule-strong);
  border-radius: var(--r-soft);
  color: var(--jj-ink);
  font-size: var(--t-base);
  line-height: 1.4;
  transition: border-color var(--d-fast) var(--ease), box-shadow var(--d-fast) var(--ease);
  appearance: none;
}
.jj-input::placeholder,
.jj-textarea::placeholder { color: var(--jj-ink-4); }
.jj-input:focus,
.jj-textarea:focus,
.jj-select:focus {
  outline: none;
  border-color: var(--jj-brand);
  box-shadow: 0 0 0 3px var(--jj-focus-ring);
}
.jj-input[aria-invalid="true"],
.jj-textarea[aria-invalid="true"] { border-color: var(--jj-danger); }
.jj-textarea {
  height: auto;
  min-height: 96px;
  padding: 10px 12px;
  resize: vertical;
}
.jj-input--sm { height: 28px; padding: 0 8px; font-size: var(--t-md); }
.jj-input--inline {
  border-color: transparent;
  background: transparent;
  padding-left: 4px;
}
.jj-input--inline:hover { border-color: var(--jj-rule); }

.jj-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='1.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

.jj-checkbox {
  appearance: none;
  width: 16px; height: 16px;
  border: 1.5px solid var(--jj-rule-strong);
  border-radius: 3px;
  background: var(--jj-paper);
  cursor: pointer;
  position: relative;
  transition: background var(--d-fast) var(--ease), border-color var(--d-fast) var(--ease);
  flex-shrink: 0;
}
.jj-checkbox:checked {
  background: var(--jj-brand);
  border-color: var(--jj-brand);
}
.jj-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 4px; top: 1px;
  width: 4px; height: 8px;
  border: solid var(--jj-paper);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.jj-checkbox:focus-visible { outline: 2px solid var(--jj-focus-ring); outline-offset: 2px; }

.jj-radio {
  appearance: none;
  width: 16px; height: 16px;
  border: 1.5px solid var(--jj-rule-strong);
  border-radius: var(--r-pill);
  background: var(--jj-paper);
  cursor: pointer;
  position: relative;
  transition: border-color var(--d-fast) var(--ease);
  flex-shrink: 0;
}
.jj-radio:checked { border-color: var(--jj-brand); border-width: 4px; }
.jj-radio:focus-visible { outline: 2px solid var(--jj-focus-ring); outline-offset: 2px; }

/* Field group */
.jj-field { display: flex; flex-direction: column; gap: 6px; }
.jj-label {
  font-size: var(--t-sm);
  font-weight: var(--fw-medium);
  color: var(--jj-ink-2);
}
.jj-helper { font-size: var(--t-sm); color: var(--jj-ink-3); }
.jj-error  {
  font-size: var(--t-sm);
  color: var(--jj-danger);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ---------- Tag / Chip ---------- */
.jj-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: var(--t-xs);
  font-weight: var(--fw-medium);
  border-radius: var(--r-pill);
  border: 1px solid var(--jj-rule-strong);
  background: var(--jj-surface-2);
  color: var(--jj-ink-2);
  line-height: 1.4;
  white-space: nowrap;
}
.jj-tag--clay   { background: color-mix(in oklch, var(--tag-clay) 12%, transparent); border-color: color-mix(in oklch, var(--tag-clay) 30%, transparent); color: var(--tag-clay); }
.jj-tag--moss   { background: color-mix(in oklch, var(--tag-moss) 12%, transparent); border-color: color-mix(in oklch, var(--tag-moss) 30%, transparent); color: var(--tag-moss); }
.jj-tag--slate  { background: color-mix(in oklch, var(--tag-slate) 12%, transparent); border-color: color-mix(in oklch, var(--tag-slate) 30%, transparent); color: var(--tag-slate); }
.jj-tag--citron { background: color-mix(in oklch, var(--tag-citron) 14%, transparent); border-color: color-mix(in oklch, var(--tag-citron) 35%, transparent); color: var(--jj-citron-2); }
.jj-tag--plum   { background: color-mix(in oklch, var(--tag-plum) 12%, transparent); border-color: color-mix(in oklch, var(--tag-plum) 30%, transparent); color: var(--tag-plum); }
.jj-tag--dust   { background: color-mix(in oklch, var(--tag-dust) 14%, transparent); border-color: color-mix(in oklch, var(--tag-dust) 32%, transparent); color: var(--tag-dust); }
.jj-tag--sky    { background: color-mix(in oklch, var(--tag-sky) 12%, transparent); border-color: color-mix(in oklch, var(--tag-sky) 30%, transparent); color: var(--tag-sky); }

/* ---------- Badge / Status pill ---------- */
.jj-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: var(--t-xs);
  font-weight: var(--fw-semibold);
  border-radius: var(--r-pill);
  line-height: 1.4;
  white-space: nowrap;
}
.jj-badge--success  { background: var(--jj-success-soft); color: var(--jj-success); }
.jj-badge--warning  { background: var(--jj-warning-soft); color: var(--jj-citron-2); }
.jj-badge--info     { background: var(--jj-info-soft); color: var(--jj-info); }
.jj-badge--critical { background: var(--jj-danger-soft); color: var(--jj-danger); }
.jj-badge--beta     { background: var(--jj-surface-2); color: var(--jj-ink); font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.05em; border: 1px solid var(--jj-rule); }

.jj-count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: var(--r-pill);
  background: var(--jj-surface-2);
  border: 1px solid var(--jj-rule);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: var(--t-xs);
  color: var(--jj-ink-3);
  font-feature-settings: "tnum";
}

/* ---------- Avatar ---------- */
.jj-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--r-pill);
  font-size: var(--t-xs);
  font-weight: var(--fw-semibold);
  color: var(--jj-paper);
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0;
  user-select: none;
}
.jj-avatar--sm  { width: 20px; height: 20px; font-size: var(--t-xs); }
.jj-avatar--md  { width: 24px; height: 24px; font-size: var(--t-xs); }
.jj-avatar--lg  { width: 32px; height: 32px; font-size: var(--t-sm); }
.jj-avatar--xl  { width: 40px; height: 40px; font-size: var(--t-base); }
.jj-avatar--xxl { width: 96px; height: 96px; font-size: var(--t-3xl); border: 2px solid var(--jj-paper); box-shadow: 0 1px 2px rgba(0,0,0,.06); }

/* Quando tem foto, texto invisível e o fundo vira a imagem */
.jj-avatar--photo {
  color: transparent !important;
  background-color: var(--jj-bone-2);
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

.jj-avatar--clay   { background: var(--tag-clay); }
.jj-avatar--moss   { background: var(--tag-moss); }
.jj-avatar--slate  { background: var(--tag-slate); }
.jj-avatar--citron { background: var(--tag-citron); color: var(--jj-ink); }
.jj-avatar--plum   { background: var(--tag-plum); }
.jj-avatar--dust   { background: var(--tag-dust); color: var(--jj-ink); }
.jj-avatar--sky    { background: var(--tag-sky); }

.jj-avatar-stack { display: inline-flex; }
.jj-avatar-stack > .jj-avatar + .jj-avatar { margin-left: -6px; }
.jj-avatar-stack > .jj-avatar { border: 2px solid var(--jj-paper); }

/* ---------- Card (generic) ---------- */
.jj-surface {
  background: var(--jj-paper);
  border: 1px solid var(--jj-rule);
  border-radius: var(--r-soft);
  padding: var(--sp-4);
}
.jj-surface--raised { background: var(--jj-paper-raised); box-shadow: var(--sh-1); }
.jj-surface--inset  { background: var(--jj-surface-2); border-color: transparent; }

/* ---------- Card de tarefa (kanban) — sem listra lateral ---------- */
.jj-card {
  position: relative;
  background: var(--jj-paper);
  border: 1px solid var(--jj-rule);
  border-radius: var(--r-soft);
  padding: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform var(--d-fast) var(--ease),
              border-color var(--d-fast) var(--ease),
              box-shadow var(--d-fast) var(--ease);
  cursor: grab;
  text-decoration: none;
  color: inherit;
}
.jj-card:hover {
  border-color: var(--jj-rule-strong);
  box-shadow: var(--sh-1);
  text-decoration: none;
  color: inherit;
}
.jj-card[data-dragging="true"],
.jj-card.is-dragging {
  transform: rotate(1.2deg);
  box-shadow: var(--sh-2);
  cursor: grabbing;
}

/* Priority indicator: leading dot inline with title (replaces the
   banned 3px side-stripe). The dot color comes from --prio. */
.jj-card[data-prio="urgent"] { --prio: var(--jj-danger); }
.jj-card[data-prio="high"]   { --prio: var(--jj-brand); }
.jj-card[data-prio="mid"]    { --prio: var(--jj-warning); }
.jj-card[data-prio="low"]    { --prio: var(--jj-ink-4); }

.jj-card__title::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--prio, var(--jj-ink-4));
  margin-right: 8px;
  vertical-align: 2px;
}

.jj-card__id {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: var(--t-xs);
  color: var(--jj-ink-3);
  letter-spacing: 0.04em;
}
.jj-card__title {
  font-size: var(--t-base);
  font-weight: var(--fw-medium);
  color: var(--jj-ink);
  line-height: 1.35;
  margin: 0;
}
.jj-card__desc {
  font-size: var(--t-sm);
  color: var(--jj-ink-3);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}
.jj-card__footer {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: var(--t-xs);
  color: var(--jj-ink-3);
  margin-top: 4px;
}
.jj-card__urgent {
  position: absolute;
  top: 8px; right: 8px;
  color: var(--jj-danger);
}

/* ---------- Coluna do kanban ---------- */
.jj-column {
  width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--jj-rule);
  padding: 0 var(--sp-3);
}
.jj-column:last-child { border-right: none; }
.jj-column__header {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 4px;
}
.jj-column__name {
  font-size: var(--t-base);
  font-weight: var(--fw-semibold);
  color: var(--jj-ink);
  flex: 1;
}
.jj-column__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0;
  min-height: 60px;
}
.jj-column__composer {
  margin-top: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--jj-rule);
}

/* ---------- Tabela ---------- */
.jj-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--t-md);
}
.jj-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 36px;
  padding: 0 var(--sp-3);
  background: var(--jj-surface-2);
  font-size: var(--t-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: var(--ls-uppercase);
  color: var(--jj-ink-3);
  text-align: left;
  border-bottom: 1px solid var(--jj-rule-strong);
  white-space: nowrap;
}
.jj-table tbody tr {
  height: 40px;
  border-bottom: 1px solid var(--jj-rule);
  transition: background var(--d-fast) var(--ease);
}
.jj-table tbody tr:hover { background: var(--jj-surface-2); }
.jj-table tbody td {
  padding: 0 var(--sp-3);
  color: var(--jj-ink-2);
  vertical-align: middle;
}
.jj-table--roomy tbody tr { height: 48px; }
.jj-table .num,
.jj-table .jj-mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-feature-settings: "tnum"; }
.jj-table__actions { width: 1%; text-align: right; white-space: nowrap; }

/* ---------- Modal ---------- */
.jj-modal-backdrop {
  position: fixed;
  inset: 0;
  background: oklch(20% 0.015 248 / 0.45);
  z-index: var(--jj-modal-z);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  animation: jj-fade-in var(--d-base) var(--ease);
}
@keyframes jj-fade-in { from { opacity: 0; } to { opacity: 1; } }

.jj-modal {
  width: 560px;
  max-width: calc(100vw - 32px);
  max-height: 88vh;
  background: var(--jj-paper-raised);
  border-radius: var(--r-soft);
  box-shadow: var(--sh-3);
  border: 1px solid var(--jj-rule);
  display: flex;
  flex-direction: column;
  animation: jj-modal-in var(--d-base) var(--ease);
}
@keyframes jj-modal-in {
  from { opacity: 0; transform: scale(0.98); }
  to   { opacity: 1; transform: scale(1); }
}
.jj-modal--sm { width: 400px; }
.jj-modal--lg { width: 720px; }

.jj-modal__header {
  height: 56px;
  padding: 0 var(--sp-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--jj-rule);
  flex-shrink: 0;
}
.jj-modal__title {
  font-family: 'Inter Tight', system-ui, sans-serif;
  font-weight: var(--fw-semibold);
  font-size: var(--t-xl);
  color: var(--jj-ink);
  margin: 0;
  letter-spacing: -0.01em;
}
.jj-modal__close {
  width: 32px; height: 32px;
  border-radius: var(--r-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--jj-ink-3);
  transition: background var(--d-fast) var(--ease), color var(--d-fast) var(--ease);
}
.jj-modal__close:hover { background: var(--jj-surface-2); color: var(--jj-ink); }
.jj-modal__body {
  padding: var(--sp-4);
  overflow-y: auto;
  flex: 1;
}
.jj-modal__footer {
  min-height: 56px;
  padding: var(--sp-3) var(--sp-4);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-2);
  border-top: 1px solid var(--jj-rule);
  flex-shrink: 0;
}
.jj-modal__footer--split { justify-content: space-between; }

/* ---------- Drawer ---------- */
.jj-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: oklch(20% 0.015 248 / 0.45);
  z-index: var(--jj-modal-z);
  animation: jj-fade-in var(--d-base) var(--ease);
}
.jj-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 400px;
  max-width: 100vw;
  background: var(--jj-paper-raised);
  border-left: 1px solid var(--jj-rule);
  box-shadow: var(--sh-3);
  z-index: calc(var(--jj-modal-z) + 1);
  display: flex;
  flex-direction: column;
  animation: jj-drawer-in var(--d-base) var(--ease);
}
@keyframes jj-drawer-in {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
.jj-drawer__header {
  height: 56px;
  padding: 0 var(--sp-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--jj-rule);
}
.jj-drawer__body { flex: 1; overflow-y: auto; padding: var(--sp-4); }
.jj-drawer__footer { padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--jj-rule); }

/* ---------- Popover ---------- */
.jj-popover {
  width: 280px;
  background: var(--jj-paper-raised);
  border-radius: var(--r-soft);
  border: 1px solid var(--jj-rule);
  box-shadow: var(--sh-2);
  overflow: hidden;
  z-index: var(--jj-popover-z);
  animation: jj-popover-in var(--d-fast) var(--ease);
}
@keyframes jj-popover-in {
  from { opacity: 0; transform: translateY(-2px); }
  to   { opacity: 1; transform: translateY(0); }
}
.jj-popover--lg { width: 360px; }
.jj-popover__search {
  padding: var(--sp-2);
  border-bottom: 1px solid var(--jj-rule);
}
.jj-popover__search .jj-input { height: 32px; }
.jj-popover__list {
  max-height: 280px;
  overflow-y: auto;
  padding: 4px;
  list-style: none;
  margin: 0;
}
.jj-popover__item {
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: var(--t-md);
  color: var(--jj-ink-2);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background var(--d-fast) var(--ease);
}
.jj-popover__item:hover {
  background: var(--jj-surface-2);
  color: var(--jj-ink);
}
.jj-popover__item[aria-selected="true"],
.jj-popover__item.is-selected {
  background: var(--jj-brand-soft);
  color: var(--jj-brand-ink);
  font-weight: var(--fw-medium);
}
.jj-popover__footer {
  padding: var(--sp-2);
  border-top: 1px solid var(--jj-rule);
}
.jj-popover__empty {
  padding: var(--sp-4);
  text-align: center;
  color: var(--jj-ink-3);
  font-size: var(--t-md);
}

/* ---------- Tabs (underline) ---------- */
.jj-tabs {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  border-bottom: 1px solid var(--jj-rule);
}
.jj-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 14px;
  font-size: var(--t-md);
  font-weight: var(--fw-medium);
  color: var(--jj-ink-3);
  border: none;
  background: transparent;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  text-decoration: none;
  transition: color var(--d-fast) var(--ease), border-color var(--d-fast) var(--ease);
}
.jj-tab:hover { color: var(--jj-ink); }
.jj-tab.is-active,
.jj-tab[aria-selected="true"] {
  color: var(--jj-ink);
  border-bottom-color: var(--jj-brand);
}

/* ---------- Toast ---------- */
.jj-toast-region {
  position: fixed;
  bottom: var(--sp-4);
  right: var(--sp-4);
  z-index: var(--jj-toast-z);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  pointer-events: none;
  max-width: 360px;
}
/* Quando o chip "Novidades" está visível no canto inferior direito, sobe os toasts
   para que não fiquem sobrepostos por ele (o chip tem z-index alto). */
body:has(.jj-release-chip.is-in) .jj-toast-region {
  bottom: calc(var(--sp-4) + 48px);
}
.jj-toast {
  pointer-events: auto;
  width: 320px;
  background: var(--jj-ink);
  color: var(--jj-paper);
  border-radius: var(--r-soft);
  padding: var(--sp-3) var(--sp-4) var(--sp-4);
  position: relative;
  overflow: hidden;
  display: flex;
  gap: var(--sp-2);
  align-items: flex-start;
  font-size: var(--t-md);
  animation: jj-toast-in var(--d-base) var(--ease);
  cursor: pointer;
  box-shadow: var(--sh-2);
}
@keyframes jj-toast-in {
  from { transform: translateX(110%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
.jj-toast__icon { color: var(--jj-brand); flex-shrink: 0; margin-top: 1px; }
.jj-toast__body { flex: 1; line-height: 1.4; }
.jj-toast__title { font-weight: var(--fw-semibold); margin-bottom: 2px; color: var(--jj-paper); }
.jj-toast__progress {
  position: absolute;
  left: 0; bottom: 0;
  height: 2px;
  background: var(--jj-brand);
  width: 100%;
  transform-origin: left center;
  animation: jj-toast-progress 5s linear forwards;
}
@keyframes jj-toast-progress { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.jj-toast:hover .jj-toast__progress { animation-play-state: paused; }
.jj-toast__msg { color: var(--jj-paper); }
/* Variantes por tipo: tingem icone + barra de progresso */
.jj-toast--success .jj-toast__icon,
.jj-toast--success .jj-toast__progress { color: var(--jj-success); background: var(--jj-success); }
.jj-toast--success .jj-toast__icon { background: transparent; }
.jj-toast--error .jj-toast__icon,
.jj-toast--error .jj-toast__progress { color: var(--jj-rust); background: var(--jj-rust); }
.jj-toast--error .jj-toast__icon { background: transparent; }
.jj-toast--info .jj-toast__icon,
.jj-toast--info .jj-toast__progress { color: var(--jj-brand); background: var(--jj-brand); }
.jj-toast--info .jj-toast__icon { background: transparent; }
.jj-toast--leaving { animation: jj-toast-out var(--d-base) var(--ease) forwards; }
@keyframes jj-toast-out {
  from { transform: translateX(0); opacity: 1; }
  to   { transform: translateX(110%); opacity: 0; }
}

/* ---------- Activity timeline ---------- */
.jj-timeline { position: relative; padding-left: var(--sp-4); list-style: none; margin: 0; }
.jj-timeline::before {
  content: "";
  position: absolute;
  left: 4px; top: 8px; bottom: 8px;
  width: 1px;
  background: var(--jj-rule-strong);
}
.jj-timeline__item {
  position: relative;
  padding-bottom: var(--sp-4);
  font-size: var(--t-md);
  color: var(--jj-ink-2);
}
.jj-timeline__item::before {
  content: "";
  position: absolute;
  left: -16px; top: 6px;
  width: 9px; height: 9px;
  border-radius: var(--r-pill);
  background: var(--jj-ink-3);
  border: 2px solid var(--jj-surface);
}
.jj-timeline__item--self::before { background: var(--jj-brand); }
.jj-timeline__time { color: var(--jj-ink-3); font-size: var(--t-sm); }
.jj-timeline__quote {
  font-family: 'Inter Tight', system-ui, sans-serif;
  color: var(--jj-ink);
  font-size: var(--t-base);
  margin-top: 4px;
  border-left: 2px solid var(--jj-rule-strong);
  padding-left: var(--sp-3);
}

/* ---------- @ Mention inline ---------- */
.jj-mention,
.rr-mention {
  display: inline-flex;
  align-items: center;
  background: var(--jj-brand-soft);
  color: var(--jj-brand-ink);
  font-weight: var(--fw-medium);
  padding: 1px 4px;
  border-radius: 3px;
  text-decoration: none;
}
.jj-mention--self,
.rr-mention--self {
  background: var(--jj-warning-soft);
  color: var(--jj-citron-2);
}

/* ---------- Empty state ---------- */
.jj-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--sp-7) var(--sp-4);
  max-width: 360px;
  margin: 0 auto;
}
.jj-empty__icon {
  width: 64px;
  height: 64px;
  border-radius: var(--r-soft);
  background: var(--jj-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--jj-ink-3);
  margin-bottom: var(--sp-4);
}
.jj-empty__icon [data-lucide] { width: 32px; height: 32px; }
.jj-empty__title {
  font-family: 'Inter Tight', system-ui, sans-serif;
  font-weight: var(--fw-semibold);
  font-size: var(--t-xl);
  color: var(--jj-ink);
  margin-bottom: var(--sp-2);
  letter-spacing: -0.01em;
}
.jj-empty__body {
  font-size: var(--t-md);
  color: var(--jj-ink-3);
  margin-bottom: var(--sp-4);
  line-height: 1.5;
}

/* ---------- Timer ---------- */
.jj-timer {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
}
.jj-timer__display {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-feature-settings: "tnum";
  font-size: var(--t-xl);
  font-weight: var(--fw-medium);
  color: var(--jj-ink);
  letter-spacing: 0.02em;
}
.jj-timer__btn {
  width: 36px;
  height: 36px;
  border-radius: var(--r-pill);
  background: var(--jj-brand);
  color: var(--jj-paper);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--d-fast) var(--ease);
}
.jj-timer__btn:hover { background: var(--jj-brand-hover); }
.jj-timer__btn:focus-visible { outline: 2px solid var(--jj-focus-ring); outline-offset: 2px; }

/* ---------- Progress bar (slim) ---------- */
.jj-progress {
  height: 4px;
  background: var(--jj-surface-2);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.jj-progress__fill {
  height: 100%;
  background: var(--jj-brand);
  border-radius: var(--r-pill);
  transition: width var(--d-base) var(--ease);
}
.jj-progress__fill--moss { background: var(--jj-success); }
.jj-progress__fill--citron { background: var(--jj-warning); }

/* ---------- Divider ---------- */
.jj-divider { height: 1px; background: var(--jj-rule); border: none; margin: var(--sp-3) 0; }
.jj-divider--strong { background: var(--jj-rule-strong); }
.jj-divider--vertical { width: 1px; height: 100%; background: var(--jj-rule); }

/* ---------- Alert / TempData inline ---------- */
.jj-alert {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-soft);
  font-size: var(--t-md);
  border: 1px solid;
  margin-bottom: var(--sp-3);
}
.jj-alert--success  { background: var(--jj-success-soft); border-color: color-mix(in oklch, var(--jj-success) 30%, transparent); color: var(--jj-success); }
.jj-alert--danger   { background: var(--jj-danger-soft);  border-color: color-mix(in oklch, var(--jj-danger) 30%, transparent);  color: var(--jj-danger); }
.jj-alert--warning  { background: var(--jj-warning-soft); border-color: color-mix(in oklch, var(--jj-warning) 35%, transparent); color: var(--jj-citron-2); }
.jj-alert--info     { background: var(--jj-info-soft);    border-color: color-mix(in oklch, var(--jj-info) 25%, transparent);    color: var(--jj-info); }

/* ---------- Sidebar / Topbar shell ---------- */
.jj-app {
  display: grid;
  grid-template-columns: var(--jj-sidebar-w-collapsed) 1fr;
  grid-template-rows: var(--jj-topbar-h) 1fr;
  grid-template-areas:
    "sidebar topbar"
    "sidebar main";
  min-height: 100vh;
}
[data-sidebar="expanded"] .jj-app { grid-template-columns: var(--jj-sidebar-w-expanded) 1fr; }

.jj-sidebar {
  grid-area: sidebar;
  background: var(--jj-surface-2);
  border-right: 1px solid var(--jj-rule);
  display: flex;
  flex-direction: column;
  padding: var(--sp-2) 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: width var(--d-base) var(--ease);
}
.jj-sidebar__brand {
  width: 32px; height: 32px;
  margin: 0 auto var(--sp-3);
  background: var(--jj-brand);
  color: var(--jj-paper);
  border-radius: var(--r-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter Tight', system-ui, sans-serif;
  font-weight: var(--fw-bold);
  font-size: var(--t-lg);
  letter-spacing: -0.02em;
  text-decoration: none;
  transition: background var(--d-fast) var(--ease);
}
.jj-sidebar__brand:hover { color: var(--jj-paper); background: var(--jj-brand-hover); }

.jj-sidebar__nav { display: flex; flex-direction: column; gap: 2px; padding: 0 var(--sp-2); }
.jj-sidebar__item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  height: 36px;
  padding: 0 var(--sp-2);
  border-radius: var(--r-soft);
  color: var(--jj-ink-2);
  font-size: var(--t-md);
  font-weight: var(--fw-medium);
  text-decoration: none;
  position: relative;
  transition: background var(--d-fast) var(--ease), color var(--d-fast) var(--ease);
  white-space: nowrap;
  overflow: hidden;
}
.jj-sidebar__item [data-lucide] { width: 18px; height: 18px; flex-shrink: 0; }
.jj-sidebar__item:hover { background: var(--jj-surface); color: var(--jj-ink); }
.jj-sidebar__item.is-active {
  background: var(--jj-brand-soft);
  color: var(--jj-brand-ink);
  font-weight: var(--fw-semibold);
}
.jj-sidebar__label { transition: opacity var(--d-fast) var(--ease); }
[data-sidebar="collapsed"] .jj-sidebar__label { opacity: 0; pointer-events: none; }
[data-sidebar="collapsed"] .jj-sidebar__item { justify-content: center; padding: 0; }
[data-sidebar="collapsed"] .jj-sidebar__item .jj-sidebar__label { display: none; }

.jj-sidebar__separator {
  height: 1px;
  background: var(--jj-rule);
  margin: var(--sp-3) var(--sp-3);
}

/* -- Sidebar bottom: user card + collapse --- */
.jj-sidebar__bottom {
  margin-top: auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-2) var(--sp-2) var(--sp-3);
  border-top: 1px solid var(--jj-rule);
}

/* User card */
.jj-sidebar__user-card {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex: 1;
  min-width: 0;
  padding: 6px var(--sp-2);
  border-radius: var(--r-soft);
  border: 1px solid var(--jj-rule);
  background: transparent;
  color: var(--jj-ink-2);
  font-size: var(--t-sm);
  font-weight: var(--fw-medium);
  cursor: pointer;
  transition: background var(--d-fast) var(--ease),
              border-color var(--d-fast) var(--ease),
              color var(--d-fast) var(--ease),
              box-shadow var(--d-fast) var(--ease);
}
.jj-sidebar__user-card:hover {
  background: var(--jj-surface-2);
  border-color: var(--jj-rule-strong);
  color: var(--jj-ink);
  box-shadow: var(--sh-1);
}
.jj-sidebar__user-card:active {
  background: var(--jj-bone-2);
}

/* Coluna de texto dentro do user card */
.jj-sidebar__user-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-align: left;
}

.jj-sidebar__user-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.jj-sidebar__user-meta {
  font-size: var(--t-xs);
  color: var(--jj-ink-4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  transition: color var(--d-fast) var(--ease);
}
.jj-sidebar__user-card:hover .jj-sidebar__user-meta {
  color: var(--jj-ink-3);
}

.jj-sidebar__user-chevron {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--jj-ink-4);
  transition: color var(--d-fast) var(--ease);
}
.jj-sidebar__user-card:hover .jj-sidebar__user-chevron {
  color: var(--jj-ink-3);
}

/* Botao de recolher -- mesmo estilo visual que o user card */
.jj-sidebar__collapse-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: stretch;
  width: 36px;
  border-radius: var(--r-soft);
  border: 1px solid var(--jj-rule);
  background: transparent;
  color: var(--jj-ink-4);
  cursor: pointer;
  transition: background var(--d-fast) var(--ease),
              border-color var(--d-fast) var(--ease),
              color var(--d-fast) var(--ease),
              box-shadow var(--d-fast) var(--ease);
}
.jj-sidebar__collapse-btn:hover {
  background: var(--jj-surface-2);
  border-color: var(--jj-rule-strong);
  color: var(--jj-ink-2);
  box-shadow: var(--sh-1);
}
.jj-sidebar__collapse-btn [data-lucide] {
  width: 16px;
  height: 16px;
}

/* -- Collapsed sidebar: bottom adaptations --- */
[data-sidebar="collapsed"] .jj-sidebar__bottom {
  flex-direction: column;
  align-items: center;
  padding: var(--sp-2) 0 var(--sp-3);
  gap: var(--sp-1);
}
[data-sidebar="collapsed"] .jj-sidebar__user-card {
  flex: 0 0 auto;
  justify-content: center;
  padding: var(--sp-2);
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}
[data-sidebar="collapsed"] .jj-sidebar__user-card:hover {
  background: var(--jj-surface-2);
  border-color: var(--jj-rule);
}
[data-sidebar="collapsed"] .jj-sidebar__user-info,
[data-sidebar="collapsed"] .jj-sidebar__user-chevron {
  display: none;
}
[data-sidebar="collapsed"] .jj-sidebar__collapse-btn {
  align-self: center;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}
[data-sidebar="collapsed"] .jj-sidebar__collapse-btn:hover {
  background: var(--jj-surface-2);
  border-color: var(--jj-rule);
}

.jj-topbar {
  grid-area: topbar;
  height: var(--jj-topbar-h);
  background: var(--jj-paper);
  border-bottom: 1px solid var(--jj-rule);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 0 var(--sp-4);
  position: sticky;
  top: 0;
  z-index: 10;
}
.jj-topbar__breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--t-md);
  color: var(--jj-ink-3);
  flex: 1;
  min-width: 0;
}
.jj-topbar__breadcrumb a {
  color: var(--jj-ink-3);
  text-decoration: none;
  transition: color var(--d-fast) var(--ease);
}
.jj-topbar__breadcrumb a:hover { color: var(--jj-ink); }
.jj-topbar__breadcrumb .current { color: var(--jj-ink); font-weight: var(--fw-medium); }
.jj-topbar__sep { color: var(--jj-ink-4); }
.jj-topbar__actions { display: flex; align-items: center; gap: var(--sp-2); }

.jj-quick-activity {
  position: relative;
}

.jj-quick-activity__trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  height: 32px;
  padding: 0 var(--sp-3);
  border-radius: var(--r-soft);
  border: 1px solid var(--jj-rule);
  background: var(--jj-paper);
  color: var(--jj-ink-2);
  font-size: var(--t-md);
  font-weight: var(--fw-medium);
}

.jj-quick-activity__trigger:hover {
  background: var(--jj-surface);
  border-color: var(--jj-rule-strong);
}

.jj-quick-activity__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  width: min(420px, calc(100vw - 24px));
  max-height: 320px;
  overflow-y: auto;
  background: var(--jj-paper-raised);
  border: 1px solid var(--jj-rule);
  border-radius: var(--r-soft);
  box-shadow: var(--sh-3);
  padding: 6px;
  z-index: var(--jj-popover-z);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity var(--d-fast) var(--ease), transform var(--d-fast) var(--ease), visibility var(--d-fast) var(--ease);
}

.jj-quick-activity:hover .jj-quick-activity__menu,
.jj-quick-activity:focus-within .jj-quick-activity__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.jj-quick-activity__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--jj-ink-2);
}

.jj-quick-activity__item:hover {
  background: var(--jj-surface-2);
  color: var(--jj-ink);
}

.jj-quick-activity__meta {
  font-size: var(--t-xs);
  color: var(--jj-ink-3);
}

.jj-quick-activity__text {
  font-size: var(--t-md);
  line-height: 1.35;
  color: var(--jj-ink-2);
}

.jj-quick-activity__task {
  font-size: var(--t-sm);
  color: var(--jj-brand-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Quick notifications (header, same pattern as quick-activity) ---------- */
.jj-quick-notifications__menu {
  width: 380px;
  max-height: min(480px, calc(100vh - 80px));
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Badge posicionado no canto do ícone de sino (trigger do header) */
#jj-notifications-trigger .rr-notif-badge {
  top: -6px;
  right: -8px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  font-size: var(--t-xs);
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--jj-paper);
}

.jj-quick-notifications__menu .rr-notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3);
  border-bottom: 1px solid var(--jj-rule);
}

.jj-quick-notifications__menu .rr-notif-panel-header h3 {
  font-family: 'Inter Tight', system-ui, sans-serif;
  font-style: normal;
  font-weight: var(--fw-medium);
  font-size: var(--t-lg);
  color: var(--jj-ink);
  margin: 0;
}

.jj-quick-notifications__menu .rr-notif-panel-header button {
  background: transparent;
  border: none;
  color: var(--jj-persimmon);
  font-size: var(--t-sm);
  cursor: pointer;
}

.jj-quick-notifications__menu .rr-notif-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px;
}

.jj-quick-notifications__menu .rr-notif-item {
  display: block;
  padding: var(--sp-2) var(--sp-3);
  border-radius: 4px;
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: background var(--d-fast) var(--ease);
}

.jj-quick-notifications__menu .rr-notif-item:hover { background: var(--jj-bone-2); }
.jj-quick-notifications__menu .rr-notif-item.is-unread { border-left-color: var(--jj-persimmon); background: var(--jj-persimmon-wash); }
.jj-quick-notifications__menu .rr-notif-title { font-size: var(--t-md); font-weight: var(--fw-semibold); color: var(--jj-ink); margin: 0 0 2px; }
.jj-quick-notifications__menu .rr-notif-message { font-size: var(--t-sm); color: var(--jj-ink-2); margin: 0 0 2px; line-height: 1.4; }
.jj-quick-notifications__menu .rr-notif-preview {
  font-family: 'Inter Tight', system-ui, sans-serif;
  font-style: normal;
  font-size: var(--t-sm);
  color: var(--jj-ink-3);
  margin: 4px 0;
}
.jj-quick-notifications__menu .rr-notif-meta { font-size: var(--t-xs); color: var(--jj-ink-3); margin: 2px 0 0; }
.jj-quick-notifications__menu .rr-notif-empty { padding: var(--sp-5); text-align: center; color: var(--jj-ink-3); font-size: var(--t-md); }

.jj-quick-activity__empty {
  padding: var(--sp-3);
  text-align: center;
  color: var(--jj-ink-3);
  font-size: var(--t-md);
}

.jj-search-trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  height: 32px;
  padding: 0 var(--sp-3);
  background: var(--jj-surface-2);
  border: 1px solid var(--jj-rule);
  border-radius: var(--r-soft);
  color: var(--jj-ink-3);
  font-size: var(--t-md);
  cursor: pointer;
  min-width: 220px;
  transition: border-color var(--d-fast) var(--ease), background var(--d-fast) var(--ease);
}
.jj-search-trigger:hover { border-color: var(--jj-rule-strong); background: var(--jj-surface); }
.jj-search-trigger__kbd {
  margin-left: auto;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: var(--t-xs);
  color: var(--jj-ink-3);
  background: var(--jj-paper);
  border: 1px solid var(--jj-rule);
  border-radius: 3px;
  padding: 1px 5px;
}

@media (max-width: 768px) {
  .jj-quick-activity__trigger span {
    display: none;
  }

  .jj-quick-activity__trigger {
    padding: 0 var(--sp-2);
  }

  .jj-quick-activity__menu {
    right: -44px;
  }
}

.jj-app__main {
  grid-area: main;
  background: var(--jj-surface);
  min-width: 0;
  min-height: 0;
}

/* ── Real-time refresh banner ───────────────────────────────────────────── */
.jj-rt-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  margin-bottom: 8px;
  background: var(--jj-brand, #4f46e5);
  color: #fff;
  border-radius: 6px;
  font-size: var(--t-base);
  animation: jj-rt-slide-in 0.2s ease;
}
@keyframes jj-rt-slide-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.jj-rt-banner-text {
  flex: 1;
}
.jj-rt-banner-btn {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  border-radius: 4px;
  padding: 2px 10px;
  font-size: var(--t-md);
  cursor: pointer;
  white-space: nowrap;
}
.jj-rt-banner-btn:hover {
  background: rgba(255,255,255,0.32);
}
.jj-rt-banner-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.8);
  font-size: var(--t-lg);
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
}
.jj-rt-banner-close:hover {
  color: #fff;
}

/* Highlight newly injected comments */
.jj-realtime-comment {
  animation: jj-rt-highlight 1.2s ease;
}
@keyframes jj-rt-highlight {
  0%   { background: rgba(79,70,229,0.12); }
  100% { background: transparent; }
}

/* Pisca o cartão quando alguém atualiza/move em outro browser */
.jj-rt-flash {
  animation: jj-rt-flash-anim 1.2s ease;
}
@keyframes jj-rt-flash-anim {
  0%   { box-shadow: 0 0 0 2px rgba(79,70,229,0.55); }
  100% { box-shadow: 0 0 0 0 rgba(79,70,229,0); }
}

/* Toast discreto pra eventos não-críticos (anexo recebido, email novo) */
.jj-rt-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  background: rgba(17,24,39,0.94);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: var(--t-base);
  box-shadow: 0 6px 24px rgba(0,0,0,0.25);
  animation: jj-rt-toast-in 0.2s ease;
  opacity: 1;
  transition: opacity 400ms ease;
}
.jj-rt-toast-fade { opacity: 0; }
@keyframes jj-rt-toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Cmd-K overlay ---------- */
.jj-cmdk-backdrop {
  position: fixed; inset: 0;
  background: oklch(20% 0.015 248 / 0.55);
  z-index: var(--jj-cmdk-z);
  display: flex;
  justify-content: center;
  padding-top: 12vh;
  padding-left: var(--sp-4); padding-right: var(--sp-4);
  animation: jj-fade-in var(--d-base) var(--ease);
}
.jj-cmdk {
  width: 640px;
  max-width: 100%;
  background: var(--jj-paper-raised);
  border-radius: var(--r-soft);
  box-shadow: var(--sh-3);
  border: 1px solid var(--jj-rule);
  display: flex;
  flex-direction: column;
  max-height: 70vh;
  overflow: hidden;
}
.jj-cmdk__input {
  height: 56px;
  padding: 0 var(--sp-4);
  border: none;
  border-bottom: 1px solid var(--jj-rule);
  background: transparent;
  font-size: var(--t-xl);
  color: var(--jj-ink);
  width: 100%;
}
.jj-cmdk__input:focus { outline: none; }
.jj-cmdk__results { flex: 1; overflow-y: auto; padding: var(--sp-2) 0; }
.jj-cmdk__group-label {
  padding: var(--sp-2) var(--sp-4) 4px;
  font-size: var(--t-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: var(--ls-uppercase);
  color: var(--jj-ink-3);
}
.jj-cmdk__item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 8px var(--sp-4);
  font-size: var(--t-md);
  color: var(--jj-ink-2);
  cursor: pointer;
  transition: background var(--d-fast) var(--ease);
}
.jj-cmdk__item:hover,
.jj-cmdk__item[aria-selected="true"] {
  background: var(--jj-brand-soft);
  color: var(--jj-brand-ink);
}
.jj-cmdk__item-meta {
  margin-left: auto;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: var(--t-xs);
  color: var(--jj-ink-3);
}
.jj-cmdk__footer {
  padding: var(--sp-2) var(--sp-4);
  border-top: 1px solid var(--jj-rule);
  display: flex;
  gap: var(--sp-4);
  font-size: var(--t-xs);
  color: var(--jj-ink-3);
}
.jj-cmdk__footer kbd {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: var(--t-xs);
  background: var(--jj-surface-2);
  border: 1px solid var(--jj-rule);
  border-radius: 3px;
  padding: 1px 5px;
}

/* ---------- Release notes chip + dialog ----------
   "Novidades" — chip discreto no canto inferior direito (acima do badge de
   versão). X dispensa, clique no corpo abre o dialog completo. Tom:
   profissional, contido. Sem accent stripes, sem gradients. */

.jj-release-chip {
  position: fixed;
  right: 12px;
  bottom: 22px;
  z-index: 9998;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 6px 0 12px;
  background: var(--jj-paper-raised);
  border: 1px solid var(--jj-rule);
  border-radius: var(--r-pill);
  box-shadow: var(--sh-2);
  color: var(--jj-ink-2);
  font-size: var(--t-sm);
  font-weight: var(--fw-medium);
  letter-spacing: 0.005em;
  cursor: pointer;
  user-select: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 220ms var(--ease),
              transform 220ms var(--ease),
              border-color var(--d-fast) var(--ease),
              background var(--d-fast) var(--ease);
}
.jj-release-chip[hidden] { display: none; }
.jj-release-chip.is-in {
  opacity: 1;
  transform: translateY(0);
}
.jj-release-chip:hover {
  border-color: var(--jj-rule-strong);
  background: var(--jj-paper);
}
.jj-release-chip:focus-visible {
  outline: 2px solid var(--jj-focus-ring);
  outline-offset: 2px;
}
.jj-release-chip__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--jj-brand);
  box-shadow: 0 0 0 3px var(--jj-brand-soft);
  animation: jj-release-pulse 2.4s var(--ease) infinite;
  flex-shrink: 0;
}
.jj-release-chip__label {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  color: var(--jj-ink);
}
.jj-release-chip__version,
.jj-release-chip__count {
  font-size: var(--t-xs);
  color: var(--jj-ink-3);
  letter-spacing: 0.01em;
}
.jj-release-chip__count:empty { display: none; }
.jj-release-chip__count:not(:empty)::before {
  content: '·';
  margin-right: 6px;
  color: var(--jj-ink-4);
}
.jj-release-chip__close {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--jj-ink-3);
  transition: background var(--d-fast) var(--ease), color var(--d-fast) var(--ease);
  cursor: pointer;
}
.jj-release-chip__close:hover {
  background: var(--jj-surface-2);
  color: var(--jj-ink);
}
.jj-release-chip__close:focus-visible {
  outline: 2px solid var(--jj-focus-ring);
  outline-offset: 1px;
}

@media (max-width: 520px) {
  .jj-release-chip {
    right: 8px;
    bottom: 18px;
    height: 30px;
    padding: 0 4px 0 10px;
    font-size: var(--t-xs);
  }
}

/* ---------- Release notes dialog ----------
   "Novidades" — popup completo, aberto via clique no chip. Tom:
   profissional, contido. Sem cards aninhados, sem gradient,
   sem accent stripes. Apenas hierarquia tipográfica + um chip de marca. */
.jj-release {
  position: fixed;
  inset: 0;
  z-index: calc(var(--jj-modal-z) + 5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-5);
}
.jj-release[hidden] { display: none; }

.jj-release__backdrop {
  position: absolute;
  inset: 0;
  background: oklch(20% 0.015 248 / 0.42);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: jj-release-fade var(--d-base) var(--ease);
}
@keyframes jj-release-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.jj-release__card {
  position: relative;
  width: 460px;
  max-width: 100%;
  max-height: calc(100vh - 2 * var(--sp-5));
  background: var(--jj-paper-raised);
  border: 1px solid var(--jj-rule);
  border-radius: 10px;
  box-shadow: var(--sh-3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: jj-release-in 320ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes jj-release-in {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.jj-release__head {
  padding: 22px 24px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.jj-release__kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 4px 10px 4px 8px;
  background: var(--jj-brand-soft);
  color: var(--jj-brand-ink);
  border-radius: var(--r-pill);
  font-size: var(--t-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.jj-release__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--jj-brand);
  box-shadow: 0 0 0 3px var(--jj-brand-soft);
  animation: jj-release-pulse 2.4s var(--ease) infinite;
}
@keyframes jj-release-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.45; }
}
.jj-release__sep {
  opacity: 0.5;
  margin: 0 2px;
}
.jj-release__version {
  font-size: var(--t-xs);
  letter-spacing: 0.02em;
  text-transform: none;
}
.jj-release__title {
  margin: 0;
  font-family: 'Inter Tight', system-ui, sans-serif;
  font-size: var(--t-2xl);
  font-weight: var(--fw-semibold);
  line-height: 1.25;
  letter-spacing: -0.012em;
  color: var(--jj-ink);
}
.jj-release__subtitle {
  margin: 0;
  font-size: var(--t-sm);
  color: var(--jj-ink-3);
}
.jj-release__subtitle:empty { display: none; }

.jj-release__body {
  padding: 4px 24px 8px;
  overflow-y: auto;
  font-size: var(--t-base);
  line-height: 1.6;
  color: var(--jj-ink-2);
  max-width: 65ch;
}

.jj-release__section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 0 16px;
}
.jj-release__section:first-child { padding-top: 4px; }
.jj-release__section + .jj-release__section {
  border-top: 1px solid var(--jj-rule);
}
.jj-release__section-version {
  font-size: var(--t-xs);
  color: var(--jj-ink-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.jj-release__section-title {
  margin: 0;
  font-family: 'Inter Tight', system-ui, sans-serif;
  font-size: var(--t-lg);
  font-weight: var(--fw-semibold);
  line-height: 1.3;
  color: var(--jj-ink);
}
.jj-release__section-body {
  font-size: var(--t-base);
  line-height: 1.6;
  color: var(--jj-ink-2);
  white-space: pre-wrap;
  word-wrap: break-word;
}

.jj-release__foot {
  padding: 16px 24px 20px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--sp-2);
}

/* Reduzir motion para usuários sensíveis já é tratado em jj-system.css §10. */

@media (max-width: 520px) {
  .jj-release { padding: var(--sp-3); align-items: flex-end; }
  .jj-release__card {
    width: 100%;
    border-radius: 12px 12px 8px 8px;
    animation: jj-release-in-mobile 320ms cubic-bezier(0.16, 1, 0.3, 1);
  }
  @keyframes jj-release-in-mobile {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .jj-release__head { padding: 20px 20px 12px; }
  .jj-release__body { padding: 4px 20px 8px; }
  .jj-release__foot { padding: 14px 20px 18px; }
  .jj-release__title { font-size: var(--t-xl); }
}

/* ---------- Profile (Sua identidade) ---------- */
.jj-profile {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}
.jj-profile__head h1 {
  font-size: var(--t-2xl);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  color: var(--jj-ink);
}
.jj-profile__head p {
  margin: 0 0 28px;
  color: var(--jj-ink-3);
  font-size: var(--t-base);
  line-height: 1.5;
}
.jj-profile__grid {
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 720px) {
  .jj-profile__grid { grid-template-columns: 1fr; }
}
.jj-profile__card {
  background: var(--jj-paper);
  border: 1px solid var(--jj-rule);
  border-radius: 10px;
  padding: 24px;
}
.jj-profile__section-title {
  font-size: var(--t-md);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--jj-ink-3);
  margin: 0 0 14px;
}
.jj-profile__avatar-card { text-align: center; }
.jj-profile__preview {
  display: flex;
  justify-content: center;
  margin: 4px 0 18px;
}
.jj-profile__buttons {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}
.jj-profile__buttons label.btn { cursor: pointer; margin: 0; }
.jj-profile__hint {
  margin: 0 0 18px;
  color: var(--jj-ink-3);
  font-size: var(--t-sm);
}
.jj-profile__hint-inline { color: var(--jj-ink-3); font-weight: 400; }
.jj-profile__color { text-align: left; }
.jj-profile__label {
  display: block;
  font-size: var(--t-md);
  font-weight: 500;
  color: var(--jj-ink-2);
  margin-bottom: 8px;
}
.jj-profile__swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.jj-profile__swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
  transition: transform 120ms ease-out, box-shadow 120ms ease-out;
  position: relative;
}
.jj-profile__swatch:hover { transform: scale(1.08); }
.jj-profile__swatch.is-selected {
  border-color: var(--jj-ink);
  box-shadow: 0 0 0 2px var(--jj-paper) inset;
}
.jj-profile__swatch--custom {
  background: linear-gradient(45deg, #ff0080, #ffd900, #00c0ff, #8000ff);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: var(--t-lg);
  overflow: hidden;
}
.jj-profile__swatch--custom input[type="color"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  border: 0;
  padding: 0;
}
.jj-profile__feedback {
  margin-top: 14px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: var(--t-md);
}
.jj-profile__feedback.is-ok {
  background: oklch(0.96 0.04 145);
  color: oklch(0.32 0.08 145);
}
.jj-profile__feedback.is-error {
  background: oklch(0.95 0.06 25);
  color: oklch(0.38 0.13 25);
}

.jj-profile__form { display: grid; gap: 14px; }
.jj-profile__field { display: grid; gap: 6px; }
.jj-profile__field label {
  font-size: var(--t-md);
  font-weight: 500;
  color: var(--jj-ink-2);
}
.jj-profile__field input {
  height: 38px;
  padding: 0 12px;
  font-size: var(--t-base);
  border: 1px solid var(--jj-rule);
  border-radius: 6px;
  background: var(--jj-paper);
  color: var(--jj-ink);
  transition: border-color 120ms ease-out;
}
.jj-profile__field input:focus {
  outline: none;
  border-color: var(--jj-accent, #4f46e5);
  box-shadow: 0 0 0 3px oklch(0.85 0.04 270 / 0.4);
}
.jj-profile__field input:disabled {
  background: var(--jj-bone-2);
  color: var(--jj-ink-3);
  cursor: not-allowed;
}
.jj-profile__form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

/* ---------- Modal genérico (câmera / crop) ---------- */
.jj-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: jj-modal-fade 160ms ease-out;
}
@keyframes jj-modal-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.jj-modal {
  background: var(--jj-paper);
  border-radius: 10px;
  width: 100%;
  max-width: 540px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
.jj-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--jj-rule);
}
.jj-modal__head h2 {
  margin: 0;
  font-size: var(--t-lg);
  font-weight: 600;
  color: var(--jj-ink);
}
.jj-modal__close {
  background: transparent;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  font-size: var(--t-2xl);
  line-height: 1;
  color: var(--jj-ink-3);
  cursor: pointer;
  transition: background 120ms ease-out;
}
.jj-modal__close:hover { background: var(--jj-bone-2); color: var(--jj-ink); }
.jj-modal__body {
  padding: 16px 20px;
  overflow: auto;
}
.jj-modal__hint {
  margin: 0 0 12px;
  font-size: var(--t-md);
  color: var(--jj-ink-3);
}
.jj-modal__foot {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--jj-rule);
}

/* ---------- Câmera ao vivo ---------- */
.jj-camera {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}
.jj-camera video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Espelha para o usuário ver-se como num espelho — capturado é desespelhado no canvas */
  transform: scaleX(-1);
}
.jj-camera__guide {
  position: absolute;
  inset: 12%;
  border: 2px dashed rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  pointer-events: none;
}

/* ---------- Cropper ---------- */
.jj-cropper {
  position: relative;
  background: #111;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  max-height: 60vh;
  user-select: none;
}
.jj-cropper img {
  display: block;
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
  pointer-events: none;
}
.jj-cropper__overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.jj-cropper__hole {
  position: absolute;
  border: 2px solid #fff;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
  border-radius: 50%;
  cursor: move;
  pointer-events: auto;
  /* "Furo" perfeito sobre a imagem, com sombra ao redor */
}
.jj-cropper__handle {
  position: absolute;
  width: 18px;
  height: 18px;
  right: -10px;
  bottom: -10px;
  background: #fff;
  border-radius: 50%;
  cursor: nwse-resize;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* ---------- Font scale control (acessibilidade — tamanho do texto) ---------- */
.jj-profile__fontscale-card { margin-top: var(--sp-4); }

.jj-fontscale {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin: var(--sp-3) 0 var(--sp-2);
}
.jj-fontscale__range {
  flex: 1 1 auto;
  min-width: 0;
  height: 24px;
  accent-color: var(--jj-brand);
  cursor: pointer;
}
.jj-fontscale__mark {
  flex: 0 0 auto;
  color: var(--jj-ink-3);
  font-weight: var(--fw-semibold);
  line-height: 1;
  font-size: var(--t-sm);
}
.jj-fontscale__mark--lg { font-size: var(--t-2xl); }
.jj-fontscale__value {
  flex: 0 0 auto;
  min-width: 2.5ch;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: var(--fw-semibold);
  color: var(--jj-ink);
  background: var(--jj-surface-2);
  border-radius: var(--r-soft);
  padding: 2px var(--sp-2);
  font-size: var(--t-sm);
}
.jj-fontscale__sample {
  margin: var(--sp-2) 0 var(--sp-3);
  padding: var(--sp-3);
  border: 1px solid var(--jj-rule);
  border-radius: var(--r-soft);
  background: var(--jj-paper);
  color: var(--jj-ink);
}
