/* PasteCleaner — design tokens: blue-pencil ultramarine on paper,
   Instrument Serif display / IBM Plex Sans body / IBM Plex Mono utility. */

:root {
  --paper: #FAFAF7;
  --card: #FFFFFF;
  --ink: #16191D;
  --muted: #5C6470;
  --line: #E4E4DC;
  --line-soft: #EEEEE7;
  --brand: #2740CC;
  --brand-deep: #1B2FA6;
  --tint: #EEF4FB;          /* non-photo blue */
  --tint-line: #D3E4F2;
  --chip-bg: #FBEAE7;       /* red-ink chips for invisible chars */
  --chip-text: #99301F;
  --chip-line: #F0CFC7;
  --sub-text: #A05A0B;      /* amber for visible substitutions */
  --sub-bg: #FBF3DF;
  --ok: #1D7A4F;
  --radius: 12px;
  --font-display: "Instrument Serif", Georgia, serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
}
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

/* ---------- header ---------- */
.site-head { border-bottom: 1px solid var(--line); background: var(--card); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.wordmark { font-family: var(--font-display); font-size: 24px; color: var(--ink); display: flex; align-items: center; gap: 9px; }
.wordmark:hover { text-decoration: none; }
.wordmark .mark {
  width: 26px; height: 26px; border-radius: 7px; background: var(--brand);
  color: #fff; font-family: var(--font-display); font-size: 17px;
  display: inline-flex; align-items: center; justify-content: center; padding-bottom: 2px;
}
.head-links { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.head-links a { color: var(--muted); }
.btn-pro {
  font-family: var(--font-body); font-size: 13.5px; font-weight: 600;
  color: var(--brand); background: var(--tint); border: 1px solid var(--tint-line);
  padding: 6px 13px; border-radius: 999px; cursor: pointer;
}
.btn-pro:hover { background: #E2EEFA; text-decoration: none; }
.btn-pro.is-pro { color: var(--ok); background: #EAF6EF; border-color: #CDE8D8; cursor: default; }

/* ---------- hero ---------- */
.hero { padding: 40px 0 10px; }
.hero h1 {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(32px, 5vw, 46px); line-height: 1.12;
  margin: 0 0 10px; letter-spacing: -0.01em; max-width: 20ch;
}
.hero h1 em { font-style: italic; color: var(--brand); }
.hero .lede { color: var(--muted); max-width: 62ch; margin: 0 0 14px; font-size: 17px; }
.trust {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.08em;
  color: var(--muted); text-transform: uppercase; display: flex; flex-wrap: wrap; gap: 8px 18px;
}
.trust span::before { content: "\25AA\00a0"; color: var(--brand); }

/* ---------- workspace ---------- */
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; padding: 26px 0 10px; align-items: start; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--line-soft);
}
.card-title { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; }

textarea#input {
  display: block; width: 100%; min-height: 230px; resize: vertical;
  border: 0; border-radius: 0 0 var(--radius) var(--radius);
  padding: 14px 16px; font-family: var(--font-mono); font-size: 13.5px; line-height: 1.6;
  color: var(--ink); background: transparent;
}
textarea#input:focus { outline: none; }
.input-card:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--tint); }

.btn {
  font-family: var(--font-body); font-size: 13.5px; font-weight: 600;
  border-radius: 9px; padding: 7px 14px; cursor: pointer; border: 1px solid transparent;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-deep); }
.btn-ghost { background: transparent; color: var(--brand); border-color: var(--tint-line); }
.btn-ghost:hover { background: var(--tint); }
.btn-quiet { background: transparent; color: var(--muted); border-color: var(--line); }
.btn-quiet:hover { color: var(--ink); background: var(--line-soft); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

/* stats bar */
.stats { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 14px; padding: 14px 2px 2px; min-height: 44px; }
.stats .lead { font-family: var(--font-display); font-size: 21px; }
.stats .lead strong { color: var(--brand); font-weight: 400; }
.stats .lead.clean { color: var(--ok); }
.pill {
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; background: var(--card);
}
.pill b { color: var(--ink); font-weight: 600; }

/* output card + tabs */
.tabs { display: flex; gap: 2px; }
.tab {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--muted); background: transparent; border: 0; padding: 6px 10px; cursor: pointer;
  border-bottom: 2px solid transparent;
}
.tab[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
.pane {
  padding: 14px 16px; min-height: 230px; max-height: 460px; overflow: auto;
  font-family: var(--font-mono); font-size: 13.5px; line-height: 1.9; white-space: pre-wrap; word-wrap: break-word;
}
.pane .placeholder { color: var(--muted); font-family: var(--font-body); font-size: 14.5px; line-height: 1.5; }

/* the signature element: gremlin chips */
.g-chip {
  display: inline-block; vertical-align: baseline;
  font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: 0.04em;
  color: var(--chip-text); background: var(--chip-bg); border: 1px solid var(--chip-line);
  border-radius: 5px; padding: 0 5px; margin: 0 1px; line-height: 1.7;
  cursor: help; animation: chip-in 240ms ease-out backwards;
}
.g-sub {
  color: var(--sub-text); background: var(--sub-bg); border-radius: 4px;
  padding: 0 1px; cursor: help;
  border-bottom: 2px solid var(--sub-text);
}
@keyframes chip-in { from { opacity: 0; transform: translateY(2px); } }
@media (prefers-reduced-motion: reduce) { .g-chip { animation: none; } }

/* tooltip */
.tip {
  position: fixed; z-index: 60; pointer-events: none;
  background: var(--ink); color: #fff; font-family: var(--font-mono); font-size: 11.5px;
  padding: 6px 9px; border-radius: 7px; max-width: 300px; line-height: 1.45;
}
.tip .cp { color: #9DB2FF; }

/* ---------- options rail ---------- */
.rail .card { position: sticky; top: 16px; }
.rail-body { padding: 6px 16px 14px; }
.opt-group { padding: 10px 0 4px; border-bottom: 1px solid var(--line-soft); }
.opt-group:last-child { border-bottom: 0; }
.opt-group h3 {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); margin: 4px 0 8px; font-weight: 600;
}
.opt { display: flex; align-items: flex-start; gap: 9px; padding: 4px 0; font-size: 14px; }
.opt input { margin-top: 3px; accent-color: var(--brand); width: 15px; height: 15px; }
.opt .hint { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.opt-select { display: flex; align-items: center; gap: 8px; padding: 6px 0 4px 24px; font-size: 13.5px; color: var(--muted); }
.opt-select select {
  font-family: var(--font-mono); font-size: 12.5px; padding: 4px 6px;
  border: 1px solid var(--line); border-radius: 7px; background: var(--card); color: var(--ink);
}
.preset-row { display: flex; gap: 8px; padding: 12px 0 4px; align-items: center; }
.preset-row select {
  flex: 1; font-family: var(--font-body); font-size: 13.5px; padding: 7px 8px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink);
}
.lock {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.06em; font-weight: 600;
  color: var(--brand); background: var(--tint); border: 1px solid var(--tint-line);
  border-radius: 4px; padding: 1px 5px; vertical-align: 2px; margin-left: 6px;
}

/* batch zone */
.batch {
  margin-top: 10px; border: 1.5px dashed var(--tint-line); border-radius: 10px;
  padding: 14px; text-align: center; font-size: 13.5px; color: var(--muted); background: var(--tint);
  cursor: pointer;
}
.batch:hover, .batch.drag { border-color: var(--brand); }
.batch b { color: var(--ink); }

/* ---------- content sections ---------- */
.section { padding: 44px 0 8px; }
.section h2 { font-family: var(--font-display); font-weight: 400; font-size: 30px; margin: 0 0 16px; }
.section p { max-width: 68ch; color: #343a42; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 18px; }
.mini { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.mini h3 { margin: 0 0 6px; font-size: 15.5px; }
.mini p { margin: 0; font-size: 14px; color: var(--muted); }
.mini .cpx { font-family: var(--font-mono); font-size: 11.5px; color: var(--brand); }

.faq details { border-bottom: 1px solid var(--line); padding: 13px 2px; max-width: 760px; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 15.5px; }
.faq details p { margin: 10px 0 2px; font-size: 14.5px; color: #343a42; }

.tool-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.tool-links a {
  font-size: 13.5px; border: 1px solid var(--line); background: var(--card);
  border-radius: 999px; padding: 7px 14px; color: var(--ink);
}
.tool-links a:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }

/* ---------- pro modal ---------- */
dialog#pro-modal {
  border: 1px solid var(--line); border-radius: 16px; padding: 0;
  width: min(430px, calc(100vw - 32px)); background: var(--card); color: var(--ink);
}
dialog#pro-modal::backdrop { background: rgba(22, 25, 29, 0.45); }
.modal-body { padding: 24px 26px 22px; }
.modal-body h3 { font-family: var(--font-display); font-weight: 400; font-size: 27px; margin: 0 0 4px; }
.price { font-family: var(--font-mono); font-size: 13px; color: var(--muted); margin: 0 0 14px; }
.price b { color: var(--brand); font-size: 16px; }
.perks { list-style: none; margin: 0 0 18px; padding: 0; }
.perks li { padding: 5px 0 5px 24px; position: relative; font-size: 14.5px; }
.perks li::before { content: "\2713"; position: absolute; left: 2px; color: var(--ok); font-weight: 700; }
.unlock-row { display: flex; gap: 8px; margin-top: 10px; }
.unlock-row input {
  flex: 1; font-family: var(--font-mono); font-size: 13px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 8px; text-transform: uppercase;
}
.modal-note { font-size: 12.5px; color: var(--muted); margin-top: 12px; }
.modal-msg { font-size: 13px; margin-top: 8px; min-height: 18px; }
.modal-msg.ok { color: var(--ok); }
.modal-msg.err { color: var(--chip-text); }
.modal-close { position: absolute; top: 10px; right: 12px; border: 0; background: none; font-size: 20px; color: var(--muted); cursor: pointer; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 16px 0 2px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: 13.5px; padding: 9px 16px;
  border-radius: 999px; opacity: 0; transition: opacity 180ms ease; z-index: 70; pointer-events: none;
}
.toast.show { opacity: 1; }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--line); margin-top: 56px; padding: 26px 0 40px; }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 12px 26px; align-items: baseline; justify-content: space-between; }
.site-foot, .site-foot a { color: var(--muted); font-size: 13.5px; }
.foot-brand { font-family: var(--font-display); font-size: 17px; color: var(--ink); }
.foot-note { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .workspace { grid-template-columns: 1fr; }
  .rail { order: 3; }
  .rail .card { position: static; }
  .hero { padding-top: 28px; }
  .pane { max-height: 380px; }
}
@media (max-width: 520px) {
  .head-links a.hide-sm { display: none; }
  .card-actions .btn { padding: 7px 11px; font-size: 13px; }
}
.linkish{background:none;border:0;padding:0;color:var(--brand);font:inherit;cursor:pointer;text-decoration:underline;}
