:root {
  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --line: #dbe3ee;
  --paper: #f7f9fc;
  --white: #fff;
  --blue: #155eef;
  --blue-dark: #1048bd;
  --blue-soft: #eaf1ff;
  --green: #168653;
  --danger: #b42318;
  --shadow: 0 18px 42px rgba(15, 23, 42, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.site-header { width: min(1180px, calc(100% - 40px)); min-height: 76px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; letter-spacing: -.025em; }
.logo span { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 9px; background: var(--ink); color: var(--white); font-size: 13px; }
nav { display: flex; gap: 20px; }
nav a { color: var(--muted); font-size: 13px; font-weight: 650; text-decoration: none; }
nav a:hover { color: var(--blue); }

main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.hero { min-height: 345px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 44px; align-items: center; padding: 55px 0 45px; }
.eyebrow, .section-kicker { margin: 0 0 10px; color: var(--blue); font-size: 11px; font-weight: 850; letter-spacing: .13em; }
h1, h2, h3 { letter-spacing: -.035em; }
h1 { max-width: 700px; margin: 0; font-size: clamp(37px, 5.1vw, 60px); line-height: 1.03; }
h2 { margin: 0; font-size: clamp(25px, 3vw, 35px); line-height: 1.12; }
h3 { margin: 0; font-size: 17px; }
.lead { max-width: 650px; margin: 18px 0 0; color: var(--ink-soft); font-size: 17px; }
.trust-list { display: flex; flex-wrap: wrap; gap: 13px 22px; margin: 24px 0 0; padding: 0; list-style: none; color: var(--ink-soft); font-size: 13px; font-weight: 650; }
.trust-list span { color: var(--green); font-weight: 900; }
.watermark-visual { position: relative; min-height: 265px; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, #fff, #f0f4fa); box-shadow: var(--shadow); }
.watermark-visual::after { content: "PDF"; position: absolute; right: 25px; bottom: 20px; color: var(--blue); font-size: 13px; font-weight: 900; letter-spacing: .12em; }
.watermark-visual span { position: absolute; color: rgba(100,116,139,.29); font-size: 28px; font-weight: 650; white-space: nowrap; transform: rotate(-33deg); }
.watermark-visual span:nth-child(1) { left: -55px; top: 36px; }
.watermark-visual span:nth-child(2) { left: 118px; top: 117px; }
.watermark-visual span:nth-child(3) { left: -70px; top: 195px; }
.watermark-visual span:nth-child(4) { left: 170px; top: 231px; }

.tool-card { padding: 28px; border: 1px solid var(--line); border-radius: 21px; background: var(--white); box-shadow: var(--shadow); }
.tool-heading { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 23px; }
.tool-heading .section-kicker { margin-bottom: 5px; }
#status { max-width: 290px; margin: 0; color: var(--muted); text-align: right; font-size: 12px; font-weight: 650; }
#status.error { color: var(--danger); }
.tool-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(280px, .92fr); gap: 29px; }
.tool-settings { min-width: 0; }
.drop-zone { min-height: 132px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 20px; border: 1.5px dashed #acbad0; border-radius: 13px; background: #fbfcff; color: var(--muted); text-align: center; transition: .18s ease; }
.drop-zone.dragging { border-color: var(--blue); background: var(--blue-soft); transform: scale(1.01); }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.drop-zone strong { color: var(--ink); font-size: 16px; }
.drop-zone small { font-size: 12px; }
.drop-icon { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 50%; background: var(--blue-soft); color: var(--blue); font-size: 19px; font-weight: 800; }
.file-list { margin: 9px 0 0; padding: 0; list-style: none; }
.file-list li { display: grid; grid-template-columns: auto minmax(0,1fr) auto auto; align-items: center; gap: 8px; margin-top: 6px; padding: 8px 9px; border-radius: 8px; background: #f7f9fc; }
.pdf-badge { padding: 2px 5px; border-radius: 4px; background: #fde9e8; color: var(--danger); font-size: 10px; font-weight: 850; }
.file-name { overflow: hidden; font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.file-size { color: var(--muted); font-size: 11px; }
.remove-file { border: 0; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; }
.remove-file:hover { color: var(--danger); }
.field-group { display: flex; flex-direction: column; gap: 6px; color: var(--ink-soft); font-size: 12px; font-weight: 750; }
.field-group span, .field-group > label { display: flex; justify-content: space-between; gap: 9px; }
.field-group input, .field-group select { width: 100%; min-height: 39px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; outline: none; color: var(--ink); background: var(--white); font-size: 13px; }
.field-group input:focus, .field-group select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(21,94,239,.11); }
.text-group { margin-top: 16px; }
.text-group label { display: flex; justify-content: space-between; }
.text-group b { color: var(--muted); font-size: 11px; }
.preset-row { display: flex; flex-wrap: wrap; gap: 7px; margin: 11px 0 16px; }
.preset { border: 1px solid var(--line); border-radius: 20px; padding: 5px 10px; background: var(--white); color: var(--muted); font-size: 12px; font-weight: 750; }
.preset:hover, .preset.active { border-color: #b6ccfb; background: var(--blue-soft); color: var(--blue); }
.compact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mode-field { margin: 0; padding: 0; border: 0; }
.mode-field legend { margin-bottom: 6px; }
.segmented { display: flex; min-height: 39px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: #f5f7fb; }
.segmented button { flex: 1; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 750; }
.segmented .selected { background: var(--white); color: var(--ink); box-shadow: 0 1px 3px rgba(15,23,42,.13); }
.color-field { flex-direction: row; align-items: center; justify-content: space-between; }
.color-field input { width: 46px; min-height: 29px; padding: 2px; }
.range-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; margin-top: 19px; }
.range-field { color: var(--ink-soft); font-size: 12px; font-weight: 750; }
.range-field span { display: flex; justify-content: space-between; gap: 10px; }
output { color: var(--blue); font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; margin-top: 7px; accent-color: var(--blue); }
.actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 21px; }
.button-primary, .button-secondary { min-height: 42px; padding: 9px 13px; border-radius: 8px; font-size: 13px; font-weight: 800; }
.button-secondary { border: 1px solid #b7c4d8; background: var(--white); color: var(--ink); }
.button-secondary:hover { border-color: var(--blue); color: var(--blue); }
.button-primary { border: 1px solid var(--blue); background: var(--blue); color: var(--white); }
.button-primary:hover { border-color: var(--blue-dark); background: var(--blue-dark); }
.button-primary span { margin-left: 8px; font-size: 17px; }
button:disabled { cursor: progress; opacity: .6; }

.preview-area { min-height: 535px; display: flex; flex-direction: column; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: #f8fafc; }
.preview-label { display: flex; justify-content: space-between; gap: 10px; margin: 0 4px 10px; color: var(--ink-soft); font-size: 12px; font-weight: 800; }
.preview-label small { color: var(--muted); font-size: 11px; font-weight: 600; }
.preview-empty { flex: 1; display: grid; place-items: center; align-content: center; gap: 11px; min-height: 400px; border: 1px dashed #c7d1e0; border-radius: 9px; background: var(--white); color: var(--muted); text-align: center; }
.preview-empty span { display: grid; width: 42px; height: 54px; place-items: center; border-radius: 5px; background: #fde9e8; color: var(--danger); font-size: 10px; font-weight: 900; }
.preview-empty p { margin: 0; font-size: 13px; }
#previewFrame { width: 100%; height: 478px; border: 0; border-radius: 9px; background: var(--white); }

.info-section { display: grid; grid-template-columns: .86fr 1.14fr; gap: 60px; margin-top: 83px; padding: 44px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.info-section p:last-child { max-width: 640px; margin: 0; color: var(--ink-soft); font-size: 16px; }
.how-section, .faq { width: min(880px, 100%); margin: 83px auto; }
.how-section h2, .faq h2 { margin-bottom: 30px; }
.how-section ol { display: grid; grid-template-columns: repeat(3, 1fr); gap: 27px; margin: 0; padding: 0; list-style: none; }
.how-section li { display: flex; gap: 12px; }
.how-section li > b { display: grid; flex: 0 0 auto; width: 28px; height: 28px; place-items: center; border-radius: 50%; background: var(--blue-soft); color: var(--blue); font-size: 12px; }
.how-section p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.faq details { border-top: 1px solid var(--line); padding: 17px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; color: var(--ink); font-weight: 750; }
.faq p { max-width: 720px; margin: 10px 0 0; color: var(--muted); }
footer { display: flex; justify-content: space-between; gap: 20px; width: min(1180px, calc(100% - 40px)); margin: auto; padding: 24px 0 37px; color: var(--muted); font-size: 12px; }
footer a { color: var(--ink-soft); font-weight: 750; text-decoration: none; }
.no-script { position: fixed; inset: auto 12px 12px; padding: 12px; border-radius: 8px; background: #fff1f0; color: var(--danger); text-align: center; }

@media (max-width: 850px) {
  .hero, .tool-grid, .info-section { grid-template-columns: 1fr; }
  .hero { padding-top: 30px; gap: 30px; }
  .watermark-visual { min-height: 180px; }
  .tool-grid { gap: 19px; }
  .preview-area { min-height: 425px; }
  #previewFrame { height: 380px; }
  .preview-empty { min-height: 320px; }
  .info-section { gap: 20px; margin-top: 55px; }
  .how-section, .faq { margin: 55px auto; }
  .how-section ol { grid-template-columns: 1fr; }
}
@media (max-width: 580px) {
  .site-header, main, footer { width: min(100% - 28px, 1180px); }
  .site-header { min-height: 61px; }
  nav { display: none; }
  .hero { min-height: 0; padding-bottom: 29px; }
  .watermark-visual { display: none; }
  .tool-card { padding: 17px; border-radius: 14px; }
  .tool-heading { flex-direction: column; gap: 7px; }
  #status { max-width: none; text-align: left; }
  .compact-grid, .range-grid { grid-template-columns: 1fr; }
  .actions { flex-direction: column-reverse; }
  .button-primary, .button-secondary { width: 100%; }
  footer { align-items: flex-start; flex-direction: column; }
}
