/* QuickPDF — single stylesheet, mobile-first, no framework. */

:root {
  --bg: #090c14;
  --bg-elevated: #0f131e;
  --surface: #151b29;
  --surface-hover: #1b2335;
  --border: #232c42;
  --border-strong: #32405e;
  --text: #eaeef7;
  --text-dim: #9aa5c0;
  --text-faint: #67718c;
  --accent: #38bdf8;             /* sky   — links, icons, focus */
  --accent-2: #a78bfa;           /* violet — gradient partner  */
  --accent-strong: #0ea5e9;
  --accent-glow: rgba(56, 189, 248, 0.3);
  --grad: linear-gradient(135deg, #0ea5e9, #8b5cf6);
  --success: #34d399;
  --danger: #fb7185;
  /* category tints */
  --cat-pdf: #f87171;
  --cat-convert: #a78bfa;
  --cat-image: #34d399;
  --cat-dev: #fbbf24;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(56, 189, 248, 0.08), transparent 60%),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.container.narrow { max-width: 760px; }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 13, 19, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.logo {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 1.1rem; letter-spacing: -0.02em;
  color: var(--text); text-decoration: none;
}
.logo:hover { text-decoration: none; }
.logo-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--grad);
  color: #fff; box-shadow: 0 2px 12px var(--accent-glow);
}
.site-nav { display: flex; gap: 2px; flex-wrap: wrap; }
.site-nav a {
  color: var(--text-dim); font-size: 0.86rem; font-weight: 600;
  padding: 7px 11px; border-radius: 8px; white-space: nowrap;
}
.site-nav a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--text); background: var(--surface); }
.nav-toggle { display: none; }

@media (max-width: 860px) {
  .nav-toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 44px; padding: 10px;
    background: none; border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
  }
  .nav-toggle span { display: block; height: 2px; width: 100%; background: var(--text); border-radius: 2px; transition: transform 0.25s, opacity 0.25s; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .site-nav {
    display: none; position: absolute; top: 60px; left: 0; right: 0;
    flex-direction: column; gap: 4px; padding: 12px 20px 16px;
    background: var(--bg-elevated); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  .site-nav.open { display: flex; }
  .site-nav a { font-size: 1rem; padding: 12px 14px; }
}

/* ------------------------------------------------------------------ hero */
.hero { padding: 72px 0 36px; text-align: center; }
.hero h1 { font-size: clamp(1.9rem, 5.5vw, 3.1rem); line-height: 1.15; letter-spacing: -0.03em; font-weight: 800; }
.hero .accent {
  background: linear-gradient(90deg, #38bdf8, #a78bfa);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { max-width: 620px; margin: 18px auto 0; color: var(--text-dim); font-size: 1.06rem; }
.hero-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 26px; }
.hero-badges span {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.84rem; font-weight: 600; color: var(--text-dim);
  background: var(--surface); border: 1px solid var(--border);
  padding: 8px 14px; border-radius: 999px;
}
.hero-badges svg { color: var(--success); }

.tool-hero { padding: 40px 0 8px; }
.tool-hero h1 { font-size: clamp(1.7rem, 4.5vw, 2.4rem); letter-spacing: -0.02em; }
.subtitle { color: var(--text-dim); margin-top: 8px; font-size: 1.02rem; }
.breadcrumb { font-size: 0.8rem; color: var(--text-faint); margin-bottom: 14px; }
.breadcrumb a { color: var(--text-faint); }
.breadcrumb span { margin: 0 4px; }

/* ------------------------------------------------------------ tool cards */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; margin: 28px 0; }
.tool-grid.small { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.tool-card-link {
  display: flex; align-items: flex-start; gap: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; color: var(--text); text-decoration: none;
  transition: transform 0.18s, border-color 0.18s, background 0.18s, box-shadow 0.18s;
}
.tool-card-link:hover {
  text-decoration: none; transform: translateY(-3px);
  border-color: var(--accent); background: var(--surface-hover);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 0 1px var(--accent-glow);
}
.tool-card-icon {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 12px; color: var(--accent);
  background: rgba(56, 189, 248, 0.1); border: 1px solid rgba(56, 189, 248, 0.22);
}
.tool-card-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tool-card-body strong { font-size: 1rem; letter-spacing: -0.01em; }
.tool-card-body small { color: var(--text-dim); font-size: 0.84rem; line-height: 1.45; }

/* -------------------------------------------------------------- tool UI */
.tool-card {
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; margin-top: 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 16px;
}
.dropzone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius-sm);
  padding: 38px 18px; text-align: center; cursor: pointer;
  transition: border-color 0.18s, background 0.18s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--accent); background: rgba(56, 189, 248, 0.05); outline: none; }
.dropzone.dragover {
  border-color: var(--accent); background: rgba(56, 189, 248, 0.1);
  transform: scale(1.01); box-shadow: 0 0 0 4px var(--accent-glow);
}
.dropzone.has-file { border-style: solid; border-color: var(--success); background: rgba(63, 207, 142, 0.05); }
.dropzone-icon { display: inline-flex; color: var(--accent); margin-bottom: 10px; }
.dropzone.has-file .dropzone-icon { color: var(--success); }
.dropzone-label { font-weight: 700; font-size: 1.02rem; }
.dropzone-sub { color: var(--text-faint); font-size: 0.84rem; margin-top: 5px; word-break: break-word; }

.file-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.file-list:empty { display: none; }
.file-list li {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 0.9rem;
}
.file-list li.dragging { opacity: 0.4; }
.file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.file-size { color: var(--text-faint); font-size: 0.8rem; flex: none; }
.file-btn {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border);
  background: none; color: var(--text-dim); cursor: pointer; font-size: 0.95rem;
  transition: background 0.15s, color 0.15s;
}
.file-btn:hover:not(:disabled) { background: var(--surface-hover); color: var(--text); }
.file-btn:disabled { opacity: 0.3; cursor: default; }
.file-btn.remove:hover { color: var(--danger); border-color: var(--danger); }

.options { display: flex; flex-direction: column; gap: 12px; }
.radio-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.radio-card {
  display: flex; cursor: pointer; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); padding: 12px 14px; transition: border-color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.radio-card:hover { border-color: var(--border-strong); }
.radio-card input { position: absolute; opacity: 0; }
.radio-card span { display: flex; flex-direction: column; gap: 1px; }
.radio-card strong { font-size: 0.92rem; }
.radio-card small { color: var(--text-faint); font-size: 0.78rem; }
.radio-card:has(input:checked) {
  border-color: var(--accent); background: rgba(56, 189, 248, 0.09);
  box-shadow: 0 0 0 1px var(--accent);
}
.radio-card:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

.range-inputs { display: flex; gap: 12px; flex-wrap: wrap; }
.range-inputs label { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--text-dim); font-weight: 600; }
input[type="number"] {
  width: 90px; padding: 10px 12px; font-size: 1rem; font-family: var(--font);
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
input[type="number"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.page-count { color: var(--text-dim); font-size: 0.9rem; font-weight: 600; }
.hint { color: var(--text-faint); font-size: 0.82rem; }

textarea {
  width: 100%; padding: 14px; font-size: 0.95rem; line-height: 1.55;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  resize: vertical; min-height: 140px;
}
textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

/* --------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font); font-size: 1rem; font-weight: 700;
  padding: 14px 22px; border-radius: var(--radius-sm); border: none; cursor: pointer;
  transition: transform 0.12s, box-shadow 0.18s, background 0.18s, opacity 0.18s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
  background: var(--grad);
  color: #fff; box-shadow: 0 4px 18px var(--accent-glow);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 6px 26px var(--accent-glow); filter: brightness(1.08); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-hover); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row .btn { flex: 1; min-width: 150px; }

/* ------------------------------------------------------ status/progress */
.status { font-size: 0.92rem; font-weight: 600; min-height: 1.4em; }
.status:empty { display: none; }
.status.ok { color: var(--success); }
.status.err { color: var(--danger); }
.status.busy { color: var(--text-dim); }
.status.busy::before {
  content: ""; display: inline-block; width: 13px; height: 13px; margin-right: 8px;
  border: 2px solid var(--text-faint); border-top-color: var(--accent);
  border-radius: 50%; vertical-align: -2px;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress { height: 6px; background: var(--surface); border-radius: 99px; overflow: hidden; }
.progress-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #38bdf8, #a78bfa);
  border-radius: 99px; transition: width 0.2s;
}

.text-result { display: flex; flex-direction: column; gap: 10px; }

.privacy-note {
  display: flex; align-items: center; gap: 8px; justify-content: center;
  margin: 16px 0; color: var(--text-dim); font-size: 0.86rem;
}
.privacy-note svg { color: var(--success); flex: none; }

/* --------------------------------------------------------------- content */
.content-section { padding: 28px 0 56px; }
.content-section h2 { margin: 36px 0 14px; font-size: 1.4rem; letter-spacing: -0.01em; }
.content-section h2:first-child, .content-section h1 + p + h2 { margin-top: 24px; }
.content-section h1 { font-size: clamp(1.7rem, 4.5vw, 2.3rem); margin: 28px 0 12px; letter-spacing: -0.02em; }
.content-section p { color: var(--text-dim); margin-bottom: 12px; }
.content-section p strong { color: var(--text); }

.steps { counter-reset: step; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.steps li {
  counter-increment: step; position: relative; padding: 14px 16px 14px 54px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-dim); font-size: 0.94rem;
}
.steps li::before {
  content: counter(step); position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  background: rgba(56, 189, 248, 0.12); border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--accent); font-weight: 800; font-size: 0.82rem; border-radius: 8px;
}

.faq { display: flex; flex-direction: column; gap: 8px; }
.faq details {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden;
}
.faq summary {
  cursor: pointer; padding: 14px 16px; font-weight: 700; font-size: 0.95rem;
  list-style: none; position: relative; padding-right: 40px;
  -webkit-tap-highlight-color: transparent;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  color: var(--accent); font-size: 1.2rem; font-weight: 400; transition: transform 0.2s;
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { padding: 0 16px 14px; color: var(--text-dim); font-size: 0.92rem; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.feature h3 { display: flex; align-items: center; gap: 9px; font-size: 1.02rem; margin-bottom: 8px; }
.feature h3 svg { color: var(--accent); flex: none; }
.feature p { font-size: 0.9rem; margin: 0; }

/* -------------------------------------------------------------- ad slots */
.ad-slot {
  display: flex; align-items: center; justify-content: center;
  min-height: 90px; margin: 18px 0;
  border: 1px dashed var(--border); border-radius: var(--radius-sm);
  color: var(--text-faint); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
}

/* ---------------------------------------------------------------- footer */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-elevated); margin-top: 40px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 28px; justify-content: space-between; padding: 36px 20px 20px; }
.footer-brand { max-width: 320px; }
.footer-brand p { color: var(--text-faint); font-size: 0.85rem; margin-top: 10px; }
.footer-links { display: grid; grid-template-columns: repeat(2, auto); gap: 8px 32px; }
.footer-links a { color: var(--text-dim); font-size: 0.86rem; }
.footer-links a:hover { color: var(--text); }
.footer-note { padding: 14px 20px 26px; color: var(--text-faint); font-size: 0.78rem; }

@media (max-width: 640px) {
  .hero { padding: 48px 0 24px; }
  .tool-card { padding: 16px; }
  .dropzone { padding: 30px 14px; }
  .btn { width: 100%; padding: 15px 22px; }
  .footer-links { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------------------------------------------------------- nav dropdowns */
.nav-group { position: relative; }
.nav-group-label {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font); font-size: 0.86rem; font-weight: 600;
  color: var(--text-dim); background: none; border: none; cursor: pointer;
  padding: 7px 11px; border-radius: 8px;
}
.nav-group-label:hover { color: var(--text); background: var(--surface); }
.nav-drop { display: none; }
@media (min-width: 861px) {
  .nav-drop {
    position: absolute; top: 100%; left: 0; z-index: 60; min-width: 210px;
    flex-direction: column; padding: 8px;
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius-sm); box-shadow: var(--shadow);
  }
  .nav-group:hover .nav-drop, .nav-group:focus-within .nav-drop { display: flex; }
  .nav-drop a { display: block; padding: 8px 12px; border-radius: 7px; }
}
@media (max-width: 860px) {
  .nav-group { display: flex; flex-direction: column; }
  .nav-group-label { pointer-events: none; font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); padding: 10px 14px 2px; }
  .nav-group-label svg { display: none; }
  .nav-drop { display: flex; flex-direction: column; }
  .site-nav { max-height: calc(100vh - 60px); overflow-y: auto; }
}

/* ------------------------------------------------------- category titles */
.category-title { margin: 34px 0 4px; font-size: 1.25rem; letter-spacing: -0.01em; }
.category-title:first-of-type { margin-top: 20px; }

/* ------------------------------------------------------ sliders & checks */
.slider-label { display: flex; flex-direction: column; gap: 8px; font-weight: 700; font-size: 0.92rem; }
.slider-label output { color: var(--accent); font-weight: 800; }
input[type="range"] { width: 100%; accent-color: var(--accent); height: 28px; cursor: pointer; }
.check-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.check-label {
  display: flex; align-items: center; gap: 9px; cursor: pointer;
  font-size: 0.9rem; font-weight: 600; color: var(--text-dim);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 11px 13px;
}
.check-label:has(input:checked) { color: var(--text); border-color: var(--accent); }
.check-label input { accent-color: var(--accent); width: 16px; height: 16px; }
.btn-row.compact .btn { flex: 0 1 auto; min-width: 0; padding: 9px 16px; font-size: 0.88rem; }

/* -------------------------------------------------------------- crop tool */
/* align-self: center stops the flex parent stretching the stage wider than
   the canvas — the crop box is positioned in % of the stage, so stage width
   must always equal the displayed canvas width. */
.crop-stage { position: relative; display: inline-block; max-width: 100%; margin: 0 auto; touch-action: none; align-self: center; }
.crop-stage canvas { max-width: 100%; height: auto; display: block; border-radius: 8px; }
.crop-box {
  position: absolute; border: 2px solid var(--accent);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55); cursor: move;
}
.crop-handle {
  position: absolute; width: 22px; height: 22px;
  background: var(--accent); border: 2px solid #fff; border-radius: 50%;
  transform: translate(-50%, -50%);
}
.crop-handle[data-h="nw"] { top: 0; left: 0; cursor: nwse-resize; }
.crop-handle[data-h="ne"] { top: 0; left: 100%; cursor: nesw-resize; }
.crop-handle[data-h="sw"] { top: 100%; left: 0; cursor: nesw-resize; }
.crop-handle[data-h="se"] { top: 100%; left: 100%; cursor: nwse-resize; }

/* -------------------------------------------------------- PDF page editor */
.page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.page-grid:empty { display: none; }
.page-tile {
  position: relative; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); padding: 8px; display: flex; flex-direction: column; gap: 6px;
  transition: opacity 0.15s, border-color 0.15s;
}
.page-tile img { width: 100%; border-radius: 5px; background: #fff; transition: transform 0.2s; }
.page-tile.deleted { opacity: 0.35; border-color: var(--danger); }
.page-tile.deleted::after {
  content: "Will be removed"; position: absolute; inset: auto 0 40%; text-align: center;
  color: var(--danger); font-size: 0.72rem; font-weight: 800; text-transform: uppercase;
}
.page-tile-controls { display: flex; justify-content: center; gap: 4px; }
.page-tile-controls .file-btn { width: 30px; height: 30px; font-size: 0.85rem; }
.page-tile-num { text-align: center; color: var(--text-faint); font-size: 0.75rem; font-weight: 700; }

/* --------------------------------------------------------- dev tool extras */
.split-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 640px) { .split-inputs { grid-template-columns: 1fr; } }
.diff-result { display: flex; flex-direction: column; gap: 6px; max-height: 420px; overflow-y: auto; }
.diff-item {
  display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap;
  font-family: ui-monospace, Consolas, monospace; font-size: 0.82rem;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: 8px; padding: 8px 12px; word-break: break-all;
}
.diff-item.added { border-left-color: var(--success); }
.diff-item.removed { border-left-color: var(--danger); }
.diff-item.changed { border-left-color: #f5a524; }
.diff-path { font-weight: 700; color: var(--text); }
.diff-val { color: var(--text-dim); }
.diff-badge { font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }
.diff-item.added .diff-badge { color: var(--success); }
.diff-item.removed .diff-badge { color: var(--danger); }
.diff-item.changed .diff-badge { color: #f5a524; }

.table-preview { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.table-preview table { border-collapse: collapse; width: 100%; font-size: 0.85rem; }
.table-preview th, .table-preview td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.table-preview th { background: var(--surface); font-weight: 700; }

.password-display {
  display: flex; gap: 10px; align-items: stretch;
}
.password-display output {
  flex: 1; display: flex; align-items: center; min-width: 0;
  font-family: ui-monospace, Consolas, monospace; font-size: 1.05rem; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 12px 16px;
  word-break: break-all; user-select: all;
}
.password-display .btn { flex: none; min-width: 90px; }
@media (max-width: 640px) {
  .password-display { flex-direction: column; }
  .password-display .btn { width: 100%; }
}

/* ------------------------------------------------------- category colors */
.cat-pdf .tool-card-icon { color: var(--cat-pdf); background: rgba(248, 113, 113, 0.1); border-color: rgba(248, 113, 113, 0.25); }
.cat-convert .tool-card-icon { color: var(--cat-convert); background: rgba(167, 139, 250, 0.1); border-color: rgba(167, 139, 250, 0.25); }
.cat-image .tool-card-icon { color: var(--cat-image); background: rgba(52, 211, 153, 0.1); border-color: rgba(52, 211, 153, 0.25); }
.cat-dev .tool-card-icon { color: var(--cat-dev); background: rgba(251, 191, 36, 0.1); border-color: rgba(251, 191, 36, 0.25); }
.tool-card-link.cat-pdf:hover { border-color: var(--cat-pdf); box-shadow: 0 10px 30px rgba(0,0,0,0.35), 0 0 0 1px rgba(248,113,113,0.35); }
.tool-card-link.cat-convert:hover { border-color: var(--cat-convert); box-shadow: 0 10px 30px rgba(0,0,0,0.35), 0 0 0 1px rgba(167,139,250,0.35); }
.tool-card-link.cat-image:hover { border-color: var(--cat-image); box-shadow: 0 10px 30px rgba(0,0,0,0.35), 0 0 0 1px rgba(52,211,153,0.35); }
.tool-card-link.cat-dev:hover { border-color: var(--cat-dev); box-shadow: 0 10px 30px rgba(0,0,0,0.35), 0 0 0 1px rgba(251,191,36,0.35); }
.category-title { display: flex; align-items: center; gap: 10px; }
.category-title::before { content: ""; width: 5px; height: 22px; border-radius: 3px; background: var(--grad); }
.category-title.cat-pdf::before { background: var(--cat-pdf); }
.category-title.cat-convert::before { background: var(--cat-convert); }
.category-title.cat-image::before { background: var(--cat-image); }
.category-title.cat-dev::before { background: var(--cat-dev); }

/* ---------------------------------------------------------- image preview */
.img-preview {
  display: none; text-align: center;
  background: repeating-conic-gradient(#1b2335 0% 25%, #151b29 0% 50%) 0 0/20px 20px; /* checker = shows transparency */
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px;
}
.img-preview.show { display: block; }
.img-preview img, .img-preview canvas { max-width: 100%; max-height: 320px; margin: 0 auto; border-radius: 6px; width: auto; height: auto; }
.preview-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 640px) { .preview-pair { grid-template-columns: 1fr; } }
.preview-pair figure { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.preview-pair figcaption { text-align: center; font-size: 0.8rem; font-weight: 700; color: var(--text-dim); }

/* ------------------------------------------------------------- line diff */
.line-diff {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 0.82rem;
  line-height: 1.55; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); max-height: 460px; overflow: auto; padding: 8px 0;
}
.line-diff:empty { display: none; }
.line-diff .dl { padding: 0 14px; white-space: pre-wrap; word-break: break-all; }
.line-diff .dl.add { background: rgba(52, 211, 153, 0.12); color: #86efac; }
.line-diff .dl.del { background: rgba(251, 113, 133, 0.12); color: #fda4af; }
.line-diff .dl.add::before { content: "+ "; font-weight: 700; }
.line-diff .dl.del::before { content: "- "; font-weight: 700; }
.line-diff .dl.same { color: var(--text-faint); }
.line-diff .dl.same::before { content: "  "; }

/* ---------------------------------------------------------- feedback form */
.feedback-form { display: flex; flex-direction: column; gap: 12px; }
.feedback-form label { font-weight: 700; font-size: 0.9rem; display: flex; flex-direction: column; gap: 6px; }
.feedback-form input[type="text"], .feedback-form select {
  font-family: var(--font); font-size: 0.95rem; padding: 11px 13px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.feedback-form input:focus, .feedback-form select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
