/* Jira Reporting — sits inside .recon so it inherits the reconciliation
 * surface (soft panels, hue-as-state via .is-good/.is-warn/.is-bad on .glass).
 * Only what that sheet doesn't already cover lives here. */

.jira .recon-group,
.jira-notice {
  margin-bottom: var(--gap);
}

.jira [x-cloak] { display: none; }

.jira-muted {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.jira .recon-group__head .jira-muted { margin-left: auto; }

.jira-empty {
  margin: 0;
  padding: 0.9rem 0.75rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.jira-notice {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.9rem 1.25rem;
  font-size: 0.84rem;
}

.jira-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.jira-actions form,
.jira-report-row__actions form { margin: 0; }

/* --- Generate / schedule forms ------------------------------------------- */

.jira-generate {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  padding: 0.35rem 1.25rem 1rem;
}

.jira-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.jira-field > select,
.jira-field > input,
.jira-schedule__controls input[type="time"] {
  min-width: 9rem;
  padding: 0.42rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
}

.jira-field > select,
.jira-field > input {
  box-sizing: border-box;
  width: 11rem;
  height: 2.2rem;
}

.jira-field > select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23808080' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  padding-right: 1.75rem;
}

.jira-field > select:focus,
.jira-field > input:focus {
  outline: none;
  border-color: var(--accent);
}

.jira-field input[name="project"] {
  text-transform: uppercase;
}

.jira-generate .btn {
  height: 2.2rem;
}

.jira-generate__hint {
  flex-basis: 100%;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.jira-schedule-add {
  margin-top: 0.5rem;
  border-top: 1px solid var(--panel-border);
  padding-top: 1rem;
}

.jira-message {
  margin: 0.25rem 0.75rem 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  background: color-mix(in srgb, var(--text) 5%, transparent);
}

.jira-message.is-good { background: var(--good-soft); color: var(--good); }
.jira-message.is-warn { background: var(--warn-soft); color: var(--warn); }
.jira-message.is-bad { background: var(--bad-soft); color: var(--bad); }

/* --- Report / schedule rows --------------------------------------------- */

/* Five rows, then the list scrolls. Rows share one fixed minimum height so
 * "five" is a height, not a guess; a row whose text wraps just runs taller. */
.jira { --jira-row-h: 3.6rem; }

.jira-report-list {
  max-height: calc(5 * var(--jira-row-h));
  overflow-y: auto;
  overscroll-behavior: contain;
}

.jira-weekbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.25rem 0.75rem 0.6rem;
}

button.recon-daystep { border: 0; background: none; font: inherit; cursor: pointer; }
.recon-daystep.is-disabled { opacity: 0.3; pointer-events: none; }

.jira-report-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto;
  align-items: center;
  gap: 1rem;
  min-height: var(--jira-row-h);
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
}

.jira-report-row:hover { background: color-mix(in srgb, var(--text) 3%, transparent); }

.jira-report-row__main,
.jira-report-row__detail {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  font-size: 0.82rem;
}

.jira-report-row__title {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

a.jira-report-row__title:hover { color: var(--accent); }

.jira-report-row__sub {
  color: var(--text-muted);
  font-size: 0.74rem;
}

.jira-report-row__actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.jira-schedule.is-off { opacity: 0.6; }

.jira-schedule__controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.jira-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
}

.jira-state {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
}

.jira-state.is-good { color: var(--good); }
.jira-state.is-warn { color: var(--warn); }
.jira-state.is-bad { color: var(--bad); }
.jira-state.is-idle { color: var(--text-muted); }

.jira-spinner {
  width: 0.8rem;
  height: 0.8rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: jira-spin 0.8s linear infinite;
}

@keyframes jira-spin { to { transform: rotate(360deg); } }

.jira-error-text {
  color: var(--bad);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.74rem;
}

@media (max-width: 900px) {
  .jira-report-row { grid-template-columns: 1fr; }
}

/* --- Report ---------------------------------------------------------------
 * The report body is the standalone export file in an iframe (its own CSS),
 * so nothing here styles report content — only the frame around it. */

.jira-export {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: var(--gap);
}

.jira-frame {
  display: block;
  width: 100%;
  min-height: 24rem;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: transparent;
}

/* --- Schedule recipients ---------------------------------------------------
 * A <details> dropdown: no JS, and the list stays open while ticking because
 * only Save posts (each post re-renders the schedule list). */

/* .glass clips its bloom with overflow: hidden, which also clips the recipient
   popovers. Schedules is always .is-idle (no bloom), so let it overflow. */
#jira-schedules { overflow: visible; }

.jira-recipients { position: relative; }
.jira-recipients > summary { list-style: none; cursor: pointer; }
.jira-recipients > summary::-webkit-details-marker { display: none; }

.jira-recipients__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: min(22rem, 80vw);
  padding: 0.75rem;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: var(--surface-raised);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.jira-schedule-add .jira-recipients__panel { left: 0; right: auto; top: auto; bottom: calc(100% + 0.35rem); }

.jira-recipients__list {
  display: flex;
  flex-direction: column;
  max-height: 14rem;
  overflow-y: auto;
}

.jira-recipients__item {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.5rem;
  align-items: center;
  padding: 0.35rem 0.4rem;
  border-radius: 6px;
  font-size: 0.82rem;
  cursor: pointer;
}

.jira-recipients__item:hover { background: color-mix(in srgb, var(--text) 4%, transparent); }
.jira-recipients__item .jira-muted { grid-column: 2; }

.jira-recipients__picker {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.jira-recipients__add {
  display: flex;
  gap: 0.4rem;
}

.jira-recipients__add input {
  flex: 1;
  min-width: 0;
  padding: 0.42rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
}
