:root {
  --bg: #f6f8f5;
  --surface: #ffffff;
  --surface-soft: #eef3ed;
  --ink: #14221d;
  --muted: #5f6d66;
  --line: #dbe4dc;
  --accent: #b86825;
  --accent-dark: #8f481a;
  --green: #16765b;
  --green-dark: #0f5d46;
  --warning: #9b521b;
  --shadow: 0 18px 48px rgba(20, 34, 29, 0.1);
  --radius: 8px;
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
}

body.printing {
  background: #ffffff;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 42px;
  background: rgba(246, 248, 245, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 820;
}

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

.site-header nav,
.site-footer nav {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 720;
}

.site-header nav a:hover,
.site-footer nav a:hover {
  color: var(--ink);
}

.header-action,
.primary-link,
.text-link,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 15px;
  border: 0;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 790;
  line-height: 1;
  cursor: pointer;
}

.header-action,
.primary-link,
button {
  background: var(--ink);
  color: #ffffff;
}

button:hover,
.header-action:hover,
.primary-link:hover {
  background: #263830;
}

.text-link {
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
}

.secondary {
  background: var(--accent);
}

.secondary:hover {
  background: var(--accent-dark);
}

main {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
}

.hero,
.page-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 44px;
  align-items: end;
  padding: 66px 0 44px;
}

.page-hero.compact {
  grid-template-columns: minmax(0, 920px);
  padding-bottom: 26px;
}

.page-hero.text-only {
  min-height: 420px;
  align-items: start;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  max-width: 850px;
  font-size: clamp(42px, 6vw, 76px);
  line-height: 0.98;
  letter-spacing: 0;
  font-weight: 850;
}

.page-hero h1 {
  font-size: clamp(38px, 5.3vw, 68px);
}

.hero p,
.page-hero p {
  max-width: 720px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.intent {
  color: var(--green-dark) !important;
  font-weight: 730;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.summary-card,
.form-panel,
.preview-panel,
.guide-card,
.tool-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.summary-card {
  padding: 24px;
}

.summary-card span,
.preview-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
  text-transform: uppercase;
}

.summary-card strong {
  display: block;
  margin-top: 18px;
  font-size: 26px;
  line-height: 1.1;
}

.summary-card p {
  margin-top: 16px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.summary-card .primary-link {
  margin-top: 18px;
}

.tool-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 10px 0 42px;
}

.tool-card {
  display: grid;
  gap: 12px;
  min-height: 160px;
  padding: 22px;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease;
}

.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 54px rgba(20, 34, 29, 0.14);
}

.tool-card span {
  font-size: 20px;
  font-weight: 820;
}

.tool-card p,
.content-band p,
.plain-list {
  color: var(--muted);
  line-height: 1.55;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: 16px;
  padding: 18px 0 58px;
}

.form-panel,
.preview-panel,
.guide-card {
  padding: 24px;
}

.section-title,
.preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.section-title h2,
.content-band h2,
.guide-card h2 {
  font-size: 28px;
  line-height: 1.05;
}

.section-title p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 14px;
}

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

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

input,
select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdf9;
  color: var(--ink);
  font-size: 14px;
  font-weight: 680;
}

input:focus,
select:focus {
  outline: 2px solid rgba(22, 118, 91, 0.2);
  border-color: var(--green);
}

.items-head,
.item-row {
  display: grid;
  grid-template-columns: 1.5fr 0.7fr 0.7fr 0.55fr 0.55fr 0.7fr 44px;
  gap: 10px;
}

.items-head {
  margin: 22px 0 8px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
  text-transform: uppercase;
}

.items {
  display: grid;
  gap: 10px;
}

.item-row {
  align-items: end;
  padding: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.icon-button {
  width: 42px;
  min-height: 42px;
  padding: 0;
  background: #ffffff;
  color: var(--warning);
  border: 1px solid var(--line);
}

.icon-button:hover {
  background: #fff4ea;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.actions-row button {
  flex: 1 1 160px;
}

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

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

.preview-panel {
  align-self: start;
  position: sticky;
  top: 88px;
}

.preview-head strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
}

.doc-preview {
  display: grid;
  gap: 16px;
  margin-top: 14px;
}

.document-sheet {
  padding: 18px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.document-sheet h3 {
  font-size: 20px;
  margin-bottom: 10px;
}

.doc-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 13px;
}

.doc-meta strong {
  color: var(--ink);
}

.doc-preview table {
  width: 100%;
  border-collapse: collapse;
}

.doc-preview th,
.doc-preview td {
  padding: 9px 8px 9px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 12px;
  line-height: 1.3;
}

.doc-preview th:last-child,
.doc-preview td:last-child {
  text-align: right;
  padding-right: 0;
}

.item-detail {
  display: grid;
  gap: 3px;
}

.item-detail strong {
  font-size: 13px;
}

.item-detail span {
  color: var(--muted);
  font-size: 11px;
}

.total-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  font-size: 16px;
  font-weight: 820;
}

.checks {
  display: grid;
  gap: 8px;
}

.check {
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 720;
}

.check.ok {
  color: #0f5c46;
  background: #e2f2eb;
}

.check.warn {
  color: #8a3e15;
  background: #fff0e5;
}

.content-band,
.guide-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 42px;
  padding: 54px 0 68px;
  border-top: 1px solid var(--line);
}

.compact-band {
  padding: 38px 0 48px;
}

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

.link-list a {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition:
    border-color 150ms ease,
    transform 150ms ease;
}

.link-list a:hover {
  border-color: rgba(20, 34, 29, 0.34);
  transform: translateY(-1px);
}

.link-list strong {
  font-size: 17px;
  line-height: 1.25;
}

.link-list span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.plain-list {
  margin: 0;
  padding-left: 20px;
}

.plain-list li + li {
  margin-top: 10px;
}

.guide-layout {
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
  border-top: 0;
}

.guide-card .plain-list {
  margin-top: 18px;
}

.faq-section {
  padding: 44px 0 52px;
  border-top: 1px solid var(--line);
}

.faq-section h2 {
  font-size: 30px;
  line-height: 1.05;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.faq-grid article {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.faq-grid h3 {
  font-size: 18px;
  line-height: 1.25;
}

.faq-grid p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 30px 42px;
  background: var(--ink);
  color: #ffffff;
}

.site-footer p {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

.site-footer nav {
  color: rgba(255, 255, 255, 0.75);
}

.directory-badge {
  display: inline-flex;
  align-items: center;
  min-height: 55px;
}

.directory-badge img {
  display: block;
  width: 175px;
  height: 55px;
}

@media (max-width: 1080px) {
  .hero,
  .workspace,
  .content-band,
  .guide-layout,
  .faq-grid {
    grid-template-columns: 1fr;
  }

  .preview-panel {
    position: static;
  }
}

@media (max-width: 820px) {
  .site-header {
    position: static;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: auto;
    padding: 16px 18px;
    gap: 14px;
  }

  .site-header nav {
    grid-column: 1 / -1;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .header-action {
    min-height: 40px;
    padding: 0 12px;
    white-space: nowrap;
  }

  main {
    width: calc(100vw - 32px);
    max-width: 1180px;
    overflow: hidden;
  }

  .hero,
  .page-hero {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    padding-top: 44px;
    overflow: hidden;
  }

  .page-hero.compact {
    grid-template-columns: minmax(0, 1fr);
  }

  h1,
  .page-hero h1 {
    max-width: 100%;
    font-size: clamp(29px, 7.8vw, 34px);
    line-height: 1.08;
    overflow-wrap: anywhere;
  }

  .hero p,
  .page-hero p {
    max-width: 100%;
    font-size: 15px;
    overflow-wrap: break-word;
  }

  .tool-strip,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .section-title,
  .preview-head {
    align-items: stretch;
    flex-direction: column;
  }

  .section-title .secondary,
  .preview-head button {
    align-self: flex-start;
  }

  .form-panel,
  .preview-panel,
  .guide-card,
  .summary-card {
    padding: 20px;
  }

  .items-head {
    display: none;
  }

  .item-row {
    grid-template-columns: 1fr;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 28px 18px;
  }
}

@media print {
  .site-header,
  .form-panel,
  .checks,
  .preview-head,
  .site-footer,
  .page-hero,
  .content-band {
    display: none !important;
  }

  body,
  main,
  .workspace,
  .preview-panel,
  .doc-preview,
  .document-sheet {
    display: block;
    width: auto;
    margin: 0;
    padding: 0;
    background: #ffffff;
    border: 0;
    box-shadow: none;
  }

  .document-sheet {
    break-after: page;
    padding: 22px;
  }
}
