/* ==========================================================================
   TextKit — stylesheet
   Concept: a proofreader's desk. Warm paper, ink text, highlighter-yellow
   accents, ruled-paper text areas and a blinking caret in the logo.
   Sections: 1 Tokens · 2 Base · 3 Header/Footer · 4 Home · 5 Cards
             6 Tool panel · 7 Controls · 8 Results · 9 Prose · 10 Utilities
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  color-scheme: light;
  --paper: #fbf8f1;
  --paper-2: #f3eee2;
  --card: #fffdf8;
  --ink: #1b1f2a;
  --ink-soft: #4b5263;
  --line: #e3dccb;
  --hl: #ffe066;            /* highlighter (can be translucent) */
  --hl-solid: #ffe066;      /* highlighter behind dark text */
  --pen: #2f5bea;           /* editor's blue pen */
  --ring: rgba(47, 91, 234, 0.22);
  --red: #c93a32;
  --red-bg: #fbdcd9;
  --green: #1c7a45;
  --green-bg: #d8f0e1;
  --shadow: 0 1px 0 rgba(27, 31, 42, 0.05), 0 10px 26px -14px rgba(27, 31, 42, 0.28);
  --radius: 14px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #14161c;
  --paper-2: #1b1e26;
  --card: #1a1d25;
  --ink: #f1eee6;
  --ink-soft: #a5a9b6;
  --line: #2c303b;
  --hl: rgba(255, 214, 10, 0.4);
  --hl-solid: #f4d03f;
  --pen: #7c9bff;
  --ring: rgba(124, 155, 255, 0.28);
  --red: #ff8a80;
  --red-bg: #4a2422;
  --green: #6fdc9b;
  --green-bg: #1e3d2b;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 10px 26px -14px rgba(0, 0, 0, 0.7);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --paper: #14161c;
    --paper-2: #1b1e26;
    --card: #1a1d25;
    --ink: #f1eee6;
    --ink-soft: #a5a9b6;
    --line: #2c303b;
    --hl: rgba(255, 214, 10, 0.4);
    --hl-solid: #f4d03f;
    --pen: #7c9bff;
    --ring: rgba(124, 155, 255, 0.28);
    --red: #ff8a80;
    --red-bg: #4a2422;
    --green: #6fdc9b;
    --green-bg: #1e3d2b;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 10px 26px -14px rgba(0, 0, 0, 0.7);
  }
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--serif); line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 5.4vw, 3.3rem); font-weight: 800; }
h2 { font-size: clamp(1.35rem, 3vw, 1.75rem); font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--pen); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--pen); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--hl-solid); color: #1b1f2a; }
.container { width: min(1120px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--ink-soft); }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip-link:focus { left: 8px; }
[hidden] { display: none !important; }

/* Highlighter effect — used on one word in each page title */
mark.hl {
  color: inherit;
  padding: 0 0.1em;
  border-radius: 3px;
  background: linear-gradient(var(--hl), var(--hl)) no-repeat 0 90% / 100% 0.46em;
  animation: hl-in 0.8s 0.25s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
}
@keyframes hl-in { from { background-size: 0 0.46em; } }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- 3. Header / Footer ---------- */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; }
.logo { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); font-size: 1.4rem; line-height: 1; }
.logo-mark { width: 30px; height: 30px; flex: none; transition: transform 0.25s; }
.logo:hover .logo-mark { transform: rotate(-8deg); }
.logo-a { font-family: var(--serif); font-weight: 800; letter-spacing: -0.02em; }
.logo-b { font-family: var(--mono); font-weight: 600; color: var(--pen); margin-left: 1px; }
.logo-caret { display: inline-block; width: 2px; height: 1.05em; margin-left: 3px; background: var(--ink); vertical-align: -0.15em; animation: blink 1.1s steps(1) infinite; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav a:not(.btn) { color: var(--ink); text-decoration: none; padding: 8px 10px; border-radius: 8px; font-weight: 500; }
.nav a:not(.btn):hover { background: var(--paper-2); }
.icon-btn {
  width: 40px; height: 40px; display: inline-grid; place-items: center; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); font-size: 1.1rem;
}
.icon-btn:hover { border-color: var(--ink); }
.ti-sun { display: none; }
:root[data-theme="dark"] .ti-sun { display: inline; }
:root[data-theme="dark"] .ti-moon { display: none; }

.site-footer { margin-top: 72px; border-top: 1px solid var(--line); padding: 36px 0 32px; color: var(--ink-soft); font-size: 0.93rem; }
.footer-top { display: grid; grid-template-columns: 1.1fr 1.15fr 1.15fr 1fr; gap: 32px; align-items: start; }
.footer-brand .footer-note { margin-top: 10px; max-width: 26ch; }
.footer-h {
  display: flex; align-items: center; gap: 10px; margin: 0 0 14px;
  font: 700 0.74rem var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink);
}
.footer-h::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-col a { display: inline-block; color: var(--ink-soft); text-decoration: none; transition: color 0.15s, transform 0.15s; }
.footer-col a:hover, .footer-col a:focus-visible { color: var(--ink); transform: translateX(3px); }
.footer-bottom {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 28px;
  margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line);
}
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 20px; list-style: none; padding: 0; margin: 0; }
.footer-links a { color: var(--ink-soft); text-decoration: none; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; }
.footer-note { margin: 0; font-size: 0.85rem; }

/* ---------- 4. Home ---------- */
.hero {
  padding: 28px 0 8px;
  background-image: radial-gradient(var(--line) 1px, transparent 1px);
  background-size: 22px 22px;
  background-position: 0 -6px;
}
.eyebrow { display: inline-block; font: 600 0.82rem var(--mono); color: var(--ink-soft); margin-bottom: 14px; }
.hero h1 { max-width: 18ch; }
.hero-lead { max-width: 56ch; font-size: 1.1rem; color: var(--ink-soft); }
.quick { margin-top: 22px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.section { margin-top: 56px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.search-wrap { position: relative; max-width: 420px; width: 100%; }
.search-wrap input {
  width: 100%; padding: 11px 44px 11px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--ink); font: 16px var(--sans);
}
.search-wrap kbd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font: 600 0.8rem var(--mono); color: var(--ink-soft); border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; background: var(--paper-2);
}
.points { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.point { border-left: 3px solid var(--hl-solid); padding-left: 14px; }
.point h3 { margin-bottom: 4px; }
.point p { margin: 0; color: var(--ink-soft); }

/* ---------- 5. Cards ---------- */
.grid { display: grid; gap: 14px; }
.grid-main { grid-template-columns: repeat(4, 1fr); }
.grid-more { grid-template-columns: repeat(4, 1fr); }
.card {
  display: flex; flex-direction: column; gap: 8px; padding: 18px; position: relative;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  color: inherit; text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s;
}
.card:hover, .card:focus-visible { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--ink); }
.card .glyph {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 10px;
  font: 700 1.05rem var(--mono); background: var(--paper-2); border: 1px solid var(--line);
  transition: transform 0.22s, background 0.22s, color 0.22s;
}
.card:hover .glyph, .card:focus-visible .glyph { background: var(--hl-solid); color: #1b1f2a; transform: rotate(-7deg); }
.card h3 { margin: 4px 0 0; font-size: 1.12rem; }
.card p { margin: 0; color: var(--ink-soft); font-size: 0.93rem; }
.card-more { padding: 14px; flex-direction: row; align-items: flex-start; gap: 12px; }
.card-more .glyph { width: 36px; height: 36px; font-size: 0.9rem; flex: none; }
.card-more h3 { margin-top: 0; font-size: 1rem; }
.card-more p { font-size: 0.88rem; }
/* highlighter sweep on card titles */
.sweep {
  background: linear-gradient(var(--hl), var(--hl)) no-repeat 0 92% / 0 0.42em;
  transition: background-size 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.card:hover .sweep, .card:focus-visible .sweep { background-size: 100% 0.42em; }

/* ---------- 6. Tool page + panel ---------- */
.tool-head { padding: 8px 0 18px; }
.breadcrumb { font-size: 0.88rem; color: var(--ink-soft); margin-bottom: 10px; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.breadcrumb li + li::before { content: "›"; margin-right: 6px; }
.breadcrumb a { color: var(--ink-soft); }
.tool-head h1 { font-size: clamp(1.9rem, 4.6vw, 2.8rem); margin-bottom: 8px; }
.tool-lead { color: var(--ink-soft); font-size: 1.05rem; max-width: 62ch; margin: 0; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.panel-h { font-size: 1.1rem; margin: 22px 0 10px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.editor-label { display: block; font: 600 0.82rem var(--mono); color: var(--ink-soft); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.editor { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); transition: border-color 0.15s, box-shadow 0.15s; }
.editor:focus-within { border-color: var(--pen); box-shadow: 0 0 0 3px var(--ring); }
.field {
  display: block; width: 100%; min-height: 200px; resize: vertical; border: 0; outline: 0; margin: 0;
  padding: 14px 16px; background-color: transparent; color: var(--ink);
  font: 15px/1.75 var(--mono);
  /* ruled-paper lines that scroll with the text */
  background-image: linear-gradient(transparent calc(100% - 1px), var(--line) 100%);
  background-size: 100% 1.75em;
  background-position: 0 14px;
  background-attachment: local;
}
.field[readonly] { background-color: var(--paper-2); }
.statusbar { display: flex; justify-content: space-between; padding: 6px 12px; font: 0.78rem var(--mono); color: var(--ink-soft); background: var(--paper-2); border-top: 1px solid var(--line); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.notice { margin: 12px 0 0; font-size: 0.93rem; color: var(--ink-soft); }
.error { margin: 10px 0 0; padding: 8px 12px; border-radius: 8px; background: var(--red-bg); color: var(--red); font-size: 0.93rem; }

/* ---------- 7. Controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 14px;
  border: 1px solid var(--ink); border-radius: 10px; background: var(--ink); color: var(--paper);
  font: 600 0.93rem var(--sans); cursor: pointer; text-decoration: none; user-select: none;
  transition: transform 0.1s, background 0.15s, color 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--hl-solid); color: #1b1f2a; border-color: #1b1f2a; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:disabled:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-sm { min-height: 34px; padding: 5px 11px; font-size: 0.88rem; }
.file-btn:focus-within { outline: 2px solid var(--pen); outline-offset: 2px; }
.btn-groups { display: grid; gap: 14px; margin-top: 14px; }
.btn-group-label { font: 600 0.78rem var(--mono); color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 14px 0 12px; }
.opt { display: inline-flex; align-items: center; gap: 7px; font-size: 0.93rem; cursor: pointer; }
.opt.is-disabled { opacity: 0.5; cursor: not-allowed; }
.opt input { accent-color: var(--pen); width: 17px; height: 17px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; margin-top: 14px; align-items: end; }
.input-label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 4px; }
.text-input, select.text-input {
  width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--ink); font: 16px var(--mono);
}
.text-input:focus { outline: 0; border-color: var(--pen); box-shadow: 0 0 0 3px var(--ring); }
.text-input.narrow { width: 90px; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tab {
  padding: 9px 14px; border: 0; background: transparent; color: var(--ink-soft); font: 600 0.93rem var(--sans);
  cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--hl-solid); }

/* ---------- 8. Results ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 16px; }
.stat { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--paper-2); }
.stat-n { display: block; font: 800 1.55rem var(--serif); line-height: 1.1; }
.stat-l { font-size: 0.8rem; color: var(--ink-soft); }
.stat.primary { background: var(--hl-solid); border-color: transparent; color: #1b1f2a; }
.stat.primary .stat-l { color: #3b3f4b; }
.meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.meter-top { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 4px; }
.meter-num { font-family: var(--mono); color: var(--ink-soft); }
.meter-bar { height: 8px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 99px; overflow: hidden; }
.meter-fill { height: 100%; width: 0; background: var(--pen); transition: width 0.2s; }
.meter.over .meter-fill { background: var(--red); }
.meter.over .meter-num { color: var(--red); font-weight: 700; }
.table { width: 100%; border-collapse: collapse; font-size: 0.93rem; margin-top: 8px; }
.table th, .table td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); }
.table th { font: 600 0.78rem var(--mono); color: var(--ink-soft); text-transform: uppercase; }
.dens { display: inline-flex; align-items: center; gap: 8px; }
.dens-bar { display: inline-block; height: 8px; min-width: 2px; background: var(--hl-solid); border-radius: 4px; }
.preview {
  position: relative; max-height: 280px; overflow: auto; margin-top: 14px; padding: 14px 16px;
  border: 1px dashed var(--line); border-radius: 10px; background: var(--paper-2);
  font: 14px/1.7 var(--mono); white-space: pre-wrap; word-break: break-word;
}
.preview.is-empty { color: var(--ink-soft); font-style: italic; }
.preview mark { background: var(--hl); color: inherit; border-radius: 3px; padding: 0 1px; }
.preview mark.current { background: var(--hl-solid); color: #1b1f2a; outline: 2px solid var(--ink); }
.diff { margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); }
.diff-line { display: grid; grid-template-columns: 28px 1fr; font: 14px/1.6 var(--mono); }
.diff-sign { text-align: center; color: var(--ink-soft); user-select: none; }
.diff-text { white-space: pre-wrap; word-break: break-word; padding-right: 10px; }
.diff-line.add { background: var(--green-bg); }
.diff-line.add .diff-sign { color: var(--green); font-weight: 700; }
.diff-line.del { background: var(--red-bg); }
.diff-line.del .diff-sign { color: var(--red); font-weight: 700; }
.diff-gap { padding: 4px 12px; background: var(--paper-2); color: var(--ink-soft); font: 0.8rem var(--mono); text-align: center; }
.diff-inline { padding: 14px 16px; font: 14px/1.8 var(--mono); white-space: pre-wrap; word-break: break-word; }
.diff-inline ins { background: var(--green-bg); color: var(--green); text-decoration: none; border-radius: 3px; }
.diff-inline del { background: var(--red-bg); color: var(--red); border-radius: 3px; }
.summary { margin: 14px 0 0; font-weight: 600; }
.url-preview { margin: 10px 0 0; font: 0.88rem var(--mono); color: var(--ink-soft); word-break: break-all; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 10px; font-size: 0.93rem; z-index: 60;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 9. Prose (how-to, about, FAQ, related) ---------- */
.prose { max-width: 760px; margin-top: 48px; }
.prose h2 { margin-top: 36px; }
.prose ol, .prose ul { padding-left: 1.3em; }
.prose li { margin-bottom: 0.4em; }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 700 1.2rem var(--mono); color: var(--ink-soft); transition: transform 0.2s; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 10px 0 0; color: var(--ink-soft); }
.related { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-top: 12px; }

/* ---------- 10. Utilities & responsive ---------- */
.ad-slot { margin: 24px 0; min-height: 0; } /* reserved spot; stays hidden until AdSense is approved */

@media (max-width: 900px) {
  .grid-main, .grid-more { grid-template-columns: repeat(2, 1fr); }
  .points { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: repeat(2, 1fr); gap: 28px 24px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-brand .footer-note { max-width: none; }
}
@media (max-width: 700px) {
  .split { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .field { font-size: 16px; }
  .nav .hide-sm { display: none; }
  .panel { padding: 14px; }
}
@media (max-width: 480px) {
  .grid-main, .grid-more { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- 11. Footer extras, contact, donate, 404 ---------- */

.contact { display: grid; gap: 14px; margin-top: 6px; }
.contact-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.contact-card {
  display: flex; align-items: center; gap: 16px; padding: 18px 20px; position: relative;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  color: inherit; text-decoration: none; transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.contact-card:hover, .contact-card:focus-visible { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--ink); }
.contact-icon {
  display: grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: 14px;
  background: var(--paper-2); border: 1px solid var(--line); transition: background 0.2s, color 0.2s, transform 0.2s;
}
.contact-card:hover .contact-icon { background: var(--hl-solid); color: #1b1f2a; transform: rotate(-6deg); }
.contact-body { display: grid; gap: 2px; min-width: 0; flex: 1; }
.contact-name { font: 700 1.1rem var(--serif); }
.contact-value { font: 600 0.95rem var(--mono); color: var(--pen); overflow-wrap: anywhere; }
.contact-desc { color: var(--ink-soft); font-size: 0.9rem; }
.contact-tag { justify-self: start; font: 700 0.72rem var(--mono); text-transform: uppercase; letter-spacing: 0.06em; background: var(--hl-solid); color: #1b1f2a; padding: 2px 8px; border-radius: 99px; }
.contact-go { font-size: 1.4rem; color: var(--ink-soft); transition: transform 0.18s; }
.contact-card:hover .contact-go { transform: translateX(4px); color: var(--ink); }
.contact-primary { padding: 26px 24px; border-width: 2px; border-color: var(--ink); background: linear-gradient(135deg, var(--card), var(--paper-2)); }
.contact-primary .contact-icon { width: 64px; height: 64px; background: var(--hl-solid); color: #1b1f2a; }
.contact-primary .contact-name { font-size: 1.5rem; }
.contact-primary .contact-value { font-size: 1.1rem; }

.wallets { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 8px; }
.wallet { display: flex; flex-direction: column; gap: 12px; padding: 18px; background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--coin); border-radius: var(--radius); }
.wallet-head { display: flex; align-items: center; gap: 12px; }
.wallet-head h2 { font-size: 1.2rem; margin: 0; }
.wallet-head p { margin: 0; font-size: 0.85rem; color: var(--ink-soft); }
.coin-badge { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 50%; background: var(--coin); color: #fff; font: 800 0.8rem var(--mono); letter-spacing: 0.02em; }
.wallet-address {
  display: block; padding: 12px 14px; border-radius: 10px; background: var(--paper-2); border: 1px dashed var(--line);
  font: 0.88rem/1.5 var(--mono); word-break: break-all; user-select: all; overflow-wrap: anywhere;
}
.wallet-check { margin: 0; font-size: 0.82rem; color: var(--ink-soft); }
.wallet-check b { color: var(--ink); font-family: var(--mono); }
.wallet .btn { align-self: flex-start; }
.btn.is-done { background: var(--green-bg); color: var(--green); border-color: var(--green); }
.safety { max-width: 760px; margin-top: 36px; padding: 18px 20px; border-left: 4px solid var(--red); background: var(--paper-2); border-radius: 0 var(--radius) var(--radius) 0; }
.safety h2 { margin-top: 0; font-size: 1.2rem; }
.safety li { margin-bottom: 6px; }

.nf { text-align: center; padding: 36px 0 8px; }
.nf-code { font: 800 clamp(5.5rem, 24vw, 12rem)/1 var(--serif); letter-spacing: -0.04em; margin: 0 0 6px; }
.nf-code .strike { position: relative; display: inline-block; color: var(--ink-soft); }
.nf-code .strike::after {
  content: ""; position: absolute; left: -8%; right: -8%; top: 50%; height: 0.07em; border-radius: 4px;
  background: var(--red); transform: rotate(-12deg); transform-origin: left center; animation: nf-draw 0.6s 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
}
@keyframes nf-draw { from { transform: scaleX(0) rotate(-12deg); } }
.nf-note { font: italic 1.35rem var(--serif); margin: 0 0 12px; }
.nf-note del { color: var(--red); text-decoration-thickness: 2px; }
.nf-note ins { text-decoration: none; background: linear-gradient(var(--hl), var(--hl)) no-repeat 0 92% / 100% 0.4em; }

@media (max-width: 700px) {
  .contact-row { grid-template-columns: 1fr; }
  .contact-primary { padding: 20px 16px; }
}

/* ---------- 12. Phase 2: data tools ---------- */
.status { margin: 12px 0 0; font-weight: 600; min-height: 1.6em; word-break: break-word; }
.status.ok { color: var(--green); }
.status.err { color: var(--red); }
.text-input.inline { width: auto; min-height: 36px; padding: 4px 8px; font: 15px var(--sans); }
.hashes { display: grid; gap: 8px; margin-top: 14px; }
.hash-row { display: grid; grid-template-columns: 78px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-2); }
.hash-name { font: 700 0.8rem var(--mono); color: var(--ink-soft); }
.hash-value { font: 0.82rem/1.45 var(--mono); word-break: break-all; min-height: 1.45em; user-select: all; }
.md-frame { width: 100%; height: 100%; min-height: 380px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
#md-preview-wrap { height: 380px; }
@media (max-width: 700px) {
  .hash-row { grid-template-columns: 1fr auto; }
  .hash-name { grid-column: 1 / -1; }
}

/* ---------- 13. Group labels, print route ---------- */
.group-label {
  display: flex; align-items: center; gap: 12px; margin: 26px 0 12px;
  font: 700 0.78rem var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft);
}
.group-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
[data-tool-group]:first-child .group-label { margin-top: 10px; }
.print-sheet { display: none; }
@media print {
  body.print-mode > *:not(.print-sheet) { display: none !important; }
  body.print-mode { background: #fff !important; }
  body.print-mode .print-sheet { display: block; color: #000; background: #fff; line-height: 1.5; padding: 0 var(--pt-margin, 19mm); }
  .print-table { width: 100%; border-collapse: collapse; }
  .print-table td { padding: 0; }
  .print-table thead { display: table-header-group; }
  .print-table tfoot { display: table-footer-group; }
  .pt-gap { height: var(--pt-margin, 19mm); }
  .print-title { font-weight: 700; font-size: 1.5em; margin-bottom: 0.8em; overflow-wrap: anywhere; }
  .print-text { white-space: pre-wrap; overflow-wrap: anywhere; }
}
@media (max-width: 330px) { .footer-top { grid-template-columns: 1fr; } }

/* ---------- 14. Inline text fields inside option rows ---------- */
.opt .text-input.title-input { width: 260px; max-width: 100%; font: 15px var(--sans); }
@media (max-width: 700px) { .opts .opt:has(.title-input) { flex-wrap: wrap; width: 100%; } .opt .text-input.title-input { width: 100%; } }
