:root {
  color: #172026;
  background: #f4f7f8;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  background: #0d6171;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  padding: 0.7rem 0.9rem;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

button.secondary {
  background: #e8f2f4;
  color: #0d6171;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #c9d6dc;
  border-radius: 6px;
  background: #fff;
  color: #172026;
  padding: 0.65rem 0.7rem;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

label {
  display: grid;
  gap: 0.35rem;
  color: #42515a;
  font-size: 0.82rem;
  font-weight: 700;
}

.shell {
  width: min(1600px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.topActions {
  display: flex;
  align-items: end;
  gap: 10px;
}

.topActions button {
  min-width: 132px;
}

.eyebrow {
  color: #0d6171;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0 0 8px;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2rem, 3vw, 3.25rem);
  line-height: 1;
  margin-bottom: 10px;
}

h2 {
  font-size: 1.05rem;
  margin-bottom: 0;
}

.lede {
  color: #4b5b63;
  font-size: 1.02rem;
  line-height: 1.5;
  max-width: 760px;
  margin-bottom: 0;
}

.dateBox {
  width: min(230px, 100%);
}

.grid {
  display: grid;
  grid-template-columns: minmax(520px, 1.08fr) minmax(420px, 0.92fr);
  gap: 16px;
  align-items: start;
}

.panel {
  background: #fff;
  border: 1px solid #dde7eb;
  border-radius: 8px;
  padding: 16px;
}

.panelHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.buttonRow {
  display: flex;
  gap: 8px;
}

.wizardSteps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

.wizardSteps span {
  background: #eef3f5;
  border-radius: 5px;
  color: #69777d;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.55rem;
  text-align: center;
}

.wizardSteps span.active {
  background: #0d6171;
  color: #fff;
}

.wizardGuide,
.wizardChecks {
  color: #42515a;
  font-size: 0.88rem;
  line-height: 1.45;
}

.wizardChecks {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}

.wizardCheck {
  background: #f4f7f8;
  border-left: 4px solid #0d8a57;
  border-radius: 5px;
  padding: 0.6rem 0.7rem;
}

.wizardCheck.warning {
  border-left-color: #c07a1a;
}

.wizardCheck.error {
  border-left-color: #ba3434;
}

.wizardActions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 12px 0;
}

.message {
  background: #edf8fa;
  border-radius: 6px;
  color: #23545d;
  font-size: 0.9rem;
  margin: 12px 0;
  padding: 0.7rem;
}

.manualAdd {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px;
  background: #f4f7f8;
  border: 1px solid #dde7eb;
  border-radius: 8px;
}

.count {
  border-radius: 999px;
  background: #e8f2f4;
  color: #0d6171;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.35rem 0.6rem;
}

.storyList {
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 230px);
  overflow: auto;
  padding-right: 4px;
}

.empty {
  color: #69777d;
  margin: 0;
}

.storyCard {
  border: 1px solid #dbe6ea;
  border-left: 5px solid #899aa3;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.storyCard.selected {
  background: #effaf4;
  border-color: #acd9bd;
  border-left-color: #0d8a57;
}

.storyCard.held {
  border-left-color: #c07a1a;
}

.storyCard.confirm {
  border-left-color: #ba3434;
}

.storyCard.selected .scoreLine strong {
  color: #0d6e45;
}

.storyTop {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 8px;
}

.storyTop input {
  font-weight: 800;
}

.storyMeta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.storyMeta.two {
  grid-template-columns: 1fr 1fr;
}

.scoreLine {
  display: grid;
  gap: 3px;
  color: #607078;
  font-size: 0.78rem;
  line-height: 1.4;
}

.scoreLine strong {
  color: #172026;
}

.outputPanel {
  position: sticky;
  top: 16px;
}

pre {
  background: #10191d;
  border-radius: 8px;
  color: #f6fbfc;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.9rem;
  line-height: 1.55;
  margin: 0;
  max-height: calc(100vh - 130px);
  overflow: auto;
  padding: 16px;
  white-space: pre-wrap;
}

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

  .outputPanel {
    position: static;
  }

  .storyList,
  pre {
    max-height: none;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 20px, 1600px);
    padding-top: 16px;
  }

  .topbar,
  .topActions {
    display: grid;
  }

  .topActions button,
  .dateBox {
    width: 100%;
  }

  .storyMeta,
  .storyMeta.two,
  .storyTop {
    grid-template-columns: 1fr;
  }
}
