:root {
  color-scheme: light;
  --canvas: #faf7f4;
  --canvas-deep: #f4eee9;
  --paper: #ffffff;
  --ink: #281d19;
  --ink-soft: #4d403b;
  --muted: #766963;
  --faint: #9a8981;
  --line: #eee1da;
  --line-strong: #dcc8bf;
  --accent: #cf4228;
  --accent-deep: #aa3321;
  --accent-soft: #ffede5;
  --accent-pale: #fff6f1;
  --market: #93651f;
  --market-soft: #fff5df;
  --github: #34373b;
  --github-soft: #f1f1ef;
  --shadow-sm: 0 1px 2px rgba(77, 44, 31, .04), 0 8px 24px rgba(77, 44, 31, .035);
  --shadow-lg: 0 24px 70px rgba(77, 44, 31, .12), 0 2px 8px rgba(77, 44, 31, .04);
  --font: "Avenir Next", "Segoe UI Variable Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", sans-serif;
  --display: "Avenir Next", "Segoe UI Variable Display", "PingFang SC", "Microsoft YaHei UI", sans-serif;
  --ease: cubic-bezier(.22, .72, .24, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(720px 420px at 50% -12%, rgba(207, 66, 40, .08), transparent 68%),
    radial-gradient(520px 360px at 88% 8%, rgba(184, 74, 50, .06), transparent 70%),
    var(--canvas);
  font: 14px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: var(--accent-deep);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(244, 121, 74, .22);
  outline-offset: 2px;
}

::selection {
  color: #3e261e;
  background: #ffdccc;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.brand-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(135deg, #d8623d, var(--accent));
  box-shadow: var(--shadow-sm);
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-copy strong {
  font-family: var(--display);
  font-size: 15px;
}

.brand-copy small {
  color: var(--muted);
  font-size: 11px;
}

.topnav {
  display: flex;
  gap: 4px;
}

.topnav a {
  padding: 7px 13px;
  border-radius: 999px;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color .16s var(--ease), background .16s var(--ease);
}

.topnav a:hover {
  color: var(--accent-deep);
  background: var(--accent-pale);
}

.stage {
  width: min(880px, calc(100% - 40px));
  margin: 0 auto;
  flex: 1;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 9vh 0 34px;
}

.hero-avatar {
  width: 64px;
  height: 64px;
  margin-bottom: 18px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--paper);
  box-shadow: var(--shadow-lg);
}

.hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
}

.hero h1 {
  margin: 0 0 12px;
  font-family: var(--display);
  font-size: clamp(28px, 4.6vw, 40px);
  line-height: 1.25;
}

.hero-sub {
  max-width: 560px;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
}

.source-ribbon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 28px;
}

.source-ribbon-label {
  margin-right: 2px;
  color: var(--faint);
  font-size: 11px;
}

.source-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .7);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
}

.source-pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.source-pill.source-internal {
  color: var(--accent-deep);
}

.source-pill.source-market {
  color: var(--market);
}

.source-pill.source-github {
  color: var(--github);
}

.goal-form {
  width: min(680px, 100%);
}

.goal-box {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: var(--shadow-lg);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}

.goal-box:focus-within {
  border-color: rgba(207, 66, 40, .45);
  box-shadow: var(--shadow-lg), 0 0 0 4px rgba(207, 66, 40, .08);
}

.goal-box textarea {
  flex: 1;
  min-height: 46px;
  max-height: 160px;
  padding: 8px 10px;
  border: 0;
  outline: 0;
  resize: none;
  color: var(--ink);
  background: transparent;
  font-size: 15px;
  line-height: 1.55;
}

.goal-box textarea::placeholder {
  color: var(--faint);
}

.goal-submit {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  padding: 11px 18px;
  border: 0;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(135deg, #d35a32, var(--accent));
  box-shadow: 0 6px 18px rgba(207, 66, 40, .24);
  font-weight: 700;
  cursor: pointer;
  transition: transform .16s var(--ease), opacity .16s var(--ease), box-shadow .16s var(--ease);
}

.goal-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 9px 24px rgba(207, 66, 40, .32);
}

.goal-submit:disabled {
  opacity: .45;
  cursor: default;
  box-shadow: none;
}

.goal-submit svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.goal-hint {
  margin: 10px 0 0;
  color: var(--faint);
  font-size: 11px;
}

.examples {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.examples-label {
  color: var(--faint);
  font-size: 12px;
  margin-right: 2px;
}

.examples button,
.followup-chip {
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, .72);
  font-size: 12px;
  cursor: pointer;
  transition: border-color .16s var(--ease), color .16s var(--ease), background .16s var(--ease);
}

.examples button:hover,
.followup-chip:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
  background: var(--accent-pale);
}

.result {
  width: min(720px, 100%);
  margin: 0 auto 48px;
  scroll-margin-top: 18px;
}

.result-status {
  padding: 12px 16px;
  border-radius: 14px;
  margin-bottom: 16px;
  font-size: 13px;
}

.result-status.loading {
  color: var(--accent-deep);
  background: var(--accent-pale);
  border: 1px solid var(--line);
}

.result-status.error {
  color: #a93422;
  background: #fff1ec;
  border: 1px solid #f4cabb;
}

.result-status.success {
  color: #4c7048;
  background: #f1f7ef;
  border: 1px solid #d9e7d5;
}

.plan-loading-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink-soft);
  background:
    linear-gradient(110deg, rgba(255, 245, 239, .9), rgba(255, 253, 250, .96)),
    var(--paper);
  box-shadow: var(--shadow-sm);
}

.plan-loading-card > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.plan-loading-card b {
  color: var(--ink);
  font-family: var(--display);
  font-size: 15px;
}

.plan-loading-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.plan-loading-mark {
  position: relative;
  flex: none;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(207, 66, 40, .22);
  border-radius: 50%;
  background: var(--accent-pale);
}

.plan-loading-mark i {
  position: absolute;
  inset: 7px;
  border: 2px solid rgba(207, 66, 40, .18);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: plan-spin .9s linear infinite;
}

.plan-loading-card.is-error {
  border-color: #f4cabb;
  background: #fff7f3;
}

.plan-error-mark {
  display: grid;
  place-items: center;
  border-color: #efc8ba;
  color: #a93422;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
}

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

.plan-block {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #fffdfb, #fff8f3);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.plan-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 20px 14px;
  border-bottom: 1px dashed var(--line);
}

.plan-head-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.plan-badge {
  align-self: flex-start;
  padding: 2px 9px;
  border-radius: 999px;
  color: var(--accent-deep);
  background: var(--accent-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
}

.plan-coverage {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.coverage-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .75);
  font-size: 10px;
  font-weight: 650;
}

.coverage-chip small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 999px;
  background: currentColor;
  color: #fff;
  font-size: 9px;
  line-height: 1;
}

.coverage-chip.source-internal {
  color: var(--accent-deep);
}

.coverage-chip.source-market {
  color: var(--market);
}

.coverage-chip.source-github {
  color: var(--github);
}

.plan-head b {
  color: var(--ink);
  font-family: var(--display);
  font-size: 17px;
  font-weight: 700;
}

.plan-summary {
  color: var(--muted);
  font-size: 12px;
}

.plan-brief {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.4fr);
  gap: 0;
  margin-top: 10px;
  padding-top: 11px;
  border-top: 1px solid rgba(238, 225, 218, .8);
}

.plan-brief-lead {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding-right: 18px;
}

.plan-brief-lead em,
.plan-brief-context em {
  color: var(--accent-deep);
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: .04em;
}

.plan-brief-lead strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.62;
}

.plan-brief-context {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  padding-left: 18px;
  border-left: 1px solid rgba(238, 225, 218, .85);
}

.plan-brief-context > span {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 8px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.58;
}

.plan-brief-context em {
  padding-top: 1px;
}

.plan-contract {
  padding: 17px 20px 18px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(105deg, rgba(255, 239, 231, .72), rgba(255, 252, 248, .92) 58%),
    var(--paper);
}

.plan-contract-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
}

.plan-contract-head > span {
  flex: none;
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .02em;
}

.contract-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.contract-readiness {
  padding: 2px 7px;
  border: 1px solid rgba(147, 101, 31, .2);
  border-radius: 999px;
  color: var(--market);
  background: rgba(255, 245, 223, .72);
  font-size: 8px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0;
}

.contract-readiness.is-ready {
  border-color: rgba(82, 119, 80, .22);
  color: #527750;
  background: #f1f7ef;
}

.plan-contract-head small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
  text-align: right;
}

.contract-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
  border-top: 1px solid rgba(220, 200, 191, .82);
  border-bottom: 1px solid rgba(220, 200, 191, .82);
}

.contract-metric {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 10px 12px;
}

.contract-metric:first-child {
  padding-left: 0;
}

.contract-metric + .contract-metric {
  border-left: 1px solid rgba(220, 200, 191, .82);
}

.contract-metric small {
  color: var(--faint);
  font-size: 9px;
  font-weight: 650;
}

.contract-metric b {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family: var(--display);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}

.contract-metric.is-missing b {
  color: var(--market);
  font-size: 12px;
}

.contract-resolved {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}

.contract-resolved > span {
  margin-right: 2px;
  color: var(--faint);
  font-size: 9px;
}

.contract-resolved em {
  padding: 2px 7px;
  border: 1px solid rgba(82, 119, 80, .18);
  border-radius: 999px;
  color: #527750;
  background: #f3f8f1;
  font-size: 8px;
  font-style: normal;
  font-weight: 650;
}

.contract-milestones {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 13px 0 0;
  padding: 0;
  list-style: none;
}

.contract-milestones li {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 7px;
  min-width: 0;
  padding-right: 10px;
}

.contract-milestones li:not(:last-child)::after {
  position: absolute;
  top: 10px;
  right: 1px;
  left: 31px;
  height: 1px;
  background: rgba(207, 66, 40, .2);
  content: "";
}

.milestone-index {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(207, 66, 40, .32);
  border-radius: 50%;
  color: var(--accent-deep);
  background: #fffaf7;
  font-size: 9px;
  font-weight: 750;
}

.milestone-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  padding-top: 1px;
}

.milestone-copy em {
  color: var(--accent-deep);
  font-size: 8px;
  font-style: normal;
  font-weight: 700;
}

.milestone-copy b {
  color: var(--ink);
  font-size: 10px;
  line-height: 1.45;
}

.milestone-copy small {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.contract-next {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 11px;
  margin-top: 13px;
  padding: 11px 12px;
  border-radius: 11px;
  color: #fff9f5;
  background:
    linear-gradient(105deg, #3b2923, #56352b 68%, #6d4032);
  box-shadow: 0 10px 24px rgba(77, 44, 31, .13);
}

.contract-next-label {
  padding: 3px 7px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 999px;
  color: #ffd6c7;
  font-size: 8px;
  font-weight: 750;
  white-space: nowrap;
}

.contract-next-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.contract-next-copy b {
  color: #fff;
  font-size: 11px;
}

.contract-next-copy > span {
  display: -webkit-box;
  overflow: hidden;
  color: rgba(255, 249, 245, .72);
  font-size: 9px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.contract-next time {
  color: rgba(255, 249, 245, .58);
  font-size: 9px;
  white-space: nowrap;
}

.contract-next-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: none;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 999px;
  color: #fff !important;
  background: rgba(255, 255, 255, .08);
  font: inherit;
  font-size: 9px;
  font-weight: 700;
  text-decoration: none !important;
  white-space: nowrap;
  cursor: pointer;
}

.contract-next-link:hover {
  border-color: rgba(255, 255, 255, .55);
  background: rgba(255, 255, 255, .15);
}

.contract-next-link svg {
  width: 10px;
  height: 10px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.contract-missing {
  margin-top: 10px;
  border-top: 1px dashed rgba(220, 200, 191, .72);
}

.contract-missing summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 9px;
  color: var(--market);
  font-size: 10px;
  font-weight: 650;
  list-style: none;
  cursor: pointer;
}

.contract-missing summary::-webkit-details-marker {
  display: none;
}

.contract-missing summary em {
  color: var(--faint);
  font-size: 9px;
  font-style: normal;
}

.contract-missing[open] summary em {
  font-size: 0;
}

.contract-missing[open] summary em::after {
  font-size: 9px;
  content: "收起";
}

.contract-missing ul {
  margin: 7px 0 0;
  padding: 0;
  list-style: none;
}

.contract-missing li {
  position: relative;
  padding-left: 10px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.6;
}

.contract-missing li + li {
  margin-top: 3px;
}

.contract-missing li::before {
  position: absolute;
  top: .68em;
  left: 0;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--market);
  content: "";
}

.clarification-form {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(220, 200, 191, .62);
}

.clarification-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.clarification-head b {
  color: var(--ink);
  font-size: 11px;
}

.clarification-head small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
  text-align: right;
}

.clarification-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 8px;
}

.clarification-group {
  min-width: 0;
  margin: 0;
  padding: 9px;
  border: 1px solid rgba(226, 207, 196, .76);
  border-radius: 10px;
  background: rgba(255, 255, 255, .72);
}

.clarification-group legend {
  padding: 0 3px;
  color: var(--accent-deep);
  font-size: 9px;
  font-weight: 700;
}

.clarification-group > p {
  min-height: 28px;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.clarification-options {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.clarification-option {
  position: relative;
  display: block;
  cursor: pointer;
}

.clarification-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.clarification-option span {
  display: block;
  padding: 5px 7px;
  border: 1px solid rgba(238, 225, 218, .9);
  border-radius: 7px;
  color: var(--ink-soft);
  background: #fff;
  font-size: 9px;
  line-height: 1.4;
  transition: border-color .16s var(--ease), color .16s var(--ease), background .16s var(--ease);
}

.clarification-option:hover span {
  border-color: var(--line-strong);
  background: var(--accent-pale);
}

.clarification-option input:checked + span {
  border-color: rgba(207, 66, 40, .48);
  color: var(--accent-deep);
  background: var(--accent-soft);
  font-weight: 650;
}

.clarification-option input:focus-visible + span {
  outline: 3px solid rgba(244, 121, 74, .22);
  outline-offset: 2px;
}

.clarification-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 9px;
}

.clarification-status {
  margin: 0 auto 0 0;
  color: #a93422;
  font-size: 9px;
}

.clarification-status[hidden] {
  display: none;
}

.clarification-actions > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 32px;
  padding: 6px 11px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.clarification-actions > button:hover {
  border-color: var(--accent-deep);
  background: var(--accent-deep);
}

.clarification-actions svg {
  width: 10px;
  height: 10px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.plan-analysis {
  padding: 16px 20px;
  border-bottom: 1px dashed var(--line);
  background:
    radial-gradient(360px 150px at 0 0, rgba(207, 66, 40, .055), transparent 72%),
    linear-gradient(135deg, rgba(255, 250, 246, .86), rgba(255, 255, 255, .72));
}

.plan-analysis-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  list-style: none;
  cursor: pointer;
}

.plan-analysis-head::-webkit-details-marker {
  display: none;
}

.plan-analysis-head > span {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.plan-analysis-head em {
  color: var(--accent-deep);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: .05em;
}

.plan-analysis-head b {
  color: var(--ink);
  font-family: var(--display);
  font-size: 14px;
  line-height: 1.55;
}

.plan-analysis-head small {
  flex: none;
  max-width: 190px;
  color: var(--faint);
  font-size: 9px;
  line-height: 1.55;
  text-align: right;
}

.plan-analysis[open] .plan-analysis-head small {
  color: var(--accent-deep);
}

.analysis-body {
  padding-top: 1px;
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.analysis-grid article {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid rgba(226, 207, 196, .72);
  border-radius: 11px;
  background: rgba(255, 255, 255, .76);
}

.analysis-grid article.is-pending {
  border-color: #ecd9b9;
  background: rgba(255, 250, 238, .82);
}

.analysis-label {
  display: block;
  margin-bottom: 5px;
  color: var(--accent-deep);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .05em;
}

.analysis-grid article.is-pending .analysis-label {
  color: var(--market);
}

.analysis-grid ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.analysis-grid li {
  position: relative;
  padding-left: 9px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.6;
}

.analysis-grid li + li {
  margin-top: 4px;
}

.analysis-grid li::before {
  position: absolute;
  top: .67em;
  left: 0;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  content: "";
  opacity: .52;
}

.analysis-empty {
  color: var(--faint);
  font-size: 10px;
}

.analysis-chain,
.analysis-gates {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(238, 225, 218, .7);
}

.analysis-chain > span,
.analysis-gates > span {
  flex: none;
  padding-top: 2px;
  color: var(--faint);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
}

.analysis-chain p,
.analysis-gates > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0;
}

.analysis-chain b {
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: #fff;
  font-size: 9px;
  font-weight: 650;
}

.analysis-chain i {
  color: var(--line-strong);
  font-size: 9px;
  font-style: normal;
}

.analysis-gates em {
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--market);
  background: var(--market-soft);
  font-size: 9px;
  font-style: normal;
  line-height: 1.55;
}

.plan-workstreams {
  padding: 16px 20px;
  border-bottom: 1px dashed var(--line);
  background: rgba(255, 255, 255, .48);
}

.plan-workstreams-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 11px;
}

.plan-workstreams-head > span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.plan-workstreams-head b {
  color: var(--ink);
  font-family: var(--display);
  font-size: 13px;
}

.plan-workstreams-head small {
  color: var(--muted);
  font-size: 10px;
}

.plan-workstreams-head > em {
  flex: none;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent-deep);
  background: var(--accent-pale);
  font-size: 9px;
  font-style: normal;
  font-weight: 650;
}

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

.workstream-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .82);
}

.workstream-index {
  color: var(--faint);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.workstream-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.workstream-title b {
  color: var(--ink);
  font-size: 13px;
}

.workstream-title > span {
  overflow: hidden;
  max-width: 46%;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 8px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workstream-title > span.source-market {
  color: var(--market);
  background: var(--market-soft);
}

.workstream-title > span.source-github {
  color: var(--github);
  background: var(--github-soft);
}

.workstream-card p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.workstream-deliverable {
  display: flex;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  color: var(--ink-soft);
  background: var(--accent-pale);
  font-size: 9px;
  line-height: 1.55;
}

.workstream-deliverable em {
  flex: none;
  color: var(--accent-deep);
  font-style: normal;
  font-weight: 700;
}

.workstream-phases {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.workstream-phases span {
  padding: 1px 6px;
  border: 1px solid rgba(238, 225, 218, .95);
  border-radius: 999px;
  color: var(--faint);
  font-size: 8px;
}

.workstream-entry {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 1px;
  color: var(--accent-deep);
  font-size: 9px;
  font-weight: 650;
  text-decoration: none;
}

.workstream-entry:hover {
  text-decoration: underline;
}

.workstream-entry svg {
  width: 9px;
  height: 9px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.plan-steps {
  margin: 0;
  padding: 8px 20px 12px;
  list-style: none;
}

.plan-step {
  position: relative;
  display: flex;
  gap: 14px;
  padding: 14px 0;
}

.plan-step + .plan-step {
  border-top: 1px solid rgba(238, 225, 218, .7);
}

.plan-step::before {
  position: absolute;
  z-index: 0;
  top: 39px;
  bottom: -15px;
  left: 11px;
  width: 1px;
  background: rgba(226, 207, 196, .7);
  content: "";
}

.plan-step:last-child::before {
  display: none;
}

.plan-step-no {
  position: relative;
  z-index: 1;
  flex: none;
  width: 24px;
  height: 24px;
  margin-top: 1px;
  border-radius: 50%;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 0 0 3px #fffaf7;
  font-size: 12px;
  font-weight: 700;
  line-height: 24px;
  text-align: center;
}

.plan-step.source-market .plan-step-no {
  background: var(--market);
}

.plan-step.source-github .plan-step-no {
  background: var(--github);
}

.plan-step-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 0;
}

.plan-step-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.plan-step-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.plan-step-top b {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.plan-step-meta {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.plan-step-meta time {
  padding-left: 7px;
  border-left: 1px solid var(--line-strong);
  color: var(--faint);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.plan-step-track {
  padding: 1px 6px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--canvas-deep);
  font-size: 8px;
  font-weight: 650;
}

.plan-step-tool {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--accent-deep);
  background: #fff;
  font-size: 11px;
  font-weight: 650;
  text-decoration: none;
  transition: border-color .16s var(--ease), background .16s var(--ease);
}

.plan-step-tool .tool-source-label {
  padding-right: 6px;
  border-right: 1px solid currentColor;
  opacity: .68;
  font-size: 9px;
  letter-spacing: .02em;
}

.plan-step-tool.source-market {
  border-color: #ead3aa;
  color: var(--market);
}

.plan-step-tool.source-github {
  border-color: #d1d3d4;
  color: var(--github);
}

a.plan-step-tool:hover {
  border-color: var(--accent);
  background: var(--accent-pale);
}

a.plan-step-tool.source-market:hover {
  border-color: var(--market);
  background: var(--market-soft);
}

a.plan-step-tool.source-github:hover {
  border-color: var(--github);
  background: var(--github-soft);
}

.plan-step-tool svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.plan-step-action {
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.65;
}

.plan-step-outcome {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 7px 18px;
  margin-top: 2px;
  padding-top: 7px;
  border-top: 1px dashed rgba(226, 207, 196, .7);
}

.plan-step-result {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.62;
}

.plan-step-result em {
  color: var(--accent-deep);
  font-style: normal;
  font-weight: 700;
}

.plan-step-result.is-check em {
  color: var(--market);
}

.plan-step-risk {
  display: flex;
  grid-column: 1 / -1;
  align-items: flex-start;
  gap: 5px;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.6;
}

.plan-step-risk svg {
  flex: none;
  width: 12px;
  height: 12px;
  margin-top: 2px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.plan-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 20px 18px;
  border-top: 1px solid rgba(238, 225, 218, .8);
  background:
    linear-gradient(90deg, rgba(255, 237, 229, .72), rgba(255, 250, 246, .5) 58%),
    var(--paper);
}

.plan-action-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.plan-action-copy strong {
  color: var(--ink);
  font-size: 13px;
}

.plan-action-copy span {
  max-width: 360px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.plan-action-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: none;
  flex-wrap: wrap;
}

.plan-run-button,
.plan-automate-button,
.plan-gap-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .16s var(--ease), box-shadow .16s var(--ease), border-color .16s var(--ease), background .16s var(--ease);
}

.plan-run-button {
  border: 1px solid var(--accent);
  color: #fff;
  background: linear-gradient(135deg, #d75a35, var(--accent));
  box-shadow: 0 7px 18px rgba(207, 66, 40, .22);
}

.plan-gap-button {
  border: 1px solid var(--accent);
  color: #fff;
  background: linear-gradient(135deg, #d75a35, var(--accent));
  box-shadow: 0 7px 18px rgba(207, 66, 40, .2);
}

.plan-gap-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 9px 24px rgba(207, 66, 40, .28);
}

.plan-run-button.is-gated {
  border-color: var(--line-strong);
  color: var(--ink-soft);
  background: rgba(255, 255, 255, .9);
  box-shadow: none;
}

.plan-run-button.is-gated:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent-deep);
  box-shadow: none;
}

.plan-run-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 9px 24px rgba(207, 66, 40, .3);
}

.plan-automate-button {
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  background: rgba(255, 255, 255, .9);
}

.plan-automate-button:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
  background: #fff;
}

.plan-run-button:disabled,
.plan-automate-button:disabled,
.plan-gap-button:disabled {
  opacity: .5;
  cursor: wait;
  transform: none;
}

.plan-run-button.is-started {
  border-color: #b8cbb2;
  color: #436440;
  background: #f1f6ef;
  box-shadow: none;
  opacity: 1;
  cursor: default;
}

.plan-run-button svg,
.plan-automate-button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.plan-entry-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 650;
  text-decoration: none;
  transition: color .16s var(--ease), background .16s var(--ease);
}

.plan-entry-link:hover {
  color: var(--accent-deep);
  background: rgba(255, 255, 255, .8);
}

.plan-entry-link svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.plan-revise {
  padding: 16px 20px 18px;
  border-top: 1px solid rgba(238, 225, 218, .8);
  background: #fffdfa;
}

.plan-revise-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.plan-revise-head > span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.plan-revise-head b {
  color: var(--ink);
  font-size: 13px;
}

.plan-revise-head small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.plan-revise-head em {
  flex: none;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--accent-deep);
  background: var(--accent-soft);
  font-size: 8px;
  font-style: normal;
  font-weight: 650;
}

.plan-revise-box {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-top: 10px;
  padding: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}

.plan-revise-box:focus-within {
  border-color: rgba(207, 66, 40, .46);
  box-shadow: 0 0 0 3px rgba(207, 66, 40, .07);
}

.plan-revise-box textarea {
  flex: 1;
  min-height: 42px;
  max-height: 130px;
  padding: 6px 7px;
  border: 0;
  outline: 0;
  resize: vertical;
  color: var(--ink);
  background: transparent;
  font-size: 12px;
  line-height: 1.55;
}

.plan-revise-box textarea::placeholder {
  color: var(--faint);
}

.plan-revise-box button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--ink);
  border-radius: 9px;
  color: #fff;
  background: var(--ink);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.plan-revise-box button:hover {
  border-color: var(--accent-deep);
  background: var(--accent-deep);
}

.plan-revise-box button svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.plan-revise-suggestions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.plan-revise-suggestions > span {
  margin-right: 2px;
  color: var(--faint);
  font-size: 9px;
}

.plan-revise-suggestions button {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--canvas);
  font-size: 9px;
  cursor: pointer;
}

.plan-revise-suggestions button:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
  background: var(--accent-pale);
}

.plan-export-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dashed rgba(226, 207, 196, .7);
}

.plan-export-tools > span {
  margin-right: 3px;
  color: var(--faint);
  font-size: 9px;
}

.plan-export-tools button {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: #fff;
  font-size: 9px;
  cursor: pointer;
}

.plan-export-tools button:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
  background: var(--accent-pale);
}

.automation-banner:empty,
.execution-panel:empty {
  display: none;
}

.automation-banner {
  padding: 0 20px 16px;
  background: linear-gradient(180deg, rgba(255, 250, 246, .55), rgba(255, 253, 251, .9));
}

.automation-banner-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .82);
}

.automation-banner-card.is-active {
  border-color: #e5c69e;
  background: linear-gradient(90deg, #fffaf0, #fffdf9);
}

.automation-banner-card.is-paused {
  color: var(--muted);
  background: var(--canvas);
}

.automation-beacon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  color: var(--market);
  background: var(--market-soft);
}

.automation-beacon i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 rgba(147, 101, 31, .28);
  animation: automation-pulse 2.4s ease-out infinite;
}

.automation-banner-card.is-paused .automation-beacon {
  color: var(--faint);
  background: var(--github-soft);
}

.automation-banner-card.is-paused .automation-beacon i {
  animation: none;
  box-shadow: none;
}

.automation-banner-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  line-height: 1.45;
}

.automation-banner-copy b {
  color: var(--ink);
  font-size: 12px;
}

.automation-banner-copy small {
  color: var(--market);
  font-size: 10px;
}

.automation-banner-copy > span {
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.automation-banner-card > button,
.execution-refresh,
.execution-step-actions button,
.execution-error button {
  flex: none;
  padding: 5px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, .85);
  font-size: 10px;
  font-weight: 650;
  cursor: pointer;
}

.automation-banner-card > button:hover,
.execution-refresh:hover,
.execution-step-actions button:hover,
.execution-error button:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
}

.execution-panel {
  border-top: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(255, 250, 246, .72)),
    var(--paper);
}

.execution-console {
  padding: 15px 20px 18px;
}

.execution-console-head,
.execution-title-row,
.execution-step,
.execution-loading,
.execution-error {
  display: flex;
  align-items: center;
}

.execution-console-head {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.execution-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-deep);
  font-size: 10px;
  font-weight: 700;
}

.execution-state i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.execution-console.is-active .execution-state i {
  box-shadow: 0 0 0 4px rgba(207, 66, 40, .1);
  animation: automation-pulse 2.4s ease-out infinite;
}

.execution-console.is-complete .execution-state {
  color: #477044;
}

.execution-console.is-needs-action .execution-state {
  color: var(--market);
}

.execution-console.is-failed .execution-state {
  color: #a93422;
}

.execution-console-meta {
  color: var(--faint);
  font-size: 10px;
}

.execution-title-row {
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.execution-title-row > div {
  min-width: 0;
}

.execution-title-row strong {
  display: block;
  color: var(--ink);
  font-family: var(--display);
  font-size: 15px;
}

.execution-title-row p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.execution-progress {
  overflow: hidden;
  height: 4px;
  margin: 12px 0 4px;
  border-radius: 999px;
  background: #f0e6e0;
}

.execution-progress > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #dd7048, var(--accent));
  transition: width .35s var(--ease);
}

.execution-console.is-complete .execution-progress > span {
  background: #698b62;
}

.execution-steps {
  margin: 0;
  padding: 2px 0 0;
  list-style: none;
}

.execution-step {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(238, 225, 218, .65);
}

.execution-step:last-child {
  border-bottom: 0;
}

.execution-step-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--muted);
  background: #fff;
  font-size: 10px;
  font-weight: 700;
}

.execution-step-state svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.execution-step.is-done .execution-step-state {
  border-color: #86a27f;
  color: #fff;
  background: #6e9167;
}

.execution-step.is-needs-action .execution-step-state {
  border-color: #d8b26e;
  color: var(--market);
  background: #fff8e9;
}

.execution-step.is-failed .execution-step-state {
  border-color: #e8ad9b;
  color: #a93422;
  background: #fff1ec;
}

.execution-step-spinner {
  width: 11px;
  height: 11px;
  border: 2px solid rgba(207, 66, 40, .2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: execution-spin .8s linear infinite;
}

.execution-step-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.execution-step-title {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.execution-step-title b {
  color: var(--ink);
  font-size: 12px;
}

.execution-step-description {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.execution-tool,
.execution-step-title em {
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 9px;
  font-style: normal;
  font-weight: 650;
}

.execution-tool.source-internal {
  color: var(--accent-deep);
  background: var(--accent-soft);
}

.execution-tool.source-market {
  color: var(--market);
  background: var(--market-soft);
}

.execution-tool.source-github {
  color: var(--github);
  background: var(--github-soft);
}

.execution-step-title em {
  color: var(--market);
  background: #fff8e9;
}

.execution-step-title .execution-step-state-label {
  color: var(--faint);
  background: #f7f1ed;
}

.execution-step.is-done .execution-step-state-label {
  color: #557750;
  background: #eef5ec;
}

.execution-step.is-running .execution-step-state-label {
  color: var(--accent-deep);
  background: var(--accent-soft);
}

.execution-step.is-failed .execution-step-state-label {
  color: #a93422;
  background: #fff1ec;
}

.execution-step-result {
  margin-top: 3px;
  padding: 5px 8px;
  border-left: 2px solid rgba(207, 66, 40, .35);
  border-radius: 0 6px 6px 0;
  color: var(--ink-soft);
  background: rgba(255, 246, 240, .72);
  font-size: 10px;
  line-height: 1.55;
}

.execution-step-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  flex-wrap: wrap;
}

.execution-step-open {
  color: var(--accent-deep);
  font-size: 10px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.execution-step-open:hover {
  text-decoration: underline;
}

.execution-step.is-done .execution-step-title b,
.execution-step.is-done .execution-step-description {
  color: var(--faint);
}

.execution-step.is-done {
  opacity: .82;
}

.execution-step-actions button:disabled {
  opacity: .5;
  cursor: wait;
}

.execution-footnote {
  margin: 10px 0 0;
  padding-left: 34px;
  color: var(--faint);
  font-size: 9px;
  line-height: 1.55;
}

.execution-loading,
.execution-error {
  gap: 12px;
  padding: 18px 20px;
}

.execution-loading > span:last-child,
.execution-error > span {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}

.execution-loading b,
.execution-error b {
  font-size: 12px;
}

.execution-loading small,
.execution-error small {
  color: var(--muted);
  font-size: 10px;
}

.execution-loading-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
}

.execution-loading-mark i {
  width: 13px;
  height: 13px;
  border: 2px solid rgba(207, 66, 40, .25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: execution-spin .8s linear infinite;
}

.execution-error {
  background: #fff6f1;
}

@keyframes automation-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(147, 101, 31, .28);
  }
  60%,
  100% {
    box-shadow: 0 0 0 7px rgba(147, 101, 31, 0);
  }
}

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

.external-shelf {
  padding: 16px 20px 18px;
  border-top: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .7), rgba(250, 247, 244, .45)),
    var(--paper);
}

.external-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.external-head > span:first-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.external-head b {
  color: var(--ink);
  font-size: 13px;
}

.external-head small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.external-count {
  flex: none;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--faint);
  background: var(--canvas);
  font-size: 10px;
}

.external-shelf.is-fallback .external-count {
  color: var(--market);
  background: var(--market-soft);
}

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

.tool-candidate {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: inherit;
  background: rgba(255, 255, 255, .78);
  text-decoration: none;
  transition: border-color .16s var(--ease), background .16s var(--ease);
}

.tool-candidate:hover {
  border-color: var(--line-strong);
  background: #fff;
}

.tool-candidate.source-github:hover {
  border-color: #9ea1a4;
}

.tool-candidate.source-market:hover {
  border-color: #cba15f;
}

.candidate-top,
.candidate-foot,
.candidate-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.candidate-top {
  justify-content: space-between;
  min-width: 0;
}

.source-badge {
  flex: none;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
}

.source-badge.source-market {
  color: var(--market);
  background: var(--market-soft);
}

.source-badge.source-github {
  color: #fff;
  background: var(--github);
}

.source-badge.source-internal {
  color: var(--accent-deep);
  background: var(--accent-soft);
}

.candidate-meta {
  justify-content: flex-end;
  flex-wrap: wrap;
  color: var(--faint);
  font-size: 9px;
}

.candidate-meta span + span::before {
  content: "/";
  margin-right: 6px;
  color: var(--line-strong);
}

.tool-candidate strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.candidate-why {
  display: -webkit-box;
  overflow: hidden;
  min-height: 34px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.candidate-foot {
  justify-content: space-between;
  gap: 8px;
  color: var(--faint);
  font-size: 9px;
}

.candidate-foot > span:last-child {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.candidate-foot svg {
  width: 10px;
  height: 10px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.external-notice {
  margin: 9px 0 0;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.55;
}

.narrative {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.narrative-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
  transition: background .16s var(--ease);
}

.narrative-head::-webkit-details-marker {
  display: none;
}

.narrative-head:hover {
  background: var(--accent-pale);
}

.narrative[open] .narrative-head {
  border-bottom: 1px dashed var(--line);
}

.narrative-toggle {
  margin-left: auto;
  color: var(--accent-deep);
  font-size: 11px;
  font-weight: 650;
}

.narrative[open] .narrative-toggle {
  font-size: 0;
}

.narrative[open] .narrative-toggle::after {
  content: "收起";
  font-size: 11px;
}

.narrative-meta {
  min-width: 0;
  color: var(--faint);
  font-size: 11px;
}

.narrative-body {
  padding: 16px 22px 18px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.85;
  overflow-wrap: anywhere;
}

.markdown > :first-child {
  margin-top: 0;
}

.markdown > :last-child {
  margin-bottom: 0;
}

.markdown p {
  margin: 0 0 12px;
}

.markdown ul,
.markdown ol {
  margin: 8px 0 13px;
  padding-left: 1.45em;
}

.markdown li {
  margin: 4px 0;
}

.markdown li::marker {
  color: #b96c4d;
}

.markdown h1,
.markdown h2,
.markdown h3 {
  margin: 18px 0 8px;
  color: var(--ink);
  font-family: var(--display);
  line-height: 1.45;
}

.markdown h1 {
  font-size: 19px;
}

.markdown h2 {
  font-size: 16px;
}

.markdown h3 {
  font-size: 14px;
}

.markdown strong {
  color: var(--ink);
  font-weight: 650;
}

.markdown code {
  padding: 1px 5px;
  border-radius: 5px;
  color: var(--accent-deep);
  background: var(--accent-pale);
  font-size: .92em;
}

.markdown pre {
  padding: 12px 14px;
  border-radius: 10px;
  background: #2e231e;
  color: #f4e9e2;
  overflow-x: auto;
}

.markdown pre code {
  padding: 0;
  color: inherit;
  background: transparent;
}

.markdown blockquote {
  margin: 12px 0;
  padding: 2px 0 2px 12px;
  border-left: 3px solid var(--line-strong);
  color: var(--muted);
}

.result-followups {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.result-back {
  display: flex;
  justify-content: center;
  margin-top: 22px;
}

.ghost-button {
  padding: 8px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--paper);
  font-size: 13px;
  cursor: pointer;
  transition: border-color .16s var(--ease), color .16s var(--ease);
}

.ghost-button:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
}

.automation-dialog {
  width: min(560px, calc(100% - 28px));
  max-height: min(760px, calc(100vh - 32px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  color: var(--ink);
  background: #fffdfb;
  box-shadow: 0 30px 90px rgba(55, 30, 20, .28);
  overflow: auto;
}

.automation-dialog::backdrop {
  background: rgba(48, 30, 23, .34);
  backdrop-filter: blur(3px);
}

.automation-form {
  padding: 22px;
}

.automation-dialog-head {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.automation-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: var(--accent-deep);
  background: var(--accent-soft);
}

.automation-mark svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.automation-dialog-head h2 {
  margin: -2px 0 3px;
  font-family: var(--display);
  font-size: 20px;
  line-height: 1.3;
}

.automation-dialog-head p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.dialog-close {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  font-size: 20px;
  line-height: 24px;
  cursor: pointer;
}

.dialog-close:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  background: var(--canvas);
}

.automation-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 20px 0 0;
  padding: 0;
  border: 0;
}

.automation-options legend {
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}

.automation-option {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  cursor: pointer;
  transition: border-color .16s var(--ease), background .16s var(--ease), box-shadow .16s var(--ease);
}

.automation-option:hover {
  border-color: var(--line-strong);
}

.automation-option:has(input:checked) {
  border-color: rgba(207, 66, 40, .48);
  background: linear-gradient(90deg, var(--accent-pale), #fff);
  box-shadow: inset 3px 0 0 var(--accent);
}

.automation-option:has(input:focus-visible) {
  outline: 3px solid rgba(244, 121, 74, .22);
  outline-offset: 2px;
}

.automation-option.is-unavailable {
  opacity: .48;
  cursor: not-allowed;
  background: var(--canvas);
}

.automation-option > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.automation-option-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: var(--ink-soft);
  background: var(--canvas);
}

.automation-option:has(input:checked) .automation-option-icon {
  color: var(--accent-deep);
  background: var(--accent-soft);
}

.automation-option-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.automation-option > span:nth-child(3) {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.automation-option b {
  color: var(--ink);
  font-size: 12px;
}

.automation-option small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.recommendation-tag {
  align-self: start;
  margin-top: 2px;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--accent-deep);
  background: var(--accent-soft);
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.recommendation-tag[hidden] {
  display: none;
}

.automation-guard {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-left: 3px solid #dfb37a;
  color: var(--muted);
  background: #fffbf3;
  font-size: 10px;
  line-height: 1.6;
}

.automation-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.automation-dialog-actions .ghost-button {
  padding: 8px 16px;
}

.automation-save {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #d75a35, var(--accent));
  font-weight: 700;
  cursor: pointer;
}

.automation-save:hover:not(:disabled) {
  background: linear-gradient(135deg, #cb4c2c, var(--accent-deep));
}

.automation-save:disabled {
  opacity: .55;
  cursor: wait;
}

.automation-save svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dialog-status {
  margin: 12px 0 0;
  padding: 8px 10px;
  border-radius: 9px;
  color: var(--accent-deep);
  background: var(--accent-pale);
  font-size: 10px;
}

.dialog-status.is-error {
  color: #a93422;
  background: #fff1ec;
}

.dialog-status[hidden] {
  display: none;
}

.foot {
  padding: 18px 20px 26px;
  color: var(--faint);
  font-size: 11px;
  text-align: center;
}

@media (max-width: 640px) {
  .topbar {
    padding: 12px 16px;
  }

  .topnav a:not(:first-child) {
    display: none;
  }

  .stage {
    width: calc(100% - 28px);
  }

  .hero {
    padding-top: 6vh;
  }

  .goal-box {
    flex-direction: column;
    align-items: stretch;
    border-radius: 18px;
  }

  .goal-submit {
    justify-content: center;
    border-radius: 12px;
  }

  .plan-head,
  .external-shelf {
    padding-right: 15px;
    padding-left: 15px;
  }

  .plan-brief {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .plan-brief-lead {
    padding-right: 0;
  }

  .plan-brief-context {
    padding-top: 10px;
    padding-left: 0;
    border-top: 1px solid rgba(238, 225, 218, .85);
    border-left: 0;
  }

  .plan-analysis,
  .plan-workstreams,
  .plan-contract,
  .plan-revise {
    padding-right: 15px;
    padding-left: 15px;
  }

  .plan-contract-head,
  .plan-revise-head {
    flex-direction: column;
    gap: 5px;
  }

  .plan-contract-head small {
    text-align: left;
  }

  .contract-metrics {
    grid-template-columns: 1fr;
  }

  .contract-kicker {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .contract-metric,
  .contract-metric:first-child {
    padding: 8px 0;
  }

  .contract-metric + .contract-metric {
    border-top: 1px solid rgba(220, 200, 191, .82);
    border-left: 0;
  }

  .contract-milestones {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .contract-milestones li {
    padding-right: 0;
  }

  .contract-milestones li:not(:last-child)::after {
    top: 24px;
    bottom: -8px;
    left: 10px;
    width: 1px;
    height: auto;
  }

  .milestone-copy small {
    -webkit-line-clamp: 3;
  }

  .clarification-head {
    flex-direction: column;
    gap: 3px;
  }

  .clarification-head small {
    text-align: left;
  }

  .clarification-groups {
    grid-template-columns: 1fr;
  }

  .clarification-group > p {
    min-height: 0;
  }

  .clarification-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .clarification-actions > button {
    width: 100%;
  }

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

  .contract-next-label,
  .contract-next-copy {
    grid-column: 1 / -1;
  }

  .contract-next time {
    padding-left: 1px;
  }

  .plan-analysis-head,
  .plan-workstreams-head {
    flex-direction: column;
    gap: 6px;
  }

  .plan-analysis-head small {
    max-width: none;
    text-align: left;
  }

  .analysis-grid,
  .workstream-grid {
    grid-template-columns: 1fr;
  }

  .analysis-chain,
  .analysis-gates {
    flex-direction: column;
    gap: 5px;
  }

  .plan-steps,
  .plan-actions {
    padding-right: 15px;
    padding-left: 15px;
  }

  .plan-step-top {
    flex-direction: column;
    gap: 6px;
  }

  .plan-step-meta {
    justify-content: flex-start;
  }

  .plan-step-outcome {
    grid-template-columns: 1fr;
  }

  .plan-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .plan-action-buttons {
    justify-content: flex-start;
  }

  .plan-revise-box {
    align-items: stretch;
    flex-direction: column;
  }

  .plan-revise-box button {
    justify-content: center;
  }

  .plan-entry-link {
    width: 100%;
    justify-content: center;
  }

  .automation-banner {
    padding-right: 15px;
    padding-left: 15px;
  }

  .automation-banner-card {
    align-items: flex-start;
  }

  .execution-console {
    padding-right: 15px;
    padding-left: 15px;
  }

  .execution-console-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .execution-step {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .execution-step-actions {
    grid-column: 2;
    justify-content: flex-start;
  }

  .execution-footnote {
    padding-left: 0;
  }

  .automation-form {
    padding: 18px;
  }

  .automation-dialog-head {
    grid-template-columns: 34px minmax(0, 1fr) auto;
  }

  .automation-dialog-head h2 {
    font-size: 18px;
  }

  .source-ribbon-label {
    width: 100%;
  }

  .external-head {
    flex-direction: column;
    gap: 7px;
  }

  .candidate-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
