:root {
  color-scheme: light;
  --bg: #f7faf7;
  --paper: #ffffff;
  --paper-soft: #f1f5f2;
  --ink: #17201b;
  --muted: #5f6f65;
  --line: #dce5df;
  --line-strong: #b7c7bd;
  --green: #1f8f5f;
  --green-dark: #12623f;
  --blue: #2c6fbb;
  --amber: #c7861f;
  --red: #b4473c;
  --shadow: 0 18px 44px rgba(23, 32, 27, 0.08);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "YuGothic", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(247, 250, 247, 0.96) 320px),
    var(--bg);
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

a {
  color: var(--green-dark);
  text-underline-offset: 0.18em;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  padding: 12px clamp(16px, 4vw, 48px);
  background: rgba(247, 250, 247, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

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

.brand img {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
}

.brand span {
  overflow-wrap: anywhere;
}

.topbar__signals {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.topbar__signals span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 38px 0 56px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: clamp(20px, 4vw, 48px);
  align-items: end;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 800;
}

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

h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 72px);
  line-height: 0.98;
  letter-spacing: 0;
}

.intro__copy p:last-child {
  max-width: 720px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(15px, 2vw, 18px);
  line-height: 1.85;
}

.intro__ledger {
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.78);
}

.intro__ledger div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

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

.intro__ledger span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.intro__ledger strong {
  font-size: 16px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.1fr);
  gap: 20px;
  align-items: start;
}

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.panel__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.panel__label {
  margin: 0 0 4px;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
}

.panel h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.25;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 20px;
}

label {
  display: grid;
  gap: 8px;
  min-width: 0;
}

label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.field-wide {
  grid-column: 1 / -1;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.7;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(31, 143, 95, 0.24);
  outline-offset: 2px;
}

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 20px 20px;
}

.primary-button,
.secondary-button,
.copy-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 800;
}

.primary-button,
.secondary-button {
  min-height: 44px;
  padding: 10px 14px;
}

.primary-button {
  background: var(--green);
  color: #fff;
}

.primary-button:hover {
  background: var(--green-dark);
}

.secondary-button {
  background: var(--paper-soft);
  border-color: var(--line);
  color: var(--ink);
}

.secondary-button:hover,
.icon-button:hover,
.copy-button:hover {
  border-color: var(--line-strong);
}

.icon-button {
  width: 40px;
  height: 40px;
  background: var(--paper-soft);
  border-color: var(--line);
  color: var(--ink);
}

.copy-button {
  min-height: 34px;
  padding: 7px 10px;
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
  font-size: 13px;
  white-space: nowrap;
}

.copy-label {
  display: inline-block;
  min-width: 4.5em;
  text-align: left;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.result-panel {
  position: sticky;
  top: 88px;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 20px 0;
}

.status-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.status-strip .is-alert {
  background: #fff7e7;
  border-color: #edd2a3;
  color: #8b5a13;
}

.warning-box {
  margin: 14px 20px 0;
  padding: 12px 14px;
  border-left: 4px solid var(--amber);
  background: #fff8ea;
  color: #6f4b12;
  line-height: 1.7;
  font-size: 14px;
}

.result-block {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.result-block:last-child {
  border-bottom: 0;
}

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

.result-block h3 {
  margin: 0;
  font-size: 15px;
}

.copy-surface {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #fbfdfb;
  white-space: pre-wrap;
  line-height: 1.8;
  font-size: 14px;
}

.copy-surface--body {
  min-height: 168px;
}

.notice {
  margin-top: 26px;
  padding: 18px 0 0;
  border-top: 2px solid var(--ink);
}

.notice h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.notice p {
  max-width: 900px;
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 14px;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.footer nav {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.page--document {
  max-width: 880px;
}

.document {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: clamp(22px, 5vw, 48px);
  box-shadow: var(--shadow);
}

.document h1 {
  font-size: clamp(32px, 6vw, 56px);
  margin-bottom: 16px;
}

.document h2 {
  margin: 28px 0 8px;
  font-size: 20px;
}

.document p {
  color: var(--muted);
  line-height: 1.9;
}

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

  .result-panel {
    position: static;
  }
}

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

  .topbar__signals {
    justify-content: flex-start;
  }

  .page {
    width: min(100% - 24px, 1180px);
    padding-top: 28px;
  }

  .field-grid {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .panel__heading,
  .button-row,
  .result-block {
    padding-left: 16px;
    padding-right: 16px;
  }

  .status-strip {
    padding-left: 16px;
    padding-right: 16px;
  }

  .warning-box {
    margin-left: 16px;
    margin-right: 16px;
  }

  .intro__ledger div {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 12px;
  }

  .result-block__header {
    align-items: flex-start;
    flex-direction: column;
  }

  .copy-button {
    width: 100%;
  }
}
