:root {
  color-scheme: light;
  --ink: #171847;
  --ink-soft: #3d3d5d;
  --muted: #6d7280;
  --line: #e5e8ee;
  --brand: #f35b00;
  --brand-dark: #c74800;
  --blue: #000143;
  --surface: #f7f8fb;
  --paper: #ffffff;
  --soft-blue: #eef3f8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Open Sans", Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--surface);
  line-height: 1.6;
}

a {
  color: inherit;
}

.wrap {
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(0, 1, 67, 0.1);
  backdrop-filter: blur(12px);
}

.header-inner {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
}

.brand img {
  width: 180px;
  max-width: 44vw;
  height: auto;
  display: block;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-nav a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  border-radius: 4px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
}

.site-nav a:hover {
  color: var(--brand);
  background: #fff4ed;
}

.hero {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  padding: 72px 0 54px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(38px, 6vw, 70px);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: 0;
}

.lead {
  max-width: 740px;
  margin: 22px 0 0;
  color: var(--ink-soft);
  font-size: 20px;
}

.content {
  padding: 48px 0 76px;
}

.section-head {
  max-width: 760px;
  margin-bottom: 28px;
}

h2 {
  margin: 0;
  color: var(--blue);
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: 0;
}

.section-head p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 4px;
  background: var(--brand);
  color: #ffffff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

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

.site-footer {
  background: var(--blue);
  color: #ffffff;
  padding: 42px 0 26px;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: start;
}

.footer-brand {
  color: #ffffff;
  text-decoration: none;
  font-size: 22px;
  font-weight: 800;
}

.site-footer p {
  max-width: 520px;
  margin: 10px 0 0;
  color: #d9dce7;
}

.footer-contact {
  display: grid;
  gap: 4px;
  color: #d9dce7;
  font-size: 14px;
  text-align: right;
}

.footer-contact strong,
.footer-links a {
  color: #ffffff;
  font-weight: 700;
}

.footer-contact strong {
  font-style: normal;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  color: #d9dce7;
  font-size: 13px;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

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

.home-card {
  min-height: 170px;
  display: grid;
  align-content: end;
  gap: 8px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 18px 45px rgba(0, 1, 67, 0.05);
}

.home-card:hover {
  border-color: rgba(243, 91, 0, 0.45);
}

.home-card span {
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.home-card strong {
  color: var(--blue);
  font-size: 26px;
  line-height: 1.15;
}

.groups {
  display: grid;
  gap: 28px;
}

.group {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 18px 45px rgba(0, 1, 67, 0.06);
}

.group-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 26px;
  border-bottom: 1px solid var(--line);
}

.group-title {
  margin: 0;
  color: var(--blue);
  font-size: 22px;
  line-height: 1.2;
  font-weight: 700;
}

.group-description {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.count {
  flex: 0 0 auto;
  min-width: 92px;
  padding: 7px 10px;
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink-soft);
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

.doc-list {
  display: grid;
}

.doc-row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) 110px 120px auto;
  gap: 18px;
  align-items: center;
  padding: 18px 26px;
  border-bottom: 1px solid var(--line);
}

.doc-row:last-child {
  border-bottom: 0;
}

.doc-image,
.doc-image-placeholder {
  width: 72px;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.doc-image {
  display: block;
  object-fit: contain;
}

.doc-image-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.doc-title {
  overflow-wrap: anywhere;
  color: var(--blue);
  font-weight: 700;
}

.doc-description,
.doc-filename {
  margin-top: 3px;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 13px;
}

.meta {
  color: var(--muted);
  font-size: 14px;
}

.empty {
  padding: 22px 26px;
  color: var(--muted);
  font-size: 15px;
}

.help {
  margin-top: 24px;
  padding: 22px 24px;
  background: var(--blue);
  color: #ffffff;
  border-radius: 8px;
}

.help p {
  margin: 0;
}

.help a,
.help strong {
  color: #ffffff;
  font-weight: 700;
}

.admin-entry {
  margin-top: 18px;
  text-align: right;
  font-size: 13px;
}

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

.admin-entry a:hover {
  color: var(--brand);
  text-decoration: underline;
}

.apply-layout {
  max-width: 860px;
}

.process {
  display: grid;
  gap: 18px;
}

.process-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 18px 45px rgba(0, 1, 67, 0.05);
}

.step-number {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--blue);
  color: #ffffff;
  font-weight: 800;
}

.process-item h3 {
  margin: 0;
  color: var(--blue);
  font-size: 20px;
  line-height: 1.2;
}

.process-item p,
.process-item ul {
  margin: 10px 0 0;
  color: var(--ink-soft);
}

.process-item ul {
  padding-left: 20px;
}

.process-item li + li {
  margin-top: 6px;
}

.manage-layout {
  max-width: 960px;
}

.manage-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.manage-panel {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 18px 45px rgba(0, 1, 67, 0.05);
}

.manage-panel + .manage-panel {
  margin-top: 24px;
}

.manage-panel h2 {
  font-size: 28px;
}

.manage-panel code,
.manage-panel pre {
  font-family: Consolas, "Courier New", monospace;
}

.manage-panel pre {
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 16px 0 0;
  padding: 16px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink-soft);
}

.manage-form {
  display: grid;
  gap: 18px;
}

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

.manage-form label {
  display: grid;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 700;
}

.manage-form input,
.manage-form select,
.manage-form textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  background: #ffffff;
  font: inherit;
}

.manage-form textarea {
  resize: vertical;
}

.notice {
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 6px;
  font-weight: 700;
}

.notice-success {
  border: 1px solid #9fd5b3;
  background: #effaf3;
  color: #145a2d;
}

.notice-error {
  border: 1px solid #e5a5a5;
  background: #fff1f1;
  color: #8a1f1f;
}

.debug-panel {
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink-soft);
  font-size: 13px;
}

.debug-panel summary {
  cursor: pointer;
  color: var(--blue);
  font-weight: 800;
}

.debug-panel dl {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
}

.debug-panel div {
  overflow-wrap: anywhere;
}

.manage-list {
  display: grid;
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.manage-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.manage-row strong,
.manage-row span {
  display: block;
}

.manage-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.text-button,
.danger-button {
  min-height: 38px;
  border: 0;
  border-radius: 4px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.text-button {
  padding: 0;
  color: var(--brand);
  background: transparent;
}

.danger-button {
  padding: 0 14px;
  color: #ffffff;
  background: #a52828;
}

.danger-button:hover {
  background: #7f1e1e;
}

.empty-inline {
  margin: 16px 0 0;
  color: var(--muted);
}

@media (max-width: 940px) {
  .doc-row {
    grid-template-columns: 84px minmax(0, 1fr) auto;
    gap: 14px 18px;
  }

  .meta {
    grid-column: 2 / -1;
  }

  .doc-row .button {
    grid-column: 2 / -1;
    width: min(220px, 100%);
  }
}

@media (max-width: 700px) {
  .header-inner,
  .footer-grid,
  .footer-bottom,
  .group-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-inner {
    min-height: auto;
    padding: 18px 0;
  }

  .site-nav {
    width: 100%;
    justify-content: flex-start;
  }

  .site-nav a {
    padding: 0 10px;
  }

  .hero-inner {
    padding: 50px 0 42px;
  }

  .footer-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .footer-contact {
    text-align: left;
  }

  .footer-bottom {
    display: flex;
  }

  .doc-row {
    grid-template-columns: 72px minmax(0, 1fr);
    padding: 18px;
  }

  .meta,
  .doc-row .button {
    grid-column: 1 / -1;
  }

  .doc-row .button {
    width: 100%;
    margin-top: 6px;
  }

  .count {
    width: 100%;
    text-align: left;
  }

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

  .form-grid,
  .manage-row,
  .home-grid {
    grid-template-columns: 1fr;
  }
}
