:root {
  --ink: #18201d;
  --muted: #66716b;
  --subtle: #8a948e;
  --line: #d9e0dc;
  --surface: #ffffff;
  --soft: #f5f7f5;
  --field: #fbfcfb;
  --green: #17764f;
  --green-strong: #0f5b3b;
  --mint: #dff3ea;
  --amber: #b56a12;
  --rose: #a33d55;
  --blue: #2f6f9f;
  --shadow: 0 18px 48px rgba(24, 32, 29, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, #f7faf7 0%, #ffffff 38%, #f5f7f5 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

button,
select,
input,
textarea,
a {
  min-width: 0;
}

a {
  color: var(--green);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 13px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(217, 224, 220, 0.9);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 760;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 0.76rem;
  letter-spacing: 0;
}

.nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 0.92rem;
  white-space: nowrap;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
}

.nav a:hover {
  color: var(--ink);
}

.workspace {
  padding: clamp(30px, 5vw, 62px) clamp(18px, 4vw, 56px) 34px;
}

.workspace-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 410px);
  gap: 32px;
  align-items: end;
  max-width: 1260px;
  margin: 0 auto 20px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 820;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p,
summary {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(2rem, 4.4vw, 3.8rem);
  line-height: 1.03;
  letter-spacing: 0;
}

.lede {
  max-width: 760px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.58;
}

h2 {
  margin: 0;
  font-size: 1.06rem;
  line-height: 1.25;
}

h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-strip div {
  min-width: 0;
  padding: 16px;
  border-right: 1px solid var(--line);
}

.metric-strip div:last-child {
  border-right: 0;
}

.metric-strip span {
  display: block;
  font-size: 1.42rem;
  font-weight: 830;
}

.metric-strip small {
  color: var(--muted);
}

.trust-strip,
.tool-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 1260px;
  margin: 0 auto 18px;
}

.trust-strip span,
.tool-switcher a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--muted);
  padding: 0 11px;
  font-size: 0.86rem;
  text-decoration: none;
}

.trust-strip span strong {
  color: var(--ink);
}

.tool-switcher a {
  color: var(--ink);
}

.tool-switcher a:hover,
.tool-switcher a.active {
  border-color: rgba(23, 118, 79, 0.35);
  background: var(--mint);
}

.tool-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.16fr) minmax(246px, 0.72fr) minmax(280px, 1.16fr);
  gap: 16px;
  max-width: 1260px;
  margin: 0 auto;
}

.panel,
.timeline-panel,
.note-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 58px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.panel-head.compact {
  min-height: auto;
}

.panel-head p,
.footer,
.page-map p,
.faq-list p,
.note-card p,
.step-list p {
  margin: 0;
  color: var(--muted);
}

.button-row,
.inline-control {
  display: flex;
  gap: 8px;
}

textarea {
  width: 100%;
  min-height: 430px;
  resize: vertical;
  padding: 16px;
  border: 0;
  outline: none;
  background: var(--field);
  color: var(--ink);
  line-height: 1.55;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.9rem;
}

textarea:focus {
  background: #fff;
  box-shadow: inset 0 0 0 2px rgba(23, 118, 79, 0.18);
}

.controls-panel {
  padding-bottom: 8px;
}

.control-group {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.control-group:last-child {
  border-bottom: 0;
}

label {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 720;
}

select,
input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  padding: 0 10px;
}

select:focus,
input:focus {
  outline: 2px solid rgba(23, 118, 79, 0.18);
  outline-offset: 1px;
}

button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  padding: 0 14px;
  font-weight: 760;
  cursor: pointer;
}

button:hover {
  background: var(--green-strong);
}

button.ghost {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

button.ghost:hover {
  background: var(--soft);
}

.inline-control {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) 82px 82px;
}

.timeline-panel {
  max-width: 1260px;
  margin: 16px auto 0;
  overflow: hidden;
}

.timeline {
  display: grid;
  gap: 8px;
  min-height: 116px;
  padding: 18px;
  background: var(--field);
}

.timeline-row {
  position: relative;
  height: 27px;
  overflow: hidden;
  border-radius: 8px;
  background: #eef2ef;
}

.timeline-bar {
  position: absolute;
  top: 5px;
  height: 17px;
  min-width: 2px;
  border-radius: 8px;
  background: var(--green);
}

.timeline-bar:nth-child(3n) {
  background: var(--amber);
}

.timeline-bar:nth-child(4n) {
  background: var(--rose);
}

.timeline-empty {
  color: var(--muted);
}

.content-band {
  padding: 46px clamp(18px, 4vw, 56px);
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.content-band.muted {
  background: var(--soft);
}

.section-head,
.page-map,
.faq-list,
.step-list,
.note-grid,
.prose {
  max-width: 1120px;
  margin: 0 auto;
}

.section-head {
  margin-bottom: 18px;
}

.section-head h2 {
  font-size: clamp(1.45rem, 2.6vw, 2.15rem);
}

.page-map,
.note-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.page-map article,
.note-card {
  min-width: 0;
  min-height: 142px;
  padding: 18px;
}

.page-map article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
}

.page-map a {
  color: inherit;
  text-decoration: none;
}

.page-map a:hover h3,
.footer a {
  color: var(--green);
}

.step-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  counter-reset: steps;
}

.step-list article {
  position: relative;
  min-width: 0;
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.step-list article::before {
  counter-increment: steps;
  content: counter(steps, decimal-leading-zero);
  display: inline-flex;
  margin-bottom: 14px;
  color: var(--green);
  font-weight: 840;
}

.faq-list {
  display: grid;
  gap: 10px;
}

details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px 16px;
}

summary {
  cursor: pointer;
  font-weight: 760;
}

details p {
  margin-top: 10px;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 22px clamp(18px, 4vw, 56px);
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.footer a {
  text-decoration: none;
  font-weight: 760;
}

.prose {
  display: grid;
  gap: 18px;
  line-height: 1.7;
}

.prose h1 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.prose h2 {
  margin-top: 18px;
  font-size: 1.35rem;
}

.prose ul,
.prose ol {
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
}

@media (max-width: 1080px) {
  .workspace-head,
  .tool-grid {
    grid-template-columns: 1fr;
  }

  textarea {
    min-height: 320px;
  }

  .page-map,
  .note-grid,
  .step-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .topbar,
  .footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    width: 100%;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  h1 {
    font-size: 2.08rem;
  }

  .metric-strip,
  .page-map,
  .note-grid,
  .step-list {
    grid-template-columns: 1fr;
  }

  .metric-strip div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metric-strip div:last-child {
    border-bottom: 0;
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .button-row,
  .inline-control {
    width: 100%;
  }

  .inline-control {
    grid-template-columns: 1fr;
  }

  button {
    width: 100%;
  }
}
