/* Story planner. Reuses the existing tokens (--orange, --line, --muted, ...)
   so the section reads as part of the same product, not a bolt-on. */

.planner {
  border-top: 1px solid var(--line);
  background: #fbfbfb;
}
.planner-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}
.planner .field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.planner .field label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 7px;
}
.planner .field input {
  width: 100%;
  border: 1px solid #aaa;
  padding: 12px;
  font: 13px ui-monospace, SFMono-Regular, Consolas, monospace;
  background: #fff;
  outline: none;
}
.planner .field input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 2px rgba(255, 121, 0, 0.14);
}
.planner-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: stretch;
}
.planner-actions .generate-button {
  min-width: 300px;
}

/* Duration: the confidence colour is the honest signal, so it is not decorative.
   An unavailable estimate is deliberately grey rather than red - it is a normal
   outcome for the ~17% of stories with no recorded duration, not an error. */
.duration-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-left: 5px solid var(--orange);
  background: #fff8f0;
  padding: 20px 24px;
  margin-bottom: 24px;
}
.duration-panel strong {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--orange);
}
.duration-panel span {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.duration-panel small {
  color: var(--muted);
  font-size: 13px;
}
.duration-panel.confidence-high {
  border-left-color: var(--success);
  background: #f1fff7;
}
.duration-panel.confidence-high strong {
  color: var(--success);
}
.duration-panel.confidence-low {
  border-left-color: #b98900;
  background: #fffaf0;
}
.duration-panel.confidence-low strong {
  color: #8a6800;
}
.duration-panel.is-unavailable {
  border-left-color: #aaa;
  background: var(--soft);
}
.duration-panel.is-unavailable strong,
.duration-panel.is-unavailable span {
  color: var(--muted);
}

.plan-approach {
  font-size: 16px;
  line-height: 1.65;
  max-width: 880px;
  margin: 0 0 30px;
}
.plan-subhead {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  margin: 34px 0 18px;
}

.plan-steps {
  list-style: none;
  counter-reset: plan-step;
  margin: 0;
  padding: 0;
}
.plan-steps li {
  counter-increment: plan-step;
  position: relative;
  border: 1px solid var(--line);
  background: #fff;
  padding: 20px 24px 20px 66px;
  margin-bottom: 12px;
}
.plan-steps li:before {
  content: counter(plan-step);
  position: absolute;
  left: 22px;
  top: 20px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: var(--orange);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
}
.step-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.step-head strong {
  font-size: 16px;
}
.record-type {
  border: 1px solid var(--line);
  background: var(--soft);
  color: #444;
  border-radius: 100px;
  padding: 3px 11px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.plan-steps p {
  margin: 0;
  color: var(--ink);
  line-height: 1.6;
  font-size: 14px;
}
.step-precedents {
  margin-top: 10px !important;
  color: var(--muted) !important;
  font-size: 12px !important;
}

.plan-precedents {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 12px;
}
.precedent {
  border: 1px solid var(--line);
  background: #fff;
  padding: 18px 20px;
}
.precedent-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.precedent-head strong {
  font-size: 15px;
}
.precedent-head span {
  color: var(--orange);
  font-size: 12px;
  font-weight: 700;
}
.precedent-summary {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.5;
}
.precedent-why {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.precedent a {
  color: var(--orange);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.precedent a:hover {
  text-decoration: underline;
}
.plan-empty {
  color: var(--muted);
  font-style: italic;
}

.plan-caveats {
  margin-top: 34px;
  border-left: 4px solid #bbb;
  background: var(--soft);
  padding: 16px 20px;
}
.plan-caveats p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.plan-caveats p:last-child {
  margin-bottom: 0;
}

@media (max-width: 900px) {
  .planner .field-row {
    grid-template-columns: 1fr;
  }
  .planner-actions .generate-button {
    width: 100%;
    min-width: 0;
  }
  .plan-precedents {
    grid-template-columns: 1fr;
  }
  .plan-steps li {
    padding: 18px 18px 18px 58px;
  }
}

/* Two estimates side by side: what the archive says similar work cost, and what
   the model judges this particular story to be. Showing both is the point - a
   reader should be able to see them disagree. */
.estimate-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
.estimate-row .duration-panel {
  margin-bottom: 0;
}
.effort-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-left: 5px solid #444;
  background: #fff;
  padding: 20px 24px;
}
.effort-panel strong {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #444;
}
.effort-panel > span {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.effort-panel small {
  color: var(--muted);
  font-size: 13px;
}
.effort-panel.complexity-high {
  border-left-color: var(--danger);
}
.effort-panel.complexity-high strong {
  color: var(--danger);
}
.effort-panel.complexity-medium {
  border-left-color: var(--orange);
}
.effort-panel.complexity-medium strong {
  color: var(--orange);
}
.effort-panel.complexity-low {
  border-left-color: var(--success);
}
.effort-panel.complexity-low strong {
  color: var(--success);
}
.effort-reasoning {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.55;
}
.effort-drivers {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

/* Step detail: configuration and verification are the substance a developer
   actually needs, so they get structure rather than being buried in prose. */
.step-config,
.step-testing {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.step-config h4,
.step-testing h4 {
  margin: 0 0 7px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--orange);
}
.step-config ul {
  margin: 0;
  padding-left: 18px;
}
.step-config li {
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 4px;
}
.step-testing p {
  font-size: 13px !important;
  line-height: 1.6;
  color: #333 !important;
}
.step-general {
  font-style: italic;
}

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


/* The estimate leads; the Jira elapsed figure is context beside it. Sizing says
   which number to act on - the historical one measures queue time, not work. */
.estimate-row {
  grid-template-columns: 1.4fr 1fr;
  align-items: start;
}
.effort-panel.is-primary {
  border-left-width: 5px;
  background: #fff8f0;
}
.effort-panel.is-primary > span {
  font-size: 38px;
}
.duration-panel.is-context {
  border-left: 4px solid #ccc;
  background: var(--soft);
}
.duration-panel.is-context strong {
  color: var(--muted);
  font-size: 10px;
}
.duration-panel.is-context span {
  font-size: 19px;
  color: #555;
  font-weight: 700;
}
.duration-panel.is-context small {
  font-size: 12px;
  line-height: 1.5;
}
.effort-flag {
  margin: 10px 0 0;
  border-left: 3px solid var(--orange);
  padding: 7px 11px;
  background: #fff;
  color: #8a4b00;
  font-size: 12px;
  font-weight: 700;
}
.effort-flag.is-over-cap {
  border-left-color: var(--danger);
  color: var(--danger);
}

/* How the number was arrived at. Deliberately quiet - it is provenance for a
   reader who wants to check the figure, not part of the answer. */
.effort-calibration {
  margin: 10px 0 0;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}


/* Tool tabs: two tools, one page. Sized like a primary navigation choice rather
   than a minor toggle, because picking the wrong one wastes a whole workflow. */
.tool-tabs {
  display: flex;
  gap: 2px;
  background: var(--black);
  padding: 0 clamp(24px, 5vw, 72px);
}
.tool-tab {
  flex: 0 1 auto;
  min-width: 280px;
  border: 0;
  border-bottom: 4px solid transparent;
  background: transparent;
  color: #9a9a9a;
  font: inherit;
  text-align: left;
  padding: 20px 26px 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: color 0.15s, border-color 0.15s;
}
.tool-tab:hover {
  color: #e6e6e6;
}
.tool-tab.is-active {
  color: #fff;
  border-bottom-color: var(--orange);
  background: #111;
}
.tool-tab-eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
}
.tool-tab.is-active .tool-tab-eyebrow {
  color: var(--orange);
}
.tool-tab-label {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.tool-panel[hidden] {
  display: none;
}

@media (max-width: 760px) {
  .tool-tabs {
    flex-direction: column;
    padding: 0;
  }
  .tool-tab {
    min-width: 0;
    border-bottom-width: 3px;
  }
}


/* Comparable past issues. Laid out as a scannable list rather than cards: the
   point is to compare durations at a glance, which cards make harder. */
.comparables-range {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.comparables {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.comparables li {
  display: grid;
  grid-template-columns: 54px 120px 1fr;
  gap: 12px;
  align-items: baseline;
  padding: 10px 12px;
  background: #fff;
}
.comparable-days {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.comparable-key {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--muted);
}
.comparable-summary {
  line-height: 1.45;
}
.comparable-terms {
  grid-column: 3;
  color: var(--muted);
  font-size: 11px;
}
.comparable-terms:empty {
  display: none;
}
@media (max-width: 720px) {
  .comparables li {
    grid-template-columns: 54px 1fr;
  }
  .comparable-summary,
  .comparable-terms {
    grid-column: 2;
  }
}
