:root {
  --ink: #16233f;
  --ink-2: #4a5670;
  --ink-3: #5c6780;
  --paper: #ffffff;
  --desk: #f6f9f9;
  --line: #e1e8ea;
  --line-strong: #c8d4d8;
  --primary: #0f7a70;
  --primary-deep: #0b5f57;
  --primary-soft: #e4f5f2;
  --mint: #e5f8f0;
  --marker: #ffd23f;
  --marker-deep: #f2c21b;
  --alert: #b3261e;
  --alert-bg: #fdecea;
  --ok: #1e6e48;
  --ok-bg: #e7f4ec;
  --focus: #0f7a70;
  --radius-sheet: 6px;
  --radius-ctl: 8px;
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Manrope", "DM Sans", system-ui, sans-serif;
  --wrap: 1080px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--desk);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
}

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

a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

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

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--paper); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 12px; top: 12px; }

/* Header and footer */

.site-head { background: var(--paper); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 1.15rem; letter-spacing: -0.01em; }
.brand-mark { width: 26px; height: 32px; flex: none; }
.brand-word span { font-weight: 500; color: #0f7a70; margin-left: 10px; }

.site-nav { display: flex; gap: 22px; font-size: 0.95rem; }
.site-nav a { text-decoration: none; color: var(--ink-2); }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--ink); text-decoration: underline; }

.site-foot { margin-top: 80px; padding: 36px 0 48px; border-top: 1px solid var(--line); background: var(--paper); font-size: 0.92rem; color: var(--ink-2); }
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 28px; }
.foot-grid h2 { font-size: 0.95rem; margin: 0 0 10px; color: var(--ink); }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.foot-grid a { color: var(--ink-2); text-decoration: none; }
.foot-grid a:hover { color: var(--ink); text-decoration: underline; }
.foot-note { margin-top: 28px; }

/* Type */

h1, h2, h3 { line-height: 1.12; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 800; }
h2 { font-size: 1.55rem; font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0; }
.lede { font-size: 1.15rem; color: var(--ink-2); max-width: 60ch; }

/* Category colours: each tool keeps its category's colour everywhere */

.hue-coral { --hue: #e0505b; --hue-soft: #fff0ed; }
.hue-amber { --hue: #c98a0c; --hue-soft: #fff7df; }
.hue-blue { --hue: #3b7fd8; --hue-soft: #eaf3ff; }
.hue-teal { --hue: #17977a; --hue-soft: #e5f8f1; }
.hue-pink { --hue: #cf4b97; --hue-soft: #fff0f7; }
.hue-violet { --hue: #7653e8; --hue-soft: #f0edff; }

.tool-icon { width: 48px; height: 48px; flex: none; border-radius: 12px; background: var(--hue-soft, var(--paper)); color: var(--hue, var(--ink)); display: grid; place-items: center; }
.tool-icon svg { width: 26px; height: 26px; }
.tool-icon-lg { width: 64px; height: 64px; border-radius: 16px; }
.tool-icon-lg svg { width: 34px; height: 34px; }
.tool-icon-sm { width: 30px; height: 30px; border-radius: 8px; }
.tool-icon-sm svg { width: 18px; height: 18px; }

/* Home */

.hero { background: var(--ink); color: #fff; padding: 72px 0 64px; }
.hero-grid { display: grid; grid-template-columns: 1fr 300px; gap: 40px; align-items: center; }
.hero-art { width: 100%; height: auto; }
.hero h1 { font-size: clamp(2.3rem, 5.4vw, 3.9rem); }
.nowrap { white-space: nowrap; }
.hero .lede { margin-top: 20px; color: #c9d2e6; font-size: 1.2rem; max-width: 52ch; }
.promises { list-style: none; margin: 30px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.promises li { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.16); font-weight: 600; font-size: 0.95rem; }
.promises svg { width: 18px; height: 18px; color: var(--marker); }

.catalog { padding-top: 48px; display: grid; gap: 40px; }
.cat h2 { font-size: 1.2rem; display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.cat h2::before { content: ""; width: 12px; height: 12px; border-radius: 3px; background: var(--hue); }
.card-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.tool-card { display: grid; gap: 6px; align-content: start; height: 100%; padding: 20px; background: var(--paper); border: 1px solid var(--line); border-top: 4px solid var(--hue); border-radius: 14px; text-decoration: none; transition: border-color 0.15s, box-shadow 0.15s; }
.tool-card .tool-icon { margin-bottom: 10px; }
.tool-card:hover { border-color: var(--hue); box-shadow: 0 0 0 1px var(--hue); }
.tool-card:hover .tool-name { text-decoration: underline; }
.tool-name { font-weight: 700; font-size: 1.08rem; }
.tool-desc { font-size: 0.92rem; color: var(--ink-2); line-height: 1.45; }

.how { margin-top: 72px; }
.how > h2 { margin-bottom: 20px; }
.how-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: how; }
.how-step { counter-increment: how; background: var(--paper); border-radius: 18px; padding: 18px 20px 22px; border: 1px solid var(--line); }
.how-art { background: var(--hue-soft); border-radius: 14px; padding: 8px; margin-bottom: 16px; }
.how-art svg { width: 100%; height: auto; }
.how-step h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.how-step h3::before { content: counter(how); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--hue); color: #fff; font-size: 0.95rem; flex: none; }
.how-step p { color: var(--ink-2); }

.reasons { margin-top: 72px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.reasons h2 { font-size: 1.15rem; margin-bottom: 8px; }
.reasons p { color: var(--ink-2); }
.home-faq { margin-top: 72px; }
.home-faq h2 { margin-bottom: 16px; }

/* Tool page */

.crumbs { padding-top: 28px; font-size: 0.9rem; color: var(--ink-2); }
.crumbs a { color: var(--ink-2); }
.tool-head { padding: 14px 0 28px; display: grid; grid-template-columns: 1fr 340px; gap: 32px; align-items: center; }
.tool-head-text { display: grid; grid-template-columns: auto 1fr; column-gap: 18px; align-items: center; }
.tool-head .lede { grid-column: 1 / -1; }
.tool-picture-wrap { background: var(--hue-soft); border-radius: 20px; padding: 14px 10px; }
.tool-picture { width: 100%; height: auto; }
.tool-head .lede { margin-top: 12px; }

.sheet {
  position: relative;
  background: var(--paper);
  border-radius: var(--radius-sheet);
  box-shadow: 0 1px 0 var(--line), 0 12px 30px -18px rgba(22, 35, 63, 0.35);
}

/* Folded corner: the signature of the site */
.sheet.folded { clip-path: polygon(0 0, calc(100% - 44px) 0, 100% 44px, 100% 100%, 0 100%); }
.sheet.folded::after {
  content: "";
  position: absolute; top: 0; right: 0; width: 44px; height: 44px;
  background: linear-gradient(225deg, var(--desk) 50%, #d9dee6 50%);
  border-bottom-left-radius: 6px;
}

.drop {
  padding: 56px 24px 52px;
  text-align: center;
  border: 2px dashed transparent;
  transition: border-color 0.15s, background-color 0.15s;
}
.drop.is-over { border-color: var(--ink); background: #fffbe0; }
.drop-icon { width: 54px; height: 64px; margin: 0 auto 18px; }
.drop-title { font-size: 1.3rem; font-weight: 700; }
.drop-note { margin-top: 10px; color: var(--ink-2); font-size: 0.95rem; }
.drop .btn { margin-top: 22px; }
.drop.compact { padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; text-align: left; flex-wrap: wrap; }
.drop.compact .drop-icon, .drop.compact .drop-title { display: none; }
.drop.compact .btn { margin-top: 0; order: 2; }
.drop.compact .drop-note { margin-top: 0; }

.safe-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; font-size: 0.92rem; color: var(--ink-2); }
.safe-note svg { width: 18px; height: 18px; flex: none; margin-top: 3px; }

/* Buttons and controls */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px;
  border-radius: var(--radius-ctl);
  border: 1px solid var(--line-strong);
  background: var(--paper); color: var(--ink);
  font: inherit; font-weight: 700; font-size: 1rem;
  cursor: pointer; text-decoration: none;
  position: relative;
}
.btn:hover { border-color: var(--ink); }
.btn-primary { background: var(--marker); border-color: var(--marker-deep); box-shadow: inset 0 -3px 0 var(--marker-deep); }
.btn-primary:hover { background: #ffd23f; border-color: var(--ink); }
.btn-big { min-height: 54px; padding: 0 30px; font-size: 1.08rem; }
.btn-small { min-height: 36px; padding: 0 12px; font-size: 0.9rem; font-weight: 600; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.icon-btn { width: 36px; height: 36px; padding: 0; min-height: 36px; }
.icon-btn svg { width: 18px; height: 18px; }

.work { margin-top: 20px; }
.panel { padding: 22px; }
.panel + .panel { margin-top: 16px; }
.panel-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 14px; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 20px; }

.field { display: grid; gap: 6px; }
.field-label { font-weight: 600; font-size: 0.95rem; }
.field-help { font-size: 0.85rem; color: var(--ink-2); }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; }

input[type="text"], input[type="number"], select {
  font: inherit; font-size: 1rem; color: var(--ink);
  min-height: 44px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-ctl); background: var(--paper);
  width: 100%;
}
input[type="range"] { width: 100%; accent-color: var(--ink); }
input[type="color"] { width: 54px; height: 44px; border: 1px solid var(--line-strong); border-radius: var(--radius-ctl); background: var(--paper); padding: 4px; }

.choice-group { display: grid; gap: 8px; border: 0; padding: 0; margin: 0; }
.choice-group legend { font-weight: 600; font-size: 0.95rem; margin-bottom: 6px; padding: 0; }
.choice { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-ctl); cursor: pointer; }
.choice:has(input:checked) { border-color: var(--ink); background: #fffbe0; }
.choice input { margin: 4px 0 0; accent-color: var(--ink); width: 18px; height: 18px; }
.choice strong { display: block; }
.choice span { font-size: 0.9rem; color: var(--ink-2); }
.check { display: flex; gap: 10px; align-items: center; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }

/* File list */

.file-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.file-item { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-ctl); background: var(--paper); }
.file-thumb { width: 40px; height: 48px; object-fit: cover; border: 1px solid var(--line); border-radius: 3px; background: var(--desk); }
.file-meta { min-width: 0; }
.file-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.file-info { font-size: 0.85rem; color: var(--ink-2); }
.file-ctl { display: flex; gap: 6px; }

/* Page grid */

.grid-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.grid-hint { font-size: 0.9rem; color: var(--ink-2); }
.page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.page-tile { min-width: 0; background: var(--desk); border-radius: var(--radius-ctl); padding: 10px; display: grid; gap: 8px; border: 2px solid transparent; }
.page-tile.is-dragging { opacity: 0.4; }
.page-tile.is-target { border-color: var(--ink); }
.page-tile.is-deleted .page-frame { opacity: 0.3; }
.page-tile.is-deleted .page-frame::after { content: "Removed"; position: absolute; inset: auto 0 45% 0; z-index: 1; text-align: center; font-weight: 700; color: var(--alert); }
.page-frame { position: relative; aspect-ratio: 3 / 4; display: grid; place-items: center; min-width: 0; overflow: hidden; }
.page-frame canvas { position: absolute; inset: 0; margin: auto; max-height: 100%; max-width: 100%; width: auto; height: auto; box-shadow: 0 1px 4px rgba(22, 35, 63, 0.25); background: #fff; transition: transform 0.2s; }
.page-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.page-bar .page-num { flex: 1 0 100%; }
.page-num { font-size: 0.85rem; font-weight: 600; color: var(--ink-2); }
.page-bar .file-ctl { gap: 4px; }
.page-bar .icon-btn { width: 32px; height: 32px; min-height: 32px; }
.page-tile[draggable="true"] { cursor: grab; }

/* Status and result */

.status { margin-top: 16px; padding: 12px 14px; border-radius: var(--radius-ctl); font-size: 0.95rem; }
.status[hidden] { display: none; }
.status.is-error { background: var(--alert-bg); color: var(--alert); font-weight: 600; }
.status.is-info { background: var(--paper); border: 1px solid var(--line); }
.progress { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.progress > div { height: 100%; background: var(--ink); width: 0; transition: width 0.2s; }

.result { padding: 28px; margin-top: 20px; }
.result h2 { font-size: 1.4rem; }
.result p { margin-top: 8px; color: var(--ink-2); }
.result .actions { margin-top: 18px; }
.result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; margin-top: 20px; }
.result-grid a { display: grid; gap: 6px; font-size: 0.85rem; text-decoration: none; color: var(--ink-2); }
.result-grid img { border: 1px solid var(--line); border-radius: 3px; background: #fff; }

/* Signature */

.sig-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.sig-tabs .btn[aria-selected="true"] { border-color: var(--ink); background: #fffbe0; }
.sig-pad { width: 100%; height: 180px; border: 1px dashed var(--line-strong); border-radius: var(--radius-ctl); background: #fff; touch-action: none; cursor: crosshair; }
.sig-type-preview { height: 120px; display: grid; place-items: center; border: 1px dashed var(--line-strong); border-radius: var(--radius-ctl); font-family: "Caveat", cursive; font-size: 3rem; overflow: hidden; margin-top: 10px; }
.place-stage { position: relative; display: inline-block; max-width: 100%; margin-top: 12px; cursor: copy; }
.place-stage canvas { box-shadow: 0 1px 6px rgba(22, 35, 63, 0.3); }
.place-sig { position: absolute; outline: 2px dashed var(--focus); pointer-events: none; }
.pager { display: flex; align-items: center; gap: 10px; margin-top: 10px; }

/* Content below tools */

.content { margin-top: 64px; display: grid; gap: 56px; }
.content section > h2 { margin-bottom: 18px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; counter-reset: step; }
.steps li { counter-increment: step; padding-top: 14px; border-top: 3px solid var(--ink); }
.steps li::before { content: counter(step); display: block; font-weight: 800; font-size: 1.6rem; line-height: 1; margin-bottom: 10px; }
.steps h3 { margin-bottom: 6px; }
.steps p { color: var(--ink-2); }

.prose { max-width: 68ch; }
.prose p + p { margin-top: 14px; }
.prose p { color: var(--ink-2); }

.faq { max-width: 76ch; border-top: 1px solid var(--line-strong); }
.faq details { border-bottom: 1px solid var(--line-strong); }
.faq summary { cursor: pointer; padding: 16px 0; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-weight: 400; font-size: 1.4rem; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding: 0 0 18px; color: var(--ink-2); max-width: 68ch; }

.related { display: flex; flex-wrap: wrap; gap: 10px; }
.related a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-ctl); text-decoration: none; font-weight: 600; }
.related a:hover { border-color: var(--ink); }


.page-doc { padding: 40px 0; }
.page-doc .prose { margin-top: 24px; }
.page-doc h2 { margin-top: 32px; margin-bottom: 10px; font-size: 1.3rem; }

.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 960px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .tool-head { grid-template-columns: 1fr; gap: 20px; }
  .tool-picture-wrap { max-width: 380px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { display: none; }
}

@media (max-width: 860px) {
  .reasons, .steps, .how-steps { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .hero { padding: 44px 0 40px; }
}

@media (max-width: 520px) {
  body { font-size: 16px; }
  .nowrap { white-space: normal; }
  .site-nav a.nav-secondary { display: none; }
  .drop { padding: 40px 18px; }
  .panel, .result { padding: 18px; }
  .page-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tool-card { padding: 16px; }
  .tool-icon-lg { width: 52px; height: 52px; }
  .tool-picture-wrap { padding: 8px; }
  .tool-picture { max-height: 120px; }
  .file-item { grid-template-columns: 36px 1fr; }
  .file-ctl { grid-column: 1 / -1; justify-content: flex-end; }
  .btn-big { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Licences page */
.prose.wide { max-width: none; }
.table-scroll { overflow-x: auto; margin: 20px 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-ctl); }
.lic-table { border-collapse: collapse; width: 100%; font-size: 0.88rem; min-width: 760px; }
.lic-table th, .lic-table td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--ink); }
.lic-table th { background: var(--desk); font-weight: 700; }
.lic-text { white-space: pre-wrap; font-size: 0.8rem; line-height: 1.5; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-ctl); padding: 14px; max-height: 320px; overflow: auto; }
.page-doc h3 { margin-top: 24px; margin-bottom: 8px; }
.page-doc ul { color: var(--ink-2); }


/* ===== Bright theme (from the owner's Replit design) ===== */

body {
  background-color: var(--desk);
  background-image:
    radial-gradient(ellipse at 8% 0%, rgb(255 122 89 / 9%), transparent 29rem),
    radial-gradient(ellipse at 96% 22%, rgb(46 196 182 / 9%), transparent 31rem);
  background-repeat: no-repeat;
}
h1, h2, h3, .brand, .tool-name, .drop-title { font-family: var(--font-display); }
h1 { letter-spacing: -0.04em; }

.site-head { background: rgb(255 255 255 / 85%); border-bottom-color: rgb(15 122 112 / 10%); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 800; letter-spacing: -0.03em; }
.brand-word span { color: #0f7a70; }
.brand-mark { width: 34px; height: 34px; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--primary); }

/* Hero card */
.hero { background: none; color: #fff; padding: 28px 0 0; }
.hero .wrap { position: relative; isolation: isolate; overflow: hidden; border-radius: 30px; padding: 56px clamp(24px, 5vw, 58px); background: linear-gradient(118deg, #0b5f57 0%, #0f7a70 52%, #0d6f66 100%); box-shadow: 0 20px 48px rgb(15 122 112 / 20%); }
.hero .wrap::before, .hero .wrap::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; pointer-events: none; }
.hero .wrap::before { width: 370px; height: 370px; right: 8%; top: -245px; background: rgb(255 255 255 / 10%); }
.hero .wrap::after { width: 260px; height: 260px; right: -65px; bottom: -155px; background: rgb(255 185 87 / 36%); }
.hero h1 { color: #fff; }
.hero h1 .highlight { color: #ffd23f; }
.hero .lede { color: rgb(255 255 255 / 85%); }
.hero-stamp { width: 140px; height: 140px; border-radius: 50%; border: 1px solid rgb(255 255 255 / 50%); background: rgb(255 255 255 / 14%); display: grid; place-content: center; text-align: center; transform: rotate(7deg); color: #fff; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; line-height: 1.3; justify-self: end; }
.hero-stamp strong { display: block; font-family: var(--font-display); font-size: 1.9rem; letter-spacing: -0.03em; color: #ffd23f; }
.hero-grid { grid-template-columns: 1fr auto; }
.promises li { background: rgb(255 255 255 / 14%); border-color: rgb(255 255 255 / 28%); }
.promises svg { color: #ffd23f; }

.privacy-banner { display: flex; align-items: center; gap: 14px; margin-top: 22px; padding: 16px 20px; border-radius: 16px; border: 1px solid #ccece0; background: linear-gradient(105deg, #e5f8f0, #f0fbf4 60%, #fff8da); color: #214838; }
.privacy-banner .pb-icon { width: 40px; height: 40px; border-radius: 12px; background: #c9efdf; color: #1d9b73; display: grid; place-items: center; flex: none; }
.privacy-banner .pb-icon svg { width: 20px; height: 20px; }
.privacy-banner b { display: block; }
.privacy-banner span { color: #537663; font-size: 0.95rem; }

/* Catalog */
.catalog { padding-top: 40px; }
.cat h2 { font-size: 1.5rem; letter-spacing: -0.03em; }
.cat h2::before { display: none; }
.tool-card { position: relative; overflow: hidden; border: 1px solid var(--line); border-top: 1px solid var(--line); border-radius: 19px; box-shadow: 0 5px 18px rgb(22 35 63 / 4%); transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; }
.tool-card::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--hue); }
.tool-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--hue) 45%, white); box-shadow: 0 14px 28px rgb(22 35 63 / 11%); }
.tool-card .tool-arrow { position: absolute; top: 20px; right: 18px; width: 28px; height: 28px; border-radius: 50%; background: var(--hue-soft); color: var(--hue); display: grid; place-items: center; }
.tool-card .tool-arrow svg { width: 15px; height: 15px; }
.tool-icon { border-radius: 13px; }

/* Buttons and upload area */
.btn { border-radius: 12px; border-color: var(--line-strong); }
.btn:hover { border-color: var(--primary); }
.btn-primary { background: linear-gradient(110deg, #0f7a70, #12897d); border-color: transparent; color: #fff; box-shadow: 0 6px 15px rgb(15 122 112 / 21%); }
.btn-primary:hover { background: linear-gradient(110deg, #0b5f57, #0d6b62); border-color: transparent; }
.sheet { border-radius: 18px; box-shadow: 0 12px 32px rgb(22 35 63 / 6%); border: 1px solid var(--line); }
.sheet.folded { clip-path: none; }
.sheet.folded::after { display: none; }
.drop { border: 2px dashed rgb(15 122 112 / 36%); background: linear-gradient(110deg, #e8f6f3, #f7fbfa); }
.drop.is-over { border-color: var(--primary); background: #d9efeb; }
.choice:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.choice input, .check input, input[type="range"] { accent-color: var(--primary); }
.sig-tabs .btn[aria-selected="true"] { border-color: var(--primary); background: var(--primary-soft); }
.progress > div { background: linear-gradient(90deg, #0f7a70, #0d6f66); }
.safe-note svg { color: #1d9b73; }
.steps li { border-top-color: var(--primary); }
.steps li::before { color: var(--primary); }

/* Footer */
.site-foot { background: #16233f; border-top: 0; color: rgb(255 255 255 / 68%); }
.site-foot .brand { color: #fff; }
.site-foot .brand-word span { color: #7fe3d9; }
.foot-grid h2 { color: #fff; }
.foot-grid a, .site-foot .foot-note a { color: rgb(255 255 255 / 72%); }
.foot-grid a:hover, .site-foot .foot-note a:hover { color: #fff; }

@media (max-width: 960px) {
  .hero-stamp { display: none; }
}
@media (max-width: 700px) {
  .hero { padding-top: 16px; }
  .hero .wrap { border-radius: 23px; padding: 36px 22px 32px; margin: 0 12px; }
  .privacy-banner { align-items: flex-start; }
}

.brand-mark { width: 36px; height: 36px; filter: drop-shadow(0 4px 8px rgb(22 35 63 / 16%)); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 30px; }
.btn-hero { background: #fff; color: #0b5f57; border-color: #fff; box-shadow: 0 8px 20px rgb(10 60 55 / 25%); }
.btn-hero:hover { background: #fffbe0; border-color: #fff; }
.hero-chip { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px; color: #fff; text-decoration: none; font-weight: 600; font-size: 0.95rem; background: rgb(255 255 255 / 14%); border: 1px solid rgb(255 255 255 / 30%); }
.hero-chip:hover { background: rgb(255 255 255 / 24%); }
.card-grid { grid-template-columns: repeat(3, 1fr); }
.tool-card { padding: 22px 24px; }
@media (max-width: 960px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .card-grid { grid-template-columns: 1fr; } .hero-chip { min-height: 36px; padding: 0 13px; font-size: 0.9rem; } }

/* Lucide icons in the tool's colour on a soft tile (as in the Replit design) */
.tool-icon { color: var(--hue, var(--primary)); }
.tool-icon svg { width: 24px; height: 24px; }
.tool-card .tool-icon { width: 52px; height: 52px; border-radius: 15px; }
.tool-card .tool-icon svg { width: 26px; height: 26px; }
.tool-icon-lg { width: 64px; height: 64px; border-radius: 18px; }
.tool-icon-lg svg { width: 32px; height: 32px; }
.tool-icon-sm { width: 32px; height: 32px; border-radius: 9px; }
.tool-icon-sm svg { width: 18px; height: 18px; }

/* Selectable page tiles (Extract pages) */
.page-tile.selectable { cursor: pointer; position: relative; }
.page-tile.selectable::before { content: ""; position: absolute; top: 14px; right: 14px; z-index: 2; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-strong); background: #fff; }
.page-tile.is-selected { border-color: var(--primary); background: var(--primary-soft); }
.page-tile.is-selected::before { border-color: var(--primary); background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 16px no-repeat; }
.pw-field { position: relative; }
.pw-strength { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 6px; }
.pw-strength > div { height: 100%; width: 0; transition: width 0.2s, background-color 0.2s; }
textarea.text-box { font: inherit; font-size: 1rem; width: 100%; min-height: 180px; padding: 12px; border: 1px solid var(--line-strong); border-radius: 12px; resize: vertical; color: var(--ink); background: #fff; }

/* ===== Design A: clean grid, tools first (purple brand) ===== */
body { background: #fff; background-image: none; }
.site-head { background: rgb(255 255 255 / 92%); border-bottom: 1px solid #e9eef0; }
.hero-a { padding: 64px 0 8px; text-align: center; color: var(--ink); }
.hero-a .wrap { background: none; box-shadow: none; border-radius: 0; padding: 0 20px; overflow: visible; }
.hero-a .wrap::before, .hero-a .wrap::after { display: none; }
.hero-a h1 { color: var(--ink); font-size: clamp(2.2rem, 5.2vw, 3.6rem); }
.hero-a h1 .highlight { display: block; color: transparent; background: linear-gradient(100deg, #0b5f57, #12897d 55%, #13a08f); -webkit-background-clip: text; background-clip: text; }
.hero-a .lede { color: var(--ink-2); margin: 18px auto 0; max-width: 58ch; }
.badges { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.badges li { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; background: #eef4f3; font-weight: 600; font-size: 0.9rem; }
.badges svg { width: 16px; height: 16px; color: #1d9b73; }
.catalog-a { padding-top: 30px; }
.filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 28px; }
.filter { font: inherit; font-weight: 600; font-size: 0.95rem; padding: 9px 18px; border-radius: 999px; border: 1px solid #d3dde0; background: #fff; color: var(--ink); cursor: pointer; }
.filter:hover { border-color: var(--primary); }
.filter.is-on { background: var(--primary); border-color: var(--primary); color: #fff; }
.card-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
.card-grid > li[hidden] { display: none; }
.tool-card { border: 1px solid #e7ecee; border-radius: 16px; box-shadow: none; padding: 22px; gap: 4px; }
.tool-card::after { display: none; }
.tool-card:hover { transform: translateY(-3px); border-color: transparent; box-shadow: 0 12px 30px rgb(22 35 63 / 10%); }
.tool-card:hover .tool-name { text-decoration: none; color: var(--hue); }
.tool-card .tool-icon { width: 54px; height: 54px; background: none; border-radius: 0; margin-bottom: 12px; display: block; }
.tool-card .tool-icon svg, .tool-icon .file-icon { width: 100%; height: 100%; }
.tool-icon { background: none; }
.tool-icon-lg { width: 72px; height: 72px; }
.tool-icon-sm { width: 30px; height: 30px; }
.tool-icon-sm svg, .tool-icon-lg svg { width: 100%; height: 100%; }
.privacy-banner { margin-top: 48px; position: relative; }
.privacy-banner .hero-stamp { margin-left: auto; width: 96px; height: 96px; border-color: #b9e6d3; background: #fff; color: #1d6f52; transform: rotate(7deg); font-size: 0.6rem; flex: none; }
.privacy-banner .hero-stamp strong { color: #1d9b73; font-size: 1.35rem; }
.how { background: #f5f8f8; border-radius: 24px; padding: 32px; margin-top: 56px; }
.how-step { border-color: #e7ecee; }
/* Upload area takes the colour of the file type it accepts */
.tool .drop { border-color: color-mix(in srgb, var(--hue) 40%, white); background: var(--hue-soft); }
.tool .drop.is-over { border-color: var(--hue); background: color-mix(in srgb, var(--hue) 14%, white); }
.drop-icon { display: block; width: 64px; height: 64px; margin: 0 auto 16px; }
.drop-icon svg { width: 100%; height: 100%; }
/* Small file-type label used in file lists and on download buttons */
.ft-chip { display: inline-block; padding: 1px 7px; border-radius: 5px; color: #fff; font: 800 0.7rem/1.6 var(--font-display); letter-spacing: 0.04em; vertical-align: 1px; margin-right: 6px; }
@media (max-width: 960px) { .card-grid { grid-template-columns: repeat(2, 1fr); } .privacy-banner .hero-stamp { display: none; } }
@media (max-width: 560px) { .card-grid { grid-template-columns: 1fr; } .hero-a { padding-top: 40px; } .how { padding: 20px; } .tool-card { display: grid; grid-template-columns: 48px 1fr; column-gap: 14px; align-items: center; } .tool-card .tool-icon { width: 48px; height: 48px; margin: 0; grid-row: span 2; } }
.foot-grid { grid-template-columns: 1.3fr repeat(4, 1fr); }
@media (max-width: 860px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
.hero-a h1 { font-size: clamp(1.85rem, 8.4vw, 3.6rem); }
.hero-a h1 .highlight { white-space: nowrap; }
.btn .ft-chip { margin-right: 2px; box-shadow: 0 0 0 1.5px rgb(255 255 255 / 70%); }
.page-preview { margin: 0; display: grid; gap: 6px; font-size: 0.85rem; color: var(--ink-2); text-align: center; }
.page-preview img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 4px; background: #fff; box-shadow: 0 2px 8px rgb(22 35 63 / 8%); }

/* ===== Tool icons: white symbol on a solid coloured square ===== */
.tile-coral { --tile: #e5484d; } .tile-amber { --tile: #d97706; } .tile-blue { --tile: #2f6fed; }
.tile-teal { --tile: #0f9f83; } .tile-pink { --tile: #d6409f; } .tile-violet { --tile: #7c4ddb; }
.tool-icon.tile { background: var(--tile); color: #fff; display: grid; place-items: center; border-radius: 12px; }
.tool-card .tool-icon.tile { width: 46px; height: 46px; margin-bottom: 16px; }
.tool-icon.tile svg { width: 52%; height: 52%; }
.tool-icon-lg.tile { width: 64px; height: 64px; border-radius: 16px; }
.tool-icon-sm.tile { width: 30px; height: 30px; border-radius: 8px; }
.tool-card:hover .tool-name { color: var(--tile); }

/* Sign PDF: drag to move, drag corners to resize */
.place-sig { pointer-events: auto; cursor: move; touch-action: none; user-select: none; outline: 2px dashed var(--primary); outline-offset: 2px; }
.place-sig img { width: 100%; height: 100%; display: block; pointer-events: none; }
.place-sig.is-dragging { outline-style: solid; }
.sig-handle { position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2.5px solid var(--primary); box-shadow: 0 1px 4px rgb(22 35 63 / 30%); touch-action: none; }
.sig-handle.nw { left: -11px; top: -11px; cursor: nwse-resize; }
.sig-handle.ne { right: -11px; top: -11px; cursor: nesw-resize; }
.sig-handle.sw { left: -11px; bottom: -11px; cursor: nesw-resize; }
.sig-handle.se { right: -11px; bottom: -11px; cursor: nwse-resize; }
@media (pointer: coarse) { .sig-handle { width: 26px; height: 26px; } .sig-handle.nw, .sig-handle.sw { left: -15px; } .sig-handle.ne, .sig-handle.se { right: -15px; } .sig-handle.nw, .sig-handle.ne { top: -15px; } .sig-handle.sw, .sig-handle.se { bottom: -15px; } }
.sig-size-btns { display: inline-flex; gap: 6px; margin-left: auto; }
.pager { flex-wrap: wrap; }

/* ===== Merge PDF: visual page planner ===== */
.mp-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.mp-head .sig-tabs { margin: 0; }
.mp-summary { font-weight: 600; color: var(--ink-2); font-size: 0.95rem; }
.mp-help { margin: 10px 0 16px; }
.mp-letter { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 6px; background: var(--doc); color: #fff; font: 800 0.75rem/1 var(--font-display); }
.mp-legend { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.mp-legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--ink-2); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.mp-tile { position: relative; min-width: 0; display: grid; gap: 6px; padding: 8px; border-radius: 12px; background: var(--desk); border: 2px solid transparent; border-top: 3px solid var(--doc); }
.mp-tile[draggable="true"] { cursor: grab; }
.mp-tile.is-dragging { opacity: 0.35; }
.mp-tile.drop-before { box-shadow: -5px 0 0 -1px var(--primary); }
.mp-tile.drop-after { box-shadow: 5px 0 0 -1px var(--primary); }
.mp-frame { position: relative; aspect-ratio: 3 / 4; display: grid; place-items: center; }
.mp-open { all: unset; cursor: zoom-in; display: grid; place-items: center; width: 100%; height: 100%; border-radius: 4px; }
.mp-open:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.mp-thumb { max-width: 100%; max-height: 100%; width: auto; height: auto; background: #fff; box-shadow: 0 1px 4px rgb(22 35 63 / 25%); min-width: 60%; min-height: 70%; object-fit: contain; }
.mp-thumb.loaded { min-width: 0; min-height: 0; }
.thumb-missing { font-size: 0.8rem; color: var(--ink-2); }
.mp-pos { position: absolute; top: 6px; left: 6px; padding: 2px 8px; border-radius: 999px; background: var(--ink); color: #fff; font: 800 0.8rem/1.5 var(--font-display); pointer-events: none; }
.mp-tile.is-deleted .mp-thumb { opacity: 0.25; filter: grayscale(1); }
.mp-tile.is-deleted .mp-pos { background: var(--alert); }
.mp-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px; }
.mp-src { display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; font-weight: 600; color: var(--ink-2); }
.mp-bar .icon-btn { width: 30px; height: 30px; min-height: 30px; }
.mp-tile.compact { padding: 6px; }
.mp-doclist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.mp-doc { display: grid; grid-template-columns: auto 52px 1fr auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-left: 4px solid var(--doc); border-radius: 12px; background: #fff; }
.mp-doc[draggable="true"] { cursor: grab; }
.mp-doc.is-dragging { opacity: 0.4; }
.mp-doc.is-target { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.mp-doc.has-error .file-info { color: var(--alert); }
.mp-doc-thumb { width: 52px; height: 64px; display: grid; place-items: center; background: var(--desk); border-radius: 4px; overflow: hidden; }
.mp-doc-thumb .mp-thumb { max-height: 64px; }
.mp-expand { margin-top: 6px; justify-self: start; }
.mp-doc .file-meta { display: grid; justify-items: start; }
.mp-docpages { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }
.mp-toast { position: sticky; bottom: 16px; margin-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 10px 16px; border-radius: 12px; background: var(--ink); color: #fff; box-shadow: 0 10px 30px rgb(16 24 40 / 25%); z-index: 3; }
.mp-toast[hidden] { display: none; }
.mp-toast .btn { background: #fff; }
.mp-backdrop { position: fixed; inset: 0; z-index: 50; background: rgb(16 24 40 / 72%); display: grid; place-items: center; padding: 16px; }
.mp-view { width: min(1000px, 100%); max-height: calc(100vh - 32px); display: grid; grid-template-rows: auto 1fr auto; background: #fff; border-radius: 16px; overflow: hidden; }
.mp-view-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.mp-view-bar:last-child { border-bottom: 0; border-top: 1px solid var(--line); }
.mp-view-title { font-size: 0.9rem; font-weight: 600; color: var(--ink-2); flex: 1 1 260px; }
.mp-view-ctl { display: flex; align-items: center; gap: 6px; }
.mp-zoom { min-width: 48px; text-align: center; font-weight: 700; font-size: 0.9rem; }
.mp-view-canvas { overflow: auto; background: var(--desk); padding: 12px; min-height: 200px; display: grid; justify-items: center; align-items: start; }
.mp-view-canvas canvas { box-shadow: 0 2px 12px rgb(22 35 63 / 25%); background: #fff; max-width: none; }
.mp-view-canvas canvas.is-deleted { opacity: 0.35; }
body.mp-noscroll { overflow: hidden; }
@media (max-width: 560px) {
  .mp-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .mp-doc { grid-template-columns: auto 44px 1fr; }
  .mp-doc .file-ctl { grid-column: 1 / -1; justify-content: flex-end; }
}
.mp-frame { overflow: hidden; }
.mp-open { position: absolute; inset: 0; }
.mp-tile { grid-template-rows: auto auto; align-content: start; }
.drop-limits { margin-top: 8px; font-size: 0.85rem; color: var(--ink-2); }
.drop.compact .drop-limits { display: none; }
.mp-tools-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.mp-pages .grid-tools { justify-content: space-between; }
.mp-ghost { position: fixed; z-index: 60; transform: translate(-50%, -130%); padding: 6px 12px; border-radius: 999px; background: var(--primary); color: #fff; font-weight: 700; font-size: 0.85rem; pointer-events: none; box-shadow: 0 6px 18px rgb(15 122 112 / 35%); }
.mp-thumb { transition: transform 0.2s; }
.result-again { margin-top: 22px !important; padding-top: 14px; border-top: 1px solid var(--line); }
.link-btn { all: unset; cursor: pointer; color: var(--ink-2); font-size: 0.92rem; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--primary); }
.link-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

/* Crop PDF */
.crop-stage { cursor: default; }
.crop-box { position: absolute; outline: 2px solid var(--primary); box-shadow: 0 0 0 9999px rgb(16 24 40 / 45%); cursor: move; touch-action: none; }
.crop-handle { position: absolute; width: 16px; height: 16px; background: #fff; border: 2.5px solid var(--primary); border-radius: 4px; touch-action: none; }
.crop-handle.nw { left: -9px; top: -9px; cursor: nwse-resize; } .crop-handle.se { right: -9px; bottom: -9px; cursor: nwse-resize; }
.crop-handle.ne { right: -9px; top: -9px; cursor: nesw-resize; } .crop-handle.sw { left: -9px; bottom: -9px; cursor: nesw-resize; }
.crop-handle.n { left: calc(50% - 8px); top: -9px; cursor: ns-resize; } .crop-handle.s { left: calc(50% - 8px); bottom: -9px; cursor: ns-resize; }
.crop-handle.e { top: calc(50% - 8px); right: -9px; cursor: ew-resize; } .crop-handle.w { top: calc(50% - 8px); left: -9px; cursor: ew-resize; }
.crop-stage { overflow: hidden; }
@media (pointer: coarse) { .crop-handle { width: 24px; height: 24px; } }

/* Compare PDF */
.cmp-slots { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
.cmp-slot { display: grid; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; min-width: 0; }
.cmp-slot.empty { border-style: dashed; background: var(--desk); }
.cmp-slot-title { font-weight: 800; font-family: var(--font-display); }
.cmp-out { margin-top: 20px; }
.cmp-result h2 { font-size: 1.35rem; margin-bottom: 6px; }
.cmp-result h3 { font-size: 1rem; margin: 18px 0 10px; }
.cmp-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 24px; }
.cmp-list { margin: 0; padding-left: 22px; display: grid; gap: 8px; max-height: 560px; overflow: auto; font-size: 0.92rem; }
.cmp-list a { text-decoration: none; color: var(--ink); }
.cmp-list a:hover { text-decoration: underline; }
.cmp-where { display: inline-block; margin-right: 6px; font-size: 0.78rem; font-weight: 700; color: var(--ink-2); background: var(--desk); padding: 1px 6px; border-radius: 4px; }
.cmp-text { line-height: 1.75; font-size: 0.95rem; max-height: 560px; overflow: auto; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
del { background: #fde3e3; color: #a01f1f; text-decoration: line-through; border-radius: 3px; padding: 0 2px; }
ins { background: #dcf5e6; color: #146b3c; text-decoration: underline; border-radius: 3px; padding: 0 2px; }
.cmp-change:target { outline: 3px solid var(--primary); border-radius: 4px; }
.cmp-skip { color: var(--ink-2); font-style: italic; font-size: 0.85rem; background: var(--desk); padding: 1px 8px; border-radius: 999px; }
.cmp-strip { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.cmp-chip { font: inherit; font-size: 0.85rem; font-weight: 600; display: grid; gap: 2px; padding: 6px 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; text-align: left; }
.cmp-chip span { font-weight: 500; font-size: 0.75rem; color: var(--ink-2); }
.cmp-chip.changed { border-color: #f1a5a5; background: #fff3f3; }
.cmp-chip.changed span, .cmp-chip.missing span { color: #a01f1f; }
.cmp-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 12px; }
.cmp-fig { margin: 0; display: grid; gap: 8px; }
.cmp-fig canvas { box-shadow: 0 2px 10px rgb(22 35 63 / 20%); background: #fff; }
.cmp-fig figcaption { font-size: 0.85rem; color: var(--ink-2); }
.cmp-none { aspect-ratio: 3/4; display: grid; place-items: center; background: var(--desk); border-radius: 8px; color: var(--ink-2); }
@media (max-width: 760px) { .cmp-cols, .cmp-pair { grid-template-columns: 1fr; } .cmp-slots { grid-template-columns: 1fr; } }

/* Page previews shown by every tool */
.pv-panel { margin-bottom: 16px; }
.pv-panel > summary { cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; list-style: none; }
.pv-panel > summary::-webkit-details-marker { display: none; }
.pv-panel > summary .panel-title { margin: 0; }
.pv-panel > summary::after { content: "Hide"; font-size: 0.85rem; color: var(--primary); font-weight: 600; }
.pv-panel:not([open]) > summary::after { content: "Show"; }
.pv-count { margin-left: auto; font-size: 0.9rem; color: var(--ink-2); font-weight: 600; }
.pv-help { margin: 8px 0 12px; }
.pv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; max-height: 340px; overflow: auto; padding: 4px; }
.pv-tile { all: unset; cursor: zoom-in; display: grid; gap: 6px; justify-items: center; }
.pv-tile:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.pv-frame { width: 100%; aspect-ratio: 3 / 4; display: grid; place-items: center; background: var(--desk); border-radius: 6px; }
.pv-thumb { max-width: 92%; max-height: 92%; background: #fff; box-shadow: 0 1px 4px rgb(22 35 63 / 25%); min-width: 60%; min-height: 70%; }
.pv-thumb.loaded { min-width: 0; min-height: 0; }
.pv-num { font-size: 0.8rem; font-weight: 600; color: var(--ink-2); }
.pv-tile:hover .pv-thumb { box-shadow: 0 0 0 2px var(--primary); }

/* Split PDF: page grid with cut points */
.sp-fields { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }
.sp-opts { display: grid; gap: 14px; }
.sp-help { margin: 18px 0 12px; }
.sp-grid { display: flex; flex-wrap: wrap; align-items: stretch; row-gap: 14px; }
.sp-tile { width: 118px; display: grid; gap: 6px; padding: 6px; border-radius: 10px; background: var(--desk); border: 3px solid var(--g, transparent); }
.sp-tile.out { opacity: 0.45; }
.sp-tile.picked { box-shadow: 0 0 0 3px var(--primary); }
.sp-open { all: unset; cursor: pointer; aspect-ratio: 3 / 4; display: grid; place-items: center; }
.sp-open:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sp-open .pv-thumb { max-width: 100%; max-height: 100%; }
.sp-num { display: flex; align-items: center; gap: 6px; justify-content: center; font-size: 0.8rem; font-weight: 600; color: var(--ink-2); }
.sp-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--g); }
.sp-cut { all: unset; cursor: pointer; width: 26px; display: grid; place-items: center; position: relative; color: var(--ink-3); }
.sp-cut span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 1px solid var(--line-strong); font-size: 0.8rem; z-index: 1; }
.sp-cut:hover span, .sp-cut:focus-visible span { border-color: var(--primary); color: var(--primary); }
.sp-cut.on { color: var(--alert); }
.sp-cut.on::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; border-left: 2px dashed var(--alert); }
.sp-cut.on span { background: var(--alert); border-color: var(--alert); color: #fff; }
.sp-gap { width: 26px; }
.sp-summary { margin-top: 18px; }
.sp-summary-title { font-weight: 700; margin-bottom: 8px; }
.sp-files, .sp-downloads { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 6px; max-height: 260px; overflow: auto; }
.sp-files li, .sp-downloads li { padding-left: 14px; border-left: 4px solid var(--g); font-size: 0.92rem; color: var(--ink-2); }
.sp-files .link-btn { color: var(--ink); font-weight: 600; }
.sp-downloads { margin-top: 16px; }
@media (max-width: 760px) { .sp-fields { grid-template-columns: 1fr; } .sp-tile { width: 96px; } }

/* Once a file is chosen, the upload box turns green with a tick: all is well. */
.tool .drop.compact { border: 2px solid #9fdcc0; background: #ecfaf3; }
.tool .drop.compact.is-over { border-color: var(--hue); background: var(--hue-soft); }
.drop.compact .drop-note { color: #1d5c44; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.drop.compact .drop-note::before { content: "✓"; flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #1d9b73; color: #fff; font-weight: 800; font-size: 0.85rem; }

/* Action buttons sit on the right, where most people expect them. */
.actions { justify-content: flex-end; }
.mp-actions, .result .actions { justify-content: flex-end; }
.result h2, .result > p { text-align: left; }
.result-again { text-align: right; }

/* File-type colours (generated from FILE_TYPES in content.mjs) */
.hue-pdf { --hue: #dc3b32; --hue-soft: #fdeceb; }
.ft-chip.ft-pdf { background: #dc3b32; }
.hue-word { --hue: #2b64d0; --hue-soft: #e8effc; }
.ft-chip.ft-word { background: #2b64d0; }
.hue-excel { --hue: #1d8a4e; --hue-soft: #e4f4ea; }
.ft-chip.ft-excel { background: #1d8a4e; }
.hue-ppt { --hue: #d8642a; --hue-soft: #fcede4; }
.ft-chip.ft-ppt { background: #d8642a; }
.hue-image { --hue: #9a46c9; --hue-soft: #f4eafb; }
.ft-chip.ft-image { background: #9a46c9; }
.hue-text { --hue: #57667c; --hue-soft: #edf0f4; }
.ft-chip.ft-text { background: #57667c; }
.hue-csv { --hue: #118c7e; --hue-soft: #e2f4f1; }
.ft-chip.ft-csv { background: #118c7e; }
.hue-zip { --hue: #d4930a; --hue-soft: #fcf3dc; }
.ft-chip.ft-zip { background: #d4930a; }
