:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #12213f;
  background: #f7faff;
  font-synthesis: none;
  --blue: #1769e8;
  --blue-dark: #0d4fc0;
  --blue-soft: #edf5ff;
  --line: #dce5f2;
  --muted: #5e6c84;
  --panel: #ffffff;
  --success: #168657;
  --success-soft: #e9f8f1;
  --danger: #c33f42;
  --danger-soft: #fff0f0;
  --shadow: 0 18px 50px rgba(43, 72, 116, 0.1), 0 2px 8px rgba(43, 72, 116, 0.06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 50% 0, #fff 0, #f7faff 34rem); color: #13203a; }
button, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid rgba(23, 105, 232, 0.28); outline-offset: 2px; }
svg { width: 1.25em; height: 1.25em; fill: currentColor; }
.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; }

.site-header { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, 0.94); border-bottom: 1px solid rgba(220, 229, 242, 0.9); backdrop-filter: blur(16px); }
.header-inner { width: min(1440px, calc(100% - 40px)); min-height: 78px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand img { border-radius: 12px; box-shadow: 0 7px 18px rgba(23, 105, 232, 0.2); }
.brand span { display: grid; gap: 2px; }
.brand strong { font-size: 1.08rem; line-height: 1.2; }
.brand small { color: var(--muted); font-size: 0.77rem; }
.github-button { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px; border: 1px solid #d8e0eb; border-radius: 10px; color: #111827; background: #fff; text-decoration: none; font-weight: 700; box-shadow: 0 5px 15px rgba(35, 52, 78, 0.06); transition: transform .18s, border-color .18s, box-shadow .18s; }
.github-button:hover { transform: translateY(-1px); border-color: #b8c5d7; box-shadow: 0 8px 20px rgba(35, 52, 78, 0.1); }

main { width: min(1440px, calc(100% - 40px)); margin: auto; }
.hero { max-width: 900px; margin: 0 auto; padding: 54px 20px 30px; text-align: center; }
.eyebrow, .step-label { margin: 0 0 8px; color: var(--blue); font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.hero h1 { margin: 0; color: #0c1830; font-size: clamp(2.15rem, 4vw, 3.6rem); line-height: 1.04; letter-spacing: -.045em; }
.hero-copy { max-width: 760px; margin: 16px auto 0; color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.17rem); line-height: 1.65; }
.benefit-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.benefit-row span { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; color: #263650; background: rgba(255, 255, 255, .9); border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 5px 16px rgba(44, 74, 117, .06); font-size: .88rem; font-weight: 700; }
.benefit-row svg { color: var(--blue); }

.tool-shell { display: grid; grid-template-columns: minmax(0, .94fr) minmax(0, 1.06fr); gap: 18px; align-items: stretch; }
.panel { min-width: 0; padding: 24px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.panel-heading, .preview-heading { min-height: 62px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.panel h2, .content-section h2 { margin: 0; color: #101a30; font-size: 1.26rem; letter-spacing: -.02em; }
.panel-heading p:not(.step-label) { margin: 7px 0 0; color: var(--muted); font-size: .91rem; line-height: 1.5; }
textarea { display: block; width: 100%; min-height: 390px; margin-top: 17px; padding: 18px; resize: vertical; color: #23304a; background: #fbfdff; border: 1px solid #cfd9e8; border-radius: 11px; font: 500 .89rem/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; transition: border-color .18s, box-shadow .18s, background .18s; }
textarea:hover { border-color: #aebdd1; }
textarea:focus { border-color: var(--blue); background: #fff; box-shadow: 0 0 0 4px rgba(23, 105, 232, .1); outline: none; }
textarea::placeholder { color: #8794a9; }
.keyboard-hint { margin: 8px 2px 0; color: #7a879a; font-size: .77rem; }
kbd { padding: 1px 5px; background: #f1f4f8; border: 1px solid #d7dee8; border-bottom-width: 2px; border-radius: 4px; font: inherit; }
.button-row, .preview-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 17px; border-radius: 9px; border: 1px solid transparent; cursor: pointer; font-weight: 750; transition: transform .16s, box-shadow .16s, border-color .16s, background .16s, color .16s; }
.button:not(:disabled):hover { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .5; }
.button.primary { flex: 1 1 150px; color: #fff; background: linear-gradient(135deg, #1675f7, #1761df); box-shadow: 0 9px 20px rgba(23, 105, 232, .22); }
.button.primary:not(:disabled):hover { box-shadow: 0 12px 26px rgba(23, 105, 232, .3); }
.button.secondary { color: #24334c; background: #fff; border-color: #d8e0eb; box-shadow: 0 4px 10px rgba(32, 52, 81, .04); }
.button.secondary:not(:disabled):hover { border-color: #afbdd0; background: #f9fbfe; }
.button.compact { min-height: 42px; flex: 0 0 auto; font-size: .86rem; }
.button-loader { display: none; width: 17px; height: 17px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .75s linear infinite; }
.button.is-loading .button-content { display: none; }
.button.is-loading .button-loader { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.tool-message { margin-top: 13px; padding: 11px 13px; border: 1px solid #c9d9ee; border-radius: 8px; color: #24508e; background: #f1f7ff; font-size: .86rem; line-height: 1.45; }
.tool-message[data-type="success"] { color: #126d49; border-color: #bde4d2; background: var(--success-soft); }
.tool-message[data-type="error"] { color: #a72e35; border-color: #f0c2c5; background: var(--danger-soft); }
.privacy-note { display: flex; align-items: center; gap: 12px; margin-top: 17px; padding: 14px; border: 1px solid #cfe0f7; border-radius: 10px; background: linear-gradient(135deg, #f2f7ff, #f9fcff); }
.privacy-icon { flex: 0 0 38px; height: 38px; display: grid; place-items: center; color: var(--blue); background: #fff; border-radius: 50%; box-shadow: 0 4px 12px rgba(23, 105, 232, .1); }
.privacy-note span:last-child { display: grid; gap: 2px; }
.privacy-note strong { color: #1853a7; font-size: .88rem; }
.privacy-note small { color: #5d6d84; font-size: .78rem; line-height: 1.45; }

.preview-heading { align-items: center; }
.document-meta { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.meta-pill { min-height: 31px; display: inline-flex; align-items: center; padding: 0 11px; color: #536078; background: #f4f6f9; border-radius: 999px; font-size: .78rem; font-weight: 750; white-space: nowrap; }
.status-pill::before { content: ''; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #93a0b2; }
.status-pill.is-valid { color: #147046; background: var(--success-soft); }
.status-pill.is-valid::before { background: #1aac70; box-shadow: 0 0 0 3px rgba(26, 172, 112, .12); }
.viewer-frame { margin-top: 17px; overflow: hidden; border: 1px solid #ccd5e1; border-radius: 10px; background: #30363e; }
.viewer-toolbar { min-height: 54px; padding: 0 13px; display: flex; align-items: center; justify-content: center; gap: 22px; color: #fff; background: #242a31; border-bottom: 1px solid rgba(255,255,255,.08); }
.toolbar-group { display: flex; align-items: center; gap: 6px; }
.icon-button { width: 35px; height: 35px; display: grid; place-items: center; padding: 0; color: #fff; background: transparent; border: 0; border-radius: 7px; cursor: pointer; }
.icon-button:not(:disabled):hover { background: rgba(255,255,255,.12); }
.icon-button:disabled { color: #69717b; cursor: not-allowed; }
.toolbar-value { min-width: 56px; text-align: center; color: #f5f7fa; font-size: .82rem; font-weight: 700; }
.preview-viewport { position: relative; height: 493px; overflow: auto; background: radial-gradient(circle at 50% 30%, #444c55, #30363e 58%); }
.preview-state { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; color: #fff; text-align: center; }
.preview-state[hidden], .preview-document[hidden] { display: none; }
.empty-icon { width: 68px; height: 68px; display: grid; place-items: center; margin-bottom: 18px; color: #e8edf3; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); border-radius: 16px; }
.empty-icon svg { width: 36px; height: 36px; }
.preview-state strong { font-size: 1.08rem; }
.preview-state p { max-width: 330px; margin: 9px 0 0; color: #c6ced8; font-size: .88rem; line-height: 1.6; }
.large-loader { width: 38px; height: 38px; margin-bottom: 17px; border: 3px solid rgba(255,255,255,.25); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.preview-document { min-height: 100%; padding: 16px; text-align: center; }
#pdf-canvas { display: block; max-width: none; margin: 0 auto; background: #fff; box-shadow: 0 10px 28px rgba(0,0,0,.28); }
.preview-actions { justify-content: flex-end; }

.feature-strip { margin: 20px 0 0; padding: 20px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 35px rgba(43,72,116,.07); }
.feature-strip article { min-width: 0; display: flex; gap: 13px; padding: 3px 18px; border-right: 1px solid #e7edf5; }
.feature-strip article:last-child { border-right: 0; }
.feature-icon { flex: 0 0 44px; height: 44px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 10px; font-size: .72rem; font-weight: 900; }
.feature-strip h2 { margin: 1px 0 5px; color: #17233a; font-size: .9rem; }
.feature-strip p { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.45; }

.content-section { margin-top: 44px; padding: 36px; display: grid; grid-template-columns: .72fr 1.28fr; gap: 44px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.content-section h2 { font-size: 1.8rem; line-height: 1.18; }
.steps-list { margin: 0; padding: 0; list-style: none; counter-reset: steps; display: grid; gap: 14px; }
.steps-list li { counter-increment: steps; position: relative; padding: 16px 18px 16px 58px; display: grid; gap: 4px; background: #f8faff; border: 1px solid #e0e8f3; border-radius: 10px; }
.steps-list li::before { content: counter(steps); position: absolute; left: 16px; top: 15px; width: 29px; height: 29px; display: grid; place-items: center; color: #fff; background: var(--blue); border-radius: 50%; font-size: .79rem; font-weight: 800; }
.steps-list strong { color: #19253b; }
.steps-list span { color: var(--muted); font-size: .86rem; line-height: 1.5; }
.faq-list { display: grid; gap: 9px; }
details { background: #f9fbfe; border: 1px solid #e0e7f1; border-radius: 9px; }
summary { padding: 15px 17px; cursor: pointer; color: #1e2b43; font-weight: 760; }
details p { margin: 0; padding: 0 17px 16px; color: var(--muted); font-size: .87rem; line-height: 1.6; }
footer { width: min(1440px, calc(100% - 40px)); margin: 40px auto 0; padding: 24px 0 30px; color: #6c788c; border-top: 1px solid #dce5f0; text-align: center; font-size: .82rem; }

@media (max-width: 1100px) {
  .tool-shell { grid-template-columns: 1fr; }
  textarea { min-height: 300px; }
  .preview-viewport { height: 570px; }
  .feature-strip { grid-template-columns: repeat(2, 1fr); row-gap: 20px; }
  .feature-strip article:nth-child(2) { border-right: 0; }
  .feature-strip article:nth-child(n+3) { padding-top: 20px; border-top: 1px solid #e7edf5; }
}

@media (max-width: 720px) {
  .header-inner, main, footer { width: min(100% - 24px, 1440px); }
  .header-inner { min-height: 68px; }
  .brand img { width: 38px; height: 38px; }
  .brand strong { font-size: .96rem; }
  .brand small { display: none; }
  .github-button { width: 42px; padding: 0; justify-content: center; font-size: 0; }
  .github-button svg { width: 21px; height: 21px; }
  .hero { padding: 38px 4px 23px; }
  .hero h1 { font-size: clamp(2rem, 10vw, 2.65rem); }
  .hero-copy { font-size: .98rem; }
  .benefit-row { gap: 8px; }
  .benefit-row span { padding: 8px 11px; font-size: .78rem; }
  .panel { padding: 17px; border-radius: 13px; }
  .panel-heading, .preview-heading { min-height: 0; flex-direction: column; align-items: stretch; }
  .panel-heading .compact { align-self: flex-start; }
  textarea { min-height: 280px; padding: 14px; font-size: .8rem; }
  .button-row .button { flex: 1 1 calc(50% - 8px); padding: 0 11px; font-size: .83rem; }
  .button-row .primary { flex-basis: 100%; }
  .document-meta { justify-content: flex-start; }
  .viewer-toolbar { justify-content: space-between; gap: 6px; padding: 0 7px; }
  .icon-button { width: 32px; height: 32px; }
  .toolbar-value { min-width: 48px; font-size: .76rem; }
  .preview-viewport { height: 460px; }
  .preview-actions .button { flex: 1; padding: 0 12px; font-size: .82rem; }
  .feature-strip { grid-template-columns: 1fr; padding: 12px 17px; }
  .feature-strip article, .feature-strip article:nth-child(n+3) { padding: 14px 0; border-right: 0; border-top: 1px solid #e7edf5; }
  .feature-strip article:first-child { border-top: 0; }
  .content-section { margin-top: 24px; padding: 24px 18px; grid-template-columns: 1fr; gap: 24px; }
  .content-section h2 { font-size: 1.45rem; }
}

@media (max-width: 420px) {
  .button-row .button, .preview-actions .button { flex-basis: 100%; }
  .privacy-note { align-items: flex-start; }
  .preview-viewport { height: 410px; }
  .meta-pill { font-size: .72rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
