:root {
  color-scheme: light;
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-muted: #eef4f8;
  --text: #17202a;
  --muted: #5c6875;
  --line: #d9e2ec;
  --brand: #176b87;
  --brand-strong: #124f63;
  --accent: #b46b38;
  --success: #19735a;
  --danger: #b23b3b;
  --focus: #7aa7ff;
  --shadow: 0 16px 34px rgba(23, 32, 42, 0.08);
  --radius: 8px;
  --max: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0;
}

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  color: var(--brand-strong);
  text-decoration: underline;
}

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

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

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

.nav {
  width: min(100% - 32px, var(--max));
  min-height: 66px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  white-space: nowrap;
}

.brand-mark {
  width: 34px;
  height: 34px;
  position: relative;
  display: inline-block;
  border: 2px solid var(--brand);
  border-radius: 7px;
  background: #ffffff;
  color: transparent;
  font-size: 0;
  line-height: 0;
}

.brand-mark::before {
  content: "";
  position: absolute;
  top: 5px;
  right: 5px;
  width: 9px;
  height: 9px;
  border-left: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
  background: #eef4f8;
  clip-path: polygon(0 0, 100% 100%, 0 100%);
}

.brand-mark::after {
  content: "P";
  position: absolute;
  left: 8px;
  bottom: 5px;
  color: var(--brand);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
}

.nav-links a {
  color: var(--muted);
  font-weight: 700;
}

.nav-links a[aria-current="page"] {
  color: var(--brand);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: currentColor;
}

.container {
  width: min(100% - 32px, var(--max));
  margin: 0 auto;
}

.main {
  padding: 34px 0 56px;
}

.hero,
.tool-hero {
  padding: 28px 0 18px;
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(300px, 1.05fr);
  gap: 34px;
  align-items: start;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: 0;
}

h1 {
  max-width: 780px;
  margin: 0 0 16px;
  font-size: clamp(36px, 7vw, 62px);
}

h2 {
  margin: 0 0 18px;
  font-size: 28px;
}

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

.lead {
  max-width: 720px;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 19px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.button,
button.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--brand);
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}

.button:hover {
  background: var(--brand-strong);
  color: #ffffff;
  text-decoration: none;
}

.button.secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

.button.secondary:hover {
  border-color: var(--brand);
  background: var(--surface-muted);
  color: var(--brand-strong);
}

.button:disabled,
button.button:disabled {
  background: #b7c4ce;
  color: #ffffff;
  cursor: not-allowed;
}

.section {
  padding: 34px 0;
}

.section.tight {
  padding-top: 16px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.section-head p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
}

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

.tool-card {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(23, 32, 42, 0.04);
}

.tool-card:hover {
  border-color: rgba(23, 107, 135, 0.55);
  text-decoration: none;
  box-shadow: var(--shadow);
}

.tool-card p {
  margin: 0;
  color: var(--muted);
}

.tool-card .tag {
  display: inline-flex;
  align-self: start;
  margin-bottom: 14px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.privacy-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(25, 115, 90, 0.22);
  border-radius: var(--radius);
  background: #edf8f4;
  color: var(--success);
  font-weight: 700;
}

.tool-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  align-items: start;
}

.tool-panel,
.side-panel,
.content-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(23, 32, 42, 0.04);
}

.tool-panel {
  padding: 22px;
}

.side-panel,
.content-panel {
  padding: 18px;
}

.drop-zone {
  min-height: 180px;
  display: grid;
  place-items: center;
  padding: 26px;
  border: 2px dashed #9bb1c2;
  border-radius: var(--radius);
  background: #fbfdff;
  text-align: center;
  transition: border-color 160ms ease, background 160ms ease;
}

.drop-zone.is-dragging {
  border-color: var(--brand);
  background: #edf7fb;
}

.drop-title {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
}

.drop-subtitle {
  margin: 6px 0 14px;
  color: var(--muted);
}

.file-input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

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

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-size: 13px;
  font-weight: 800;
}

.field input,
.field select {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--text);
  padding: 8px 10px;
}

.file-list {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.file-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
}

.file-content {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.file-preview {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.file-details {
  min-width: 0;
}

.file-name {
  overflow-wrap: anywhere;
  font-weight: 800;
}

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

.file-actions {
  display: flex;
  gap: 6px;
}

.page-sorter {
  margin-top: 18px;
}

.page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.page-card {
  min-width: 0;
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
  cursor: grab;
  user-select: none;
}

.page-card:active {
  cursor: grabbing;
}

.page-card.is-dragging-card {
  opacity: 0.55;
}

.page-card.is-drop-target {
  border-color: var(--brand);
  background: #edf7fb;
  box-shadow: 0 0 0 3px rgba(23, 107, 135, 0.12);
}

.page-thumb {
  aspect-ratio: 0.72;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.page-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.page-thumb-loading {
  padding: 8px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.page-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.page-card-footer span:first-child {
  color: var(--text);
}

.page-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.small-button {
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.small-button:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.small-button:disabled {
  color: #9aa8b5;
  cursor: not-allowed;
}

.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.tool-status,
.result-box {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface-muted);
  color: var(--muted);
}

.tool-status[data-state="error"] {
  background: #fff1f1;
  color: var(--danger);
}

.tool-status[data-state="success"] {
  background: #edf8f4;
  color: var(--success);
}

.result-box {
  display: none;
}

.result-box.is-visible {
  display: block;
}

.result-box h3 {
  margin-bottom: 6px;
}

.steps,
.faq-list,
.related-list,
.plain-list {
  display: grid;
  gap: 12px;
}

.step,
.faq-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.step p,
.faq-item p {
  margin: 0;
  color: var(--muted);
}

.related-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.related-list a {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-weight: 800;
}

.related-list a:hover {
  border-color: var(--brand);
  text-decoration: none;
}

.content-page {
  max-width: 820px;
}

.content-page p,
.content-page li {
  color: var(--muted);
}

.content-panel + .content-panel {
  margin-top: 16px;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.footer-inner {
  width: min(100% - 32px, var(--max));
  margin: 0 auto;
  padding: 26px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 900px) {
  .hero-layout,
  .tool-shell {
    grid-template-columns: 1fr;
  }

  .tool-grid,
  .related-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .nav {
    min-height: 60px;
  }

  .nav-toggle {
    display: inline-grid;
    place-items: center;
  }

  .nav-links {
    position: absolute;
    inset: 60px 16px auto 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links a {
    padding: 13px 14px;
    border-bottom: 1px solid var(--line);
  }

  .nav-links a:last-child {
    border-bottom: 0;
  }

  .hero,
  .tool-hero {
    padding-top: 20px;
  }

  h1 {
    font-size: 36px;
  }

  .lead {
    font-size: 17px;
  }

  .tool-grid,
  .related-list,
  .tool-options {
    grid-template-columns: 1fr;
  }

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

  .file-content {
    grid-template-columns: 48px 1fr;
  }

  .file-preview {
    width: 48px;
    height: 48px;
  }

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

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}
