/* NoUpload — shared stylesheet. No external fonts, no CDN, no network. */

:root {
  --bg: #fbfbfa;
  --bg-alt: #f2f3f1;
  --panel: #ffffff;
  --panel-alt: #f7f8f7;
  --border: #dfe1de;
  --border-strong: #c4c7c3;
  --text: #14181b;
  --text-dim: #5b6660;
  --accent: #0f766e;
  --accent-hover: #115e56;
  --accent-soft: #e2f2f0;
  --danger: #b4342a;
  --warn: #8a5a08;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(20, 24, 27, .06), 0 4px 16px rgba(20, 24, 27, .05);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1113;
    --bg-alt: #14181b;
    --panel: #171c1f;
    --panel-alt: #1d2327;
    --border: #2a3136;
    --border-strong: #3d464c;
    --text: #e7ebec;
    --text-dim: #97a2a6;
    --accent: #2dd4bf;
    --accent-hover: #5eead4;
    --accent-soft: #16302e;
    --danger: #f87171;
    --warn: #fbbf24;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 20px rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -.02em; margin: 0; font-weight: 650; }

.wrap { width: 100%; max-width: 1060px; margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: 780px; }

/* ---------- header ---------- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 60px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 680;
  font-size: 17px;
  letter-spacing: -.03em;
  color: var(--text);
  white-space: nowrap;
}
.logo:hover { text-decoration: none; }
.logo .mark {
  width: 22px; height: 22px;
  flex: none;
  color: var(--accent);
}
.logo-accent { color: var(--accent); }

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 14.5px;
}
.site-nav a { color: var(--text-dim); }
.site-nav a:hover { color: var(--text); text-decoration: none; }

.offline-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid transparent;
  border-radius: 100px;
  padding: 3px 10px 3px 8px;
  white-space: nowrap;
}
.offline-badge .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  flex: none;
}

@media (max-width: 720px) {
  .site-nav .hide-sm { display: none; }
}

/* ---------- hero ---------- */

.hero {
  padding: 76px 0 60px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(ellipse 70% 60% at 50% -10%, var(--accent-soft), transparent 70%),
    var(--bg);
}

.hero h1 {
  font-size: clamp(34px, 6vw, 54px);
  letter-spacing: -.035em;
  max-width: 16ch;
  margin: 0 0 20px;
}

.hero .lede {
  font-size: clamp(16.5px, 2.2vw, 19px);
  color: var(--text-dim);
  max-width: 56ch;
  margin: 0 0 28px;
}

.hero-points {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  font-size: 14.5px;
  color: var(--text-dim);
}
.hero-points li { display: flex; align-items: center; gap: 7px; }
.hero-points svg { color: var(--accent); flex: none; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-size: 15px;
  font-weight: 560;
  line-height: 1;
  padding: 12px 20px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, opacity .12s ease;
  text-decoration: none;
}
@media (prefers-color-scheme: dark) { .btn { color: #04211e; } }
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover { background: var(--panel-alt); border-color: var(--text-dim); }

.btn-sm { font-size: 13.5px; padding: 8px 13px; }
.btn-lg { font-size: 16px; padding: 14px 26px; }

.btn-icon {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 7px;
  width: 30px; height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.btn-icon:hover { color: var(--text); border-color: var(--border-strong); background: var(--panel-alt); }
.btn-icon.danger:hover { color: var(--danger); border-color: var(--danger); }
.btn-icon:disabled { opacity: .3; cursor: not-allowed; }

/* ---------- tool grid ---------- */

.section { padding: 60px 0; }
.section-head { margin-bottom: 28px; }
.section-head h2 { font-size: 25px; margin-bottom: 8px; }
.section-head p { color: var(--text-dim); margin: 0; max-width: 60ch; }

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

.tool-card {
  display: block;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  transition: border-color .14s ease, transform .14s ease, box-shadow .14s ease;
}
.tool-card:hover {
  text-decoration: none;
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.tool-card .icon {
  width: 34px; height: 34px;
  color: var(--accent);
  margin-bottom: 14px;
}
.tool-card h3 { font-size: 16.5px; margin-bottom: 5px; }
.tool-card p { margin: 0; font-size: 14px; color: var(--text-dim); line-height: 1.5; }

/* ---------- proof section ---------- */

.proof { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.proof-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 26px 34px;
}
.proof-item h3 {
  font-size: 15.5px;
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.proof-item h3 svg { color: var(--accent); flex: none; }
.proof-item p { margin: 0; font-size: 14.5px; color: var(--text-dim); }
.proof-item code {
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
}

.callout {
  margin-top: 34px;
  padding: 20px 22px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
}
.callout strong { display: block; margin-bottom: 4px; }
.callout p { margin: 0; color: var(--text-dim); font-size: 14.5px; }

/* ---------- faq ---------- */

.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
}
.faq-item:first-of-type { border-top: 1px solid var(--border); }
.faq-item summary {
  cursor: pointer;
  font-weight: 560;
  font-size: 16px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  color: var(--text-dim);
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
  flex: none;
}
.faq-item[open] summary::after { content: "\2212"; }
.faq-item p { margin: 12px 0 0; color: var(--text-dim); font-size: 15px; max-width: 68ch; }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 34px 0;
  font-size: 14px;
  color: var(--text-dim);
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 18px; margin-left: auto; }

/* ---------- tool page ---------- */

.tool-header { padding: 40px 0 26px; }
.breadcrumb { font-size: 13.5px; color: var(--text-dim); margin-bottom: 14px; }
.breadcrumb a { color: var(--text-dim); }
.breadcrumb a:hover { color: var(--accent); }
.tool-header h1 { font-size: clamp(27px, 4.5vw, 36px); margin-bottom: 10px; }
.tool-header p { color: var(--text-dim); margin: 0; max-width: 62ch; font-size: 16.5px; }

.tool-main { padding-bottom: 70px; }

/* dropzone */

.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--panel);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--accent); background: var(--panel-alt); }
.dropzone.dragover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone svg { color: var(--text-dim); margin-bottom: 12px; }
.dropzone:hover svg, .dropzone.dragover svg { color: var(--accent); }
.dropzone .dz-title { font-weight: 570; font-size: 17px; margin-bottom: 5px; }
.dropzone .dz-sub { font-size: 14px; color: var(--text-dim); }
.dropzone input[type=file] { display: none; }

.dropzone.compact { padding: 22px; }
.dropzone.compact svg { margin-bottom: 8px; }

/* panels */

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-top: 20px;
}
.panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.panel-head h2 { font-size: 16px; }
.panel-head .spacer { margin-left: auto; }
.panel-head .count { font-size: 13.5px; color: var(--text-dim); }

/* file list */

.file-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-alt);
}
.file-row.dragging { opacity: .4; }
.file-row.drop-target { border-color: var(--accent); }
.file-row .grip { color: var(--text-dim); cursor: grab; flex: none; touch-action: none; }
.file-row .fname {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14.5px;
}
.file-row .fmeta { font-size: 13px; color: var(--text-dim); flex: none; font-variant-numeric: tabular-nums; }
.file-row .factions { display: flex; gap: 5px; flex: none; }

/* page thumbnails */

.page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 12px;
}
.page-thumb {
  position: relative;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--panel-alt);
  padding: 6px;
  cursor: pointer;
  transition: border-color .12s ease;
  user-select: none;
}
.page-thumb:hover { border-color: var(--border-strong); }
.page-thumb.selected { border-color: var(--accent); background: var(--accent-soft); }
.page-thumb.removed { opacity: .32; }
.page-thumb.removed .canvas-holder { filter: grayscale(1); }
.page-thumb .canvas-holder {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1.32;
  overflow: hidden;
  background: #fff;
  border-radius: 4px;
}
.page-thumb canvas { max-width: 100%; max-height: 100%; display: block; }
.page-thumb .plabel {
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.page-thumb .pbadge {
  position: absolute;
  top: 4px; right: 4px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  padding: 1px 5px;
}
@media (prefers-color-scheme: dark) { .page-thumb .pbadge { color: #04211e; } }

.thumb-skeleton {
  width: 100%;
  aspect-ratio: 1 / 1.32;
  background: linear-gradient(90deg, var(--border) 25%, var(--panel-alt) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
  border-radius: 4px;
}
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .thumb-skeleton { animation: none; } }

/* controls */

.control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 26px;
  align-items: flex-end;
}
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 13.5px; font-weight: 550; color: var(--text-dim); }
.field .hint { font-size: 12.5px; color: var(--text-dim); font-weight: 400; }

input[type=text], input[type=number], select {
  font: inherit;
  font-size: 14.5px;
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  min-width: 0;
}
input[type=text]:focus, input[type=number]:focus, select:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: var(--accent);
}

input[type=range] { accent-color: var(--accent); width: 220px; max-width: 100%; }

.radio-group { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 100px;
  font-size: 14px;
  cursor: pointer;
  background: var(--panel);
}
.radio-pill:hover { border-color: var(--text-dim); }
.radio-pill input { accent-color: var(--accent); margin: 0; }
.radio-pill:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 550;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  cursor: pointer;
}
.checkbox input { accent-color: var(--accent); width: 16px; height: 16px; }

/* action bar */

.action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.action-bar .note { font-size: 13.5px; color: var(--text-dim); }

/* progress */

.progress {
  margin-top: 16px;
  display: none;
}
.progress.active { display: block; }
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
}
.progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 100px;
  transition: width .18s ease;
}
.progress-label { font-size: 13.5px; color: var(--text-dim); margin-top: 8px; }

/* result */

.result {
  margin-top: 20px;
  padding: 20px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  border-radius: var(--radius-lg);
  display: none;
}
.result.active { display: block; }
.result h3 { font-size: 16px; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.result h3 svg { color: var(--accent); }

/* the job finished, but the outcome is not something to celebrate */
.result.neutral { border-color: var(--border-strong); background: var(--panel-alt); }
.result.neutral h3 svg { display: none; }
.result .rmeta { font-size: 14px; color: var(--text-dim); margin-bottom: 16px; }
.result .rmeta strong { color: var(--text); font-variant-numeric: tabular-nums; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.alert {
  margin-top: 16px;
  padding: 13px 16px;
  border-radius: var(--radius);
  font-size: 14.5px;
  display: none;
  border: 1px solid;
}
.alert.active { display: block; }
.alert.error { color: var(--danger); border-color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, transparent); }
.alert.warn { color: var(--warn); border-color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, transparent); }

/* privacy strip on tool pages */

.privacy-strip {
  margin-top: 34px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-alt);
  font-size: 14px;
  color: var(--text-dim);
}
.privacy-strip svg { color: var(--accent); flex: none; margin-top: 2px; }
.privacy-strip p { margin: 0; }
.privacy-strip a { font-weight: 550; }

.more-tools { margin-top: 46px; }
.more-tools h2 { font-size: 18px; margin-bottom: 14px; }

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

.prose h2 { font-size: 21px; margin: 34px 0 10px; }
.prose h3 { font-size: 16.5px; margin: 24px 0 8px; }
.prose p, .prose li { color: var(--text-dim); font-size: 15.5px; }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 7px; }
.prose code {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
}
.prose pre {
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 13px;
  font-family: var(--mono);
  line-height: 1.5;
}
.prose pre code { background: none; border: 0; padding: 0; }
