.jr-title {
  margin: 2px 0 0;
  font-size: 1.25rem;
}

.jr-empty h3 {
  margin: 0 0 8px;
}

.jr-stats {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.jr-group-wrap {
  max-height: 290px;
  overflow: auto;
}

.jr-list-head {
  flex-wrap: wrap;
  gap: 8px;
}

.jr-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.jr-filters select,
.jr-filters input {
  padding: 5px 8px;
  font: inherit;
  font-size: var(--text-xs);
}

.jr-row {
  cursor: pointer;
}

.jr-row.is-open > td {
  border-bottom-color: transparent;
}

.jr-detail > td {
  background: color-mix(in srgb, var(--accent) 4%, var(--surface));
}

.jr-detail-body p {
  margin: 0 0 8px;
}

.jr-notes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.jr-notes h4 {
  margin: 0 0 4px;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.jr-notes p {
  white-space: pre-wrap;
}

.jr-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
}

.jr-planned {
  color: var(--muted);
  background: color-mix(in srgb, var(--muted) 14%, var(--surface));
}

.jr-open {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}

.jr-closed {
  color: var(--text);
  background: color-mix(in srgb, var(--text) 8%, var(--surface));
}

.jr-stars {
  margin-left: 6px;
  color: #f59e0b;
  font-size: 10px;
  letter-spacing: -1px;
}

.jr-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 3px;
}

.jr-chip {
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.jr-chip.is-mistake {
  border-color: color-mix(in srgb, var(--negative) 35%, var(--border));
  color: var(--negative);
}

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

.jr-status-toggle {
  display: inline-flex;
  width: fit-content;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.jr-status-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.jr-status-toggle span {
  display: block;
  padding: 5px 14px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.jr-status-toggle input:checked + span {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}

.jr-status-toggle input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.jr-fieldset {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px 12px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.jr-fieldset legend {
  padding: 0 4px;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.jr-fieldset .filter-group {
  min-width: 0;
}

.jr-fieldset input,
.jr-fieldset select,
.jr-fieldset textarea {
  width: 100%;
  box-sizing: border-box;
}

.jr-fieldset textarea {
  font: inherit;
  resize: vertical;
}

.jr-wide {
  grid-column: 1 / -1;
}

.jr-exit {
  display: contents;
}

.jr-form:not([data-status='closed']) .jr-exit,
.jr-form[data-status='planned'] .jr-review {
  display: none;
}

.jr-label {
  display: block;
  margin-bottom: 4px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--muted);
}

.jr-chip-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.jr-pick input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.jr-pick span {
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: var(--text-xs);
  color: var(--muted);
  cursor: pointer;
}

.jr-pick input:checked + span {
  border-color: var(--negative);
  color: var(--negative);
  background: color-mix(in srgb, var(--negative) 8%, var(--surface));
}

.jr-pick input:focus-visible + span {
  outline: 2px solid var(--accent);
}

.jr-calc {
  min-height: 1em;
  margin: 0;
  color: var(--muted);
  font-size: var(--text-xs);
}

.jr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.jr-table th:not(.num),
.jr-table td:not(.num),
.jr-group-table th:not(.num),
.jr-group-table td:not(.num) {
  text-align: left;
}

.jr-table td:nth-child(10) {
  min-width: 140px;
  white-space: normal;
}

.jr-detail > td[colspan] {
  padding: 12px;
  color: var(--text);
  text-align: left;
  white-space: normal;
}

.jr-group-table th,
.jr-group-table td {
  padding-left: 8px;
  padding-right: 8px;
}

.jr-group-table td:first-child {
  white-space: normal;
}

.jr-pick,
.jr-status-toggle label {
  position: relative;
}

.jr-pick input,
.jr-status-toggle input {
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}

.jr-group-table th {
  white-space: normal;
}

.jr-group-table th,
.jr-group-table td {
  padding-left: 6px;
  padding-right: 6px;
}

.jr-grid {
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 1360px) {
  .jr-grid {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  }
}
