/* ==========================================================================
   PDF-Files.com – main stylesheet
   ========================================================================== */
:root {
  --brand: #5146e5;
  --brand-600: #4338ca;
  --brand-700: #3730a3;
  --brand-50: #eef0ff;
  --brand-100: #e0e3ff;
  --ink: #141629;
  --ink-2: #3b3f5c;
  --muted: #6b7091;
  --line: #e4e6ef;
  --line-2: #d3d6e4;
  --bg: #ffffff;
  --bg-soft: #f6f7fb;
  --bg-softer: #fafbfd;
  --ok: #138a52;
  --ok-50: #e7f6ee;
  --warn: #b35c00;
  --warn-50: #fff4e5;
  --danger: #d0293b;
  --danger-50: #fdecee;
  --pdf: #e5484d;
  --pdf-50: #fdeeee;
  --img: #12a37a;
  --img-50: #e6f6f0;
  --conv: #2f7ae5;
  --conv-50: #e9f1fd;
  --sec: #8b5cf6;
  --sec-50: #f3eefe;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(20, 22, 41, .06), 0 1px 3px rgba(20, 22, 41, .04);
  --shadow: 0 4px 16px rgba(20, 22, 41, .07), 0 1px 3px rgba(20, 22, 41, .05);
  --shadow-lg: 0 18px 48px rgba(20, 22, 41, .14);
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --header-h: 64px;
  --max: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -.015em; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(2rem, 4vw, 2.9rem); font-weight: 800; }
h2 { font-size: clamp(1.45rem, 2.4vw, 1.9rem); font-weight: 750; }
h3 { font-size: 1.12rem; font-weight: 700; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.25em; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; border-radius: 6px; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 1000; }
.skip-link:focus { left: 8px; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 860px; }
.section { padding: 72px 0; }
.section-soft { background: var(--bg-soft); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 40px; }
.section-head p { color: var(--muted); font-size: 1.06rem; }
.eyebrow { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); margin-bottom: 10px; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.text-danger { color: var(--danger); }
.hide-sm { }

/* ---------------------------------------------------------------- icons */
.icon { display: inline-flex; width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.icon svg { width: 100%; height: 100%; }

/* -------------------------------------------------------------- buttons */
.btn {
  --b: var(--brand);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 9px 18px;
  border: 1px solid transparent; border-radius: 11px;
  font-weight: 650; font-size: .95rem; line-height: 1.2; cursor: pointer;
  text-decoration: none !important; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .05s, color .15s;
  user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--brand) 70%, transparent); }
.btn-primary:hover:not(:disabled) { background: var(--brand-600); }
.btn-ghost { background: #fff; color: var(--ink-2); border-color: var(--line-2); }
.btn-ghost:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-link { background: none; color: var(--muted); border: 0; min-height: 36px; font-weight: 600; }
.btn-link:hover { color: var(--brand); }
.btn-lg { min-height: 52px; padding: 12px 26px; font-size: 1.04rem; border-radius: 13px; }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: .86rem; border-radius: 9px; }
.btn-block { width: 100%; }
.btn.busy { position: relative; color: transparent !important; }
.btn.busy::after { content: ""; position: absolute; width: 18px; height: 18px; border: 2px solid #fff; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 9px; border: 1px solid transparent;
  background: transparent; color: var(--ink-2); cursor: pointer; padding: 0;
}
.icon-btn:hover:not(:disabled) { background: var(--bg-soft); border-color: var(--line); color: var(--brand); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn .icon { width: 18px; height: 18px; }
.icon-btn-danger:hover:not(:disabled) { color: var(--danger); background: var(--danger-50); border-color: transparent; }

/* --------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(1.6) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: var(--header-h); }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; font-size: 1.12rem; letter-spacing: -.02em; text-decoration: none !important; flex: none; }
.logo-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--brand), #8b5cf6); box-shadow: 0 6px 14px -6px var(--brand); }
.logo-mark .icon { width: 20px; height: 20px; }
.logo small { font-weight: 600; color: var(--muted); font-size: .8em; }
.site-nav { display: flex; align-items: center; gap: 2px; flex: 1; }
.nav-list { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav-item { position: relative; }
.nav-link { display: inline-flex; align-items: center; gap: 4px; padding: 8px 12px; border-radius: 9px; color: var(--ink-2); font-weight: 600; font-size: .94rem; text-decoration: none !important; }
.nav-link:hover, .nav-item.open > .nav-link, .nav-link[aria-current="page"] { background: var(--bg-soft); color: var(--brand); }
.nav-link .icon { width: 14px; height: 14px; transition: transform .2s; }
.nav-item.open > .nav-link .icon { transform: rotate(180deg); }
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.header-search { position: relative; }
.header-search input { width: 210px; padding: 8px 12px 8px 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-soft); font: inherit; font-size: .9rem; }
.header-search input:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-100); }
.header-search > .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; }
.nav-toggle { display: none; }

.mega {
  position: absolute; left: 50%; top: calc(100% + 8px); transform: translateX(-50%) translateY(6px);
  width: min(880px, 92vw); background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg);
  padding: 22px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 22px;
  opacity: 0; visibility: hidden; transition: opacity .15s, transform .15s, visibility .15s; z-index: 60;
}
.nav-item.has-mega:hover .mega, .nav-item.open .mega { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.nav-item.has-mega::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 12px; }
.mega h4 { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 0 0 8px; }
.mega ul { list-style: none; margin: 0; padding: 0; }
.mega a { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 7px; color: var(--ink-2); font-size: .9rem; font-weight: 550; text-decoration: none; }
.mega a:hover { background: var(--bg-soft); color: var(--brand); }
.mega a .icon { width: 16px; height: 16px; color: var(--muted); }
.mega-foot { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 12px; display: flex; justify-content: space-between; align-items: center; font-size: .88rem; }

.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; min-width: 320px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 70; max-height: 70vh; overflow: auto; }
.search-hit { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 9px; color: var(--ink); text-decoration: none !important; }
.search-hit:hover { background: var(--bg-soft); }
.search-hit strong { display: block; font-size: .92rem; }
.search-hit small { display: block; color: var(--muted); font-size: .8rem; line-height: 1.3; }
.search-hit .tool-icon { width: 34px; height: 34px; }
.search-empty { padding: 10px; color: var(--muted); font-size: .9rem; }

/* ------------------------------------------------------------------ hero */
.hero { position: relative; padding: 64px 0 56px; background: radial-gradient(1200px 400px at 50% -80px, var(--brand-50), transparent 70%), #fff; overflow: hidden; }
.hero-inner { text-align: center; max-width: 900px; margin: 0 auto; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); margin-bottom: 14px; }
.hero h1 .grad { background: linear-gradient(90deg, var(--brand), #8b5cf6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { font-size: clamp(1.02rem, 1.6vw, 1.22rem); color: var(--ink-2); max-width: 640px; margin: 0 auto 30px; }
.home-drop {
  position: relative; max-width: 760px; margin: 0 auto; padding: 40px 24px;
  border: 2px dashed color-mix(in srgb, var(--brand) 40%, var(--line-2)); border-radius: var(--radius-lg);
  background: #fff; cursor: pointer; transition: border-color .2s, background .2s, transform .2s, box-shadow .2s; box-shadow: var(--shadow);
}
.home-drop:hover, .home-drop.dragover { border-color: var(--brand); background: var(--brand-50); }
.home-drop.dragover { transform: scale(1.01); }
.home-drop .dropzone-icon { margin: 0 auto 10px; }
.home-drop strong { display: block; font-size: 1.2rem; margin-bottom: 4px; }
.home-drop .btn { margin-top: 14px; }
.hero-trust { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 26px; margin-top: 26px; color: var(--muted); font-size: .9rem; }
.hero-trust span { display: inline-flex; align-items: center; gap: 6px; }
.hero-trust .icon { color: var(--ok); }
.hero-search { max-width: 520px; margin: 22px auto 0; position: relative; }
.hero-search input { width: 100%; padding: 13px 16px 13px 44px; border-radius: 12px; border: 1px solid var(--line-2); font: inherit; background: #fff; box-shadow: var(--shadow-sm); }
.hero-search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-100); }
.hero-search > .icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); }

/* ------------------------------------------------------------ tool cards */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.tool-card {
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 18px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); text-decoration: none !important; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.tool-card:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); box-shadow: var(--shadow); transform: translateY(-2px); }
.tool-card h3 { font-size: 1rem; margin: 0; }
.tool-card p { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.45; }
.tool-card .card-badge { position: absolute; top: 14px; right: 14px; }
.tool-icon { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--brand-50); color: var(--brand); }
.tool-icon .icon { width: 22px; height: 22px; }
.cat-pdf { background: var(--pdf-50); color: var(--pdf); }
.cat-image { background: var(--img-50); color: var(--img); }
.tool-icon.cat-convert { background: var(--conv-50); color: var(--conv); }
.tool-icon.cat-security { background: var(--sec-50); color: var(--sec); }
.cat-group { margin-bottom: 44px; }
.cat-group-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.cat-group-head h2, .cat-group-head h3 { margin: 0; font-size: 1.3rem; }
.cat-group-head .tool-icon { width: 36px; height: 36px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 28px; }
.chip { border: 1px solid var(--line-2); background: #fff; border-radius: 999px; padding: 7px 14px; font-weight: 600; font-size: .88rem; color: var(--ink-2); cursor: pointer; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ------------------------------------------------------- how / features */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; }
.step { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 22px 22px; }
.step::before { counter-increment: step; content: counter(step); position: absolute; top: -16px; left: 22px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 800; box-shadow: 0 6px 14px -6px var(--brand); }
.step h3 { margin-top: 6px; }
.step p { color: var(--muted); margin: 0; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.feature { padding: 22px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); }
.feature .tool-icon { margin-bottom: 12px; }
.feature p { color: var(--muted); margin: 0; font-size: .95rem; }
.privacy-band { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; }
.privacy-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.privacy-list li { display: flex; gap: 12px; align-items: flex-start; }
.privacy-list .icon { color: var(--ok); width: 22px; height: 22px; margin-top: 2px; }
.privacy-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 26px; box-shadow: var(--shadow); }
.privacy-card table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.privacy-card td { padding: 9px 4px; border-bottom: 1px solid var(--line); }
.privacy-card tr:last-child td { border-bottom: 0; }

/* ------------------------------------------------------------------ FAQ */
.faq { max-width: 860px; margin: 0 auto; display: grid; gap: 10px; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 0 18px; }
.faq details[open] { border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.faq summary { list-style: none; cursor: pointer; padding: 16px 0; font-weight: 650; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--brand); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .faq-a { padding: 0 0 16px; color: var(--ink-2); }
.faq .faq-a p:last-child { margin: 0; }

/* --------------------------------------------------------------- footer */
.site-footer { background: #0f1123; color: #c8cbe0; padding: 56px 0 28px; margin-top: 0; }
.site-footer a { color: #c8cbe0; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 32px; }
.footer-grid h4 { color: #fff; font-size: .9rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 12px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; font-size: .92rem; }
.footer-brand p { font-size: .92rem; color: #9ea2bf; max-width: 300px; }
.footer-brand .logo { color: #fff; }
.footer-bottom { border-top: 1px solid #262a45; margin-top: 40px; padding-top: 20px; display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; font-size: .86rem; color: #9ea2bf; }
.footer-bottom button { background: none; border: 0; color: inherit; cursor: pointer; padding: 0; text-decoration: underline; }

/* ----------------------------------------------------------- tool page */
.breadcrumb { font-size: .86rem; color: var(--muted); padding: 16px 0 0; }
.breadcrumb ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.breadcrumb li + li::before { content: "/"; margin-right: 6px; color: var(--line-2); }
.breadcrumb a { color: var(--muted); }
.tool-hero { padding: 20px 0 8px; text-align: center; }
.tool-hero h1 { margin-bottom: 8px; }
.tool-hero .lead { color: var(--ink-2); font-size: 1.1rem; max-width: 720px; margin: 0 auto 10px; }
.tool-badges { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 700; background: var(--bg-soft); color: var(--ink-2); border: 1px solid var(--line); }
.badge .icon { width: 13px; height: 13px; }
.badge-local { background: var(--ok-50); color: var(--ok); border-color: transparent; }
.badge-server { background: var(--warn-50); color: var(--warn); border-color: transparent; }
.badge-hybrid { background: var(--conv-50); color: var(--conv); border-color: transparent; }
.badge-new { background: var(--brand-50); color: var(--brand); border-color: transparent; }
.tool-section { padding: 18px 0 56px; }
#tool-app { min-height: 280px; }
#tool-app.loading { display: grid; place-items: center; }
#tool-app.loading::before { content: ""; width: 36px; height: 36px; border: 3px solid var(--brand-100); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }

.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; align-items: start; }
.article { max-width: 760px; }
.article h2 { margin-top: 1.6em; }
.article h2:first-child { margin-top: 0; }
.article p, .article li { color: var(--ink-2); }
.article ol.howto { counter-reset: s; list-style: none; padding: 0; display: grid; gap: 12px; }
.article ol.howto li { counter-increment: s; position: relative; padding: 14px 16px 14px 56px; background: var(--bg-soft); border-radius: 12px; }
.article ol.howto li::before { content: counter(s); position: absolute; left: 16px; top: 13px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--brand); font-weight: 800; border: 1px solid var(--line); }
.article table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: .94rem; }
.article th, .article td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.article th { background: var(--bg-soft); }
.article code { font-family: var(--mono); background: var(--bg-soft); padding: 1px 5px; border-radius: 5px; font-size: .9em; }
.article-aside { position: sticky; top: calc(var(--header-h) + 20px); display: grid; gap: 18px; }
.aside-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: #fff; }
.aside-card h3 { font-size: .95rem; margin-bottom: 10px; }
.aside-card ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.aside-card ul a { display: flex; gap: 8px; align-items: center; padding: 6px; border-radius: 8px; color: var(--ink-2); font-size: .92rem; font-weight: 550; }
.aside-card ul a:hover { background: var(--bg-soft); color: var(--brand); text-decoration: none; }
.aside-card ul a .icon { width: 16px; height: 16px; color: var(--muted); }
.aside-card h3 .icon { color: var(--ok); }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }

/* ------------------------------------------------------------ ad slots */
.ad-slot { display: none; }
.ad-slot.ad-active { display: block; margin: 28px auto; text-align: center; min-height: 100px; max-width: 970px; }
.ad-slot[data-ad-position="sidebar"].ad-active { min-height: 250px; margin: 0; }
.ad-label { display: block; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }

/* ===================================================== ToolShell UI */
.shell { position: relative; }
.dropzone {
  max-width: 820px; margin: 0 auto; padding: 46px 24px; text-align: center; cursor: pointer;
  border: 2px dashed color-mix(in srgb, var(--brand) 35%, var(--line-2)); border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #fff, var(--bg-softer)); transition: border-color .2s, background .2s, transform .15s; box-shadow: var(--shadow-sm);
}
.dropzone:hover, .dropzone.dragover { border-color: var(--brand); background: var(--brand-50); }
.dropzone.dragover { transform: scale(1.01); }
.dropzone-icon { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 18px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); }
.dropzone-icon .icon { width: 32px; height: 32px; }
.dropzone-title { font-size: 1.25rem; font-weight: 750; }
.dropzone-sub { color: var(--muted); margin: 4px 0 12px; font-size: .9rem; }
.dropzone-hint { color: var(--muted); font-size: .86rem; margin-top: 14px; }
.dropzone-privacy { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: .82rem; font-weight: 650; color: var(--ok); background: var(--ok-50); padding: 4px 10px; border-radius: 999px; }
.shell-work { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.shell-work.dragover { outline: 2px dashed var(--brand); outline-offset: 6px; border-radius: var(--radius); }
.shell-main { min-width: 0; }
.shell-list-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.shell-count { font-weight: 650; color: var(--ink-2); font-size: .94rem; }
.shell-list-actions { display: flex; gap: 10px; align-items: center; }
.file-list { display: grid; gap: 8px; }
.file-list-cards { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.file-item { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.file-list-cards .file-item { flex-direction: column; align-items: stretch; padding: 10px; gap: 8px; cursor: grab; }
.file-list-cards .file-thumb { width: 100%; height: 150px; }
.file-list-cards .file-actions { position: absolute; top: 6px; right: 6px; background: rgba(255,255,255,.92); border-radius: 10px; box-shadow: var(--shadow-sm); }
.file-list-cards .file-grip { position: absolute; top: 8px; left: 8px; background: rgba(255,255,255,.9); border-radius: 7px; padding: 3px; }
.file-thumb { width: 48px; height: 48px; flex: none; border-radius: 8px; background: var(--bg-soft); display: grid; place-items: center; color: var(--muted); overflow: hidden; }
.file-thumb img { width: 100%; height: 100%; object-fit: contain; background: repeating-conic-gradient(#f0f1f5 0 25%, #fff 0 50%) 50% / 14px 14px; }
.file-thumb .icon { width: 24px; height: 24px; }
.file-info { min-width: 0; flex: 1; }
.file-name { font-weight: 650; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { color: var(--muted); font-size: .8rem; }
.file-actions { display: flex; gap: 2px; flex: none; }
.file-grip { color: var(--muted); cursor: grab; display: inline-flex; }
.sort-ghost { opacity: .4; }
.shell-workspace { margin-top: 18px; }
.shell-side { position: sticky; top: calc(var(--header-h) + 16px); }
.side-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); display: grid; gap: 14px; }
.side-title { font-size: 1rem; margin: 0; }
.options { display: grid; gap: 14px; }
.opt-row { display: grid; gap: 6px; }
.opt-label { font-weight: 650; font-size: .88rem; color: var(--ink-2); display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.opt-value { font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
.opt-help { font-size: .8rem; color: var(--muted); line-height: 1.4; }
.opt-heading { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 750; color: var(--muted); padding-top: 4px; border-top: 1px solid var(--line); margin-top: 2px; padding-top: 12px; }
.input { width: 100%; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--line-2); background: #fff; font: inherit; font-size: .93rem; color: var(--ink); }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
textarea.input { resize: vertical; min-height: 80px; font-family: inherit; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7091' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; background-size: 16px; padding-right: 32px; }
.range { width: 100%; accent-color: var(--brand); }
.check { display: flex; gap: 9px; align-items: flex-start; font-size: .92rem; cursor: pointer; font-weight: 550; color: var(--ink-2); }
.check input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--brand); flex: none; }
.segmented { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 6px; }
.segmented.cols-2 { grid-template-columns: repeat(2, 1fr); }
.segmented.cols-3 { grid-template-columns: repeat(3, 1fr); }
.segmented.cols-4 { grid-template-columns: repeat(4, 1fr); }
.seg { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 8px 6px; border-radius: 9px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; font-size: .85rem; font-weight: 650; color: var(--ink-2); text-align: center; line-height: 1.2; }
.seg small { font-weight: 500; color: var(--muted); font-size: .72rem; }
.seg .icon { width: 18px; height: 18px; }
.seg:hover { border-color: var(--brand); }
.seg.active { border-color: var(--brand); background: var(--brand-50); color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.color-row { display: flex; align-items: center; gap: 10px; }
.color-row input[type=color] { width: 44px; height: 34px; border: 1px solid var(--line-2); border-radius: 8px; padding: 2px; background: #fff; cursor: pointer; }
.color-hex { font-family: var(--mono); font-size: .86rem; color: var(--muted); }
.file-pick { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.file-pick-name { font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.processing-badge { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--ok-50); color: var(--ok); font-size: .8rem; line-height: 1.35; }
.processing-badge strong { display: block; font-size: .86rem; }
.processing-badge span { color: color-mix(in srgb, var(--ok) 75%, var(--ink)); }
.processing-badge .icon { width: 20px; height: 20px; margin-top: 1px; }
[data-processing="server"] .processing-badge, [data-processing="server"] .dropzone-privacy { background: var(--warn-50); color: var(--warn); }
[data-processing="server"] .processing-badge span { color: #7a3f00; }
[data-processing="hybrid"] .processing-badge, [data-processing="hybrid"] .dropzone-privacy { background: var(--conv-50); color: var(--conv); }
[data-processing="hybrid"] .processing-badge span { color: #1d4f99; }

.shell-progress { display: grid; place-items: center; padding: 30px 0; }
.progress-card { width: min(560px, 100%); text-align: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 34px 28px; box-shadow: var(--shadow); display: grid; gap: 18px; justify-items: center; }
.spinner { width: 44px; height: 44px; border: 4px solid var(--brand-100); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress { width: 100%; }
.progress-top { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; margin-bottom: 8px; color: var(--ink-2); font-weight: 600; }
.progress-pct { font-variant-numeric: tabular-nums; color: var(--brand); }
.progress-track { height: 10px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), #8b5cf6); border-radius: 999px; transition: width .25s ease; }
.progress.indeterminate .progress-bar { width: 35% !important; animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }

.shell-result { max-width: 860px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.shell-result > * { min-width: 0; }
.result-head { display: flex; gap: 16px; align-items: center; }
.result-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--ok-50); color: var(--ok); display: grid; place-items: center; flex: none; }
.result-icon .icon { width: 28px; height: 28px; }
.result-title { margin: 0 0 2px; font-size: 1.5rem; }
.result-summary { margin: 0; color: var(--ink-2); }
.result-actions { display: flex; gap: 12px; flex-wrap: wrap; padding: 8px 0 4px; }
.result-list { display: grid; gap: 8px; max-height: 480px; overflow: auto; padding: 2px; }
.result-secondary { display: flex; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 18px; }
.notes { margin: 0; padding-left: 1.1em; }
.shell-error { max-width: 860px; margin: 0 auto 14px; }

/* notices / toasts / modal */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: .92rem; line-height: 1.45; }
.notice > .icon { width: 20px; height: 20px; margin-top: 1px; }
.notice-info { background: var(--conv-50); color: #1d4f99; }
.notice-warn { background: var(--warn-50); color: #7a3f00; }
.notice-error { background: var(--danger-50); color: #9b1c2a; }
.notice-ok { background: var(--ok-50); color: #0c6038; }
.toast-host { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 1000; display: grid; gap: 8px; width: min(520px, calc(100vw - 24px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; background: var(--ink); color: #fff; padding: 12px 12px 12px 14px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: .92rem; animation: toastIn .2s ease; transition: opacity .3s, transform .3s; }
.toast.hide { opacity: 0; transform: translateY(8px); }
.toast > .icon { margin-top: 2px; }
.toast-error > .icon { color: #ff8b95; }
.toast-success > .icon { color: #6ee7a8; }
.toast span { flex: 1; }
.toast-close { background: none; border: 0; color: #fff; opacity: .7; cursor: pointer; padding: 0 2px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
.modal-overlay { position: fixed; inset: 0; background: rgba(15, 17, 35, .5); z-index: 900; display: grid; place-items: center; padding: 16px; animation: fadeIn .15s ease; }
.modal-overlay.closing { opacity: 0; transition: opacity .15s; }
@keyframes fadeIn { from { opacity: 0; } }
.modal { width: min(480px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
.modal-wide { width: min(820px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 6px; }
.modal-title { font-size: 1.15rem; margin: 0; }
.modal-body { padding: 8px 20px 16px; }
.modal-body p { color: var(--ink-2); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 20px 18px; border-top: 1px solid var(--line); }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.pick-tool { display: flex; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); text-decoration: none !important; }
.pick-tool:hover { border-color: var(--brand); background: var(--brand-50); }
.pick-tool strong { display: block; font-size: .94rem; }
.pick-tool small { display: block; color: var(--muted); font-size: .8rem; line-height: 1.3; }

/* consent */
.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 950; max-width: 640px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 16px 18px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.consent p { margin: 0; flex: 1 1 280px; font-size: .9rem; color: var(--ink-2); }
.consent-actions { display: flex; gap: 8px; }

/* ------------------------------------------------- shared tool widgets */
.page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.page-tile { position: relative; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 8px; cursor: pointer; user-select: none; transition: border-color .15s, box-shadow .15s; }
.page-tile:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.page-tile.selected { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.page-tile.removed { opacity: .4; }
.page-tile.removed .page-img { filter: grayscale(1); }
.page-img-wrap { aspect-ratio: 3 / 4; display: grid; place-items: center; background: var(--bg-soft); border-radius: 6px; overflow: hidden; }
.page-img { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 1px 4px rgba(0,0,0,.15); background: #fff; transition: transform .2s; }
.page-num { text-align: center; font-size: .8rem; font-weight: 650; color: var(--muted); margin-top: 6px; }
.page-check { position: absolute; top: 12px; left: 12px; width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--line-2); background: #fff; display: grid; place-items: center; color: #fff; }
.page-tile.selected .page-check { background: var(--brand); border-color: var(--brand); }
.page-check .icon { width: 14px; height: 14px; }
.page-tools { position: absolute; top: 10px; right: 10px; display: flex; gap: 2px; opacity: 0; transition: opacity .15s; background: rgba(255,255,255,.95); border-radius: 9px; box-shadow: var(--shadow-sm); }
.page-tile:hover .page-tools, .page-tile:focus-within .page-tools { opacity: 1; }
@media (hover: none) { .page-tools { opacity: 1; } }
.page-tools .icon-btn { width: 30px; height: 30px; }
.page-badge { position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.grid-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.grid-toolbar .spacer { flex: 1; }
.compare { position: relative; overflow: hidden; border-radius: 12px; background: repeating-conic-gradient(#eef0f4 0 25%, #fff 0 50%) 50% / 18px 18px; user-select: none; touch-action: none; }
.compare img { display: block; width: 100%; height: auto; pointer-events: none; }
.compare .compare-after { position: absolute; inset: 0; clip-path: inset(0 0 0 50%); }
.compare .compare-after img { width: 100%; height: 100%; object-fit: contain; }
.compare-handle { position: absolute; top: 0; bottom: 0; left: 50%; width: 3px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.2); transform: translateX(-50%); cursor: ew-resize; }
.compare-handle::after { content: "⇆"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 34px; height: 34px; border-radius: 50%; background: #fff; display: grid; place-items: center; box-shadow: var(--shadow); font-size: 16px; color: var(--ink); }
.compare-labels { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); margin-top: 6px; font-weight: 600; }
.preview-box { background: repeating-conic-gradient(#eef0f4 0 25%, #fff 0 50%) 50% / 18px 18px; border: 1px solid var(--line); border-radius: 12px; display: grid; place-items: center; overflow: hidden; min-height: 240px; padding: 10px; }
.preview-box canvas, .preview-box img { max-width: 100%; max-height: 560px; height: auto; width: auto; }
.kv-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.kv-table th, .kv-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; word-break: break-word; }
.kv-table th { width: 36%; color: var(--muted); font-weight: 600; }
.text-output { width: 100%; min-height: 260px; font-family: var(--mono); font-size: .85rem; line-height: 1.5; padding: 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-softer); white-space: pre-wrap; }
.calc-card { max-width: 760px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm); display: grid; gap: 18px; }
.calc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.calc-result { background: var(--brand-50); border-radius: 12px; padding: 16px; font-size: 1.05rem; color: var(--ink); }
.calc-result strong { font-size: 1.5rem; color: var(--brand); font-variant-numeric: tabular-nums; }
.sig-pad { width: 100%; height: 200px; border: 1px dashed var(--line-2); border-radius: 12px; background: #fff; touch-action: none; cursor: crosshair; }

.legal { max-width: 820px; margin: 0 auto; padding: 40px 20px 72px; }
.legal h1 { font-size: 2.2rem; }
.legal h2 { font-size: 1.35rem; margin-top: 1.8em; }
.legal p, .legal li { color: var(--ink-2); }
.legal .updated { color: var(--muted); font-size: .9rem; }
.contact-form { display: grid; gap: 14px; max-width: 560px; }

/* ----------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .header-search input { width: 160px; }
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 960px) {
  :root { --header-h: 60px; }
  .nav-toggle { display: inline-flex; margin-left: auto; }
  .header-search { display: none; }
  .site-nav {
    position: fixed; inset: var(--header-h) 0 0 0; background: #fff; flex-direction: column; align-items: stretch;
    padding: 12px 16px 40px; overflow-y: auto; transform: translateX(100%); transition: transform .25s ease; z-index: 49;
  }
  .site-nav.open { transform: none; }
  /* A closed off-canvas nav parked right of the viewport widens the mobile layout viewport
     (Chrome then zooms the whole page out), so take it out of layout until it is opened. */
  .site-nav:not(.open) { display: none; }
  .site-nav.open { animation: navSlideIn .25s ease; }
  @keyframes navSlideIn { from { transform: translateX(100%); } }
  .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-link { padding: 14px 8px; font-size: 1.02rem; justify-content: space-between; border-bottom: 1px solid var(--line); border-radius: 0; }
  .mega { position: static; transform: none !important; width: auto; box-shadow: none; border: 0; padding: 8px 4px 16px; grid-template-columns: 1fr 1fr; opacity: 1; visibility: visible; display: none; }
  .nav-item.has-mega:hover .mega { display: none; }
  .nav-item.open .mega { display: grid; }
  .header-actions { margin: 16px 0 0; }
  body.nav-open { overflow: hidden; }
  .shell-work { grid-template-columns: 1fr; }
  .shell-side { position: static; }
  .article-layout { grid-template-columns: 1fr; }
  .article-aside { position: static; }
  .privacy-band { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; gap: 26px; }
}
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .section { padding: 52px 0; }
  .hero { padding: 40px 0 40px; }
  .home-drop { padding: 30px 16px; }
  .tool-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tool-card { padding: 14px; }
  .tool-card p { display: none; }
  .tool-icon { width: 38px; height: 38px; }
  .mega { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .file-list-cards { grid-template-columns: repeat(2, 1fr); }
  .file-list-cards .file-thumb { height: 120px; }
  .page-grid { grid-template-columns: repeat(2, 1fr); }
  .dropzone { padding: 32px 16px; }
  .hide-sm { display: none !important; }
  .result-actions .btn { width: 100%; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .btn { width: 100%; }
}
@media (max-width: 380px) {
  .tool-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .site-footer, .ad-slot, #tool-app { display: none !important; }
}
