/* ── PDF Suite — page & tool styles ────────────────────────────────
   Builds on css/shared.css design tokens (:root). LK Forge brand family
   (Orbitron display + Outfit body + JetBrains Mono numerics), with a
   crimson accent (#b91c1c). 100% client-side — no network calls. */

:root {
  /* Suite brand accent (crimson) — overrides the indigo default from
     shared.css so this suite gets its own identity. */
  --accent:       #b91c1c;
  --accent-h:     #991b1b;
  --accent-bg:    #fef2f2;
  --accent-fg:    #7f1d1d;
  --accent-light: #dc2626;
  --icon-bg:      #fecaca;
}

main { max-width: 860px; margin: 0 auto; padding: 20px; }

/* ── Tool hero (icon + title + subtitle) ───────────────────────── */
.tool-hero { max-width: 860px; margin: 0 auto; padding: 36px 20px 4px; }
.tool-hero .hero-head { display: flex; align-items: center; gap: 16px; }
.tool-hero .hero-icon {
  flex-shrink: 0; width: 56px; height: 56px; border-radius: 14px;
  background: var(--accent); display: flex; align-items: center; justify-content: center;
}
.tool-hero .hero-icon svg { width: 30px; height: 30px; stroke: #fff; }
.tool-hero h1 { font-family: 'Orbitron', sans-serif; font-size: clamp(1.55rem, 4.2vw, 2.2rem); font-weight: 900; letter-spacing: -.5px; line-height: 1.2; }
.tool-hero .subtitle { color: var(--muted); font-size: 1.02rem; margin-top: 12px; max-width: 680px; }

/* ── Tool card ─────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 24px; margin-top: 24px; }
.card + .card { margin-top: 16px; }

/* ── Labels / inputs ───────────────────────────────────────────── */
.field-label { display: block; font-size: .82rem; font-weight: 700; color: var(--text); margin-bottom: 7px; }
.field-label .hint { font-weight: 500; color: var(--muted); }

.txt-area {
  width: 100%; min-height: 150px; resize: vertical;
  font-family: 'Outfit', system-ui, sans-serif; font-size: 1rem; line-height: 1.6;
  padding: 14px 16px; border: 1.5px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.txt-area:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,70,229,.14); }
.txt-area.readonly { background: var(--surface2); }
.txt-area::placeholder { color: var(--muted); }

.net-input, .net-num {
  font-family: 'JetBrains Mono', monospace; font-size: 1rem;
  padding: 13px 16px; border: 1.5px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.net-input { flex: 1 1 200px; min-width: 0; }
.net-input:focus, .net-num:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,70,229,.14); }
.net-select {
  font-family: 'Outfit', system-ui, sans-serif; font-size: .98rem;
  padding: 12px 14px; border: 1.5px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); outline: none; cursor: pointer;
  transition: border-color .15s;
}
.net-select:focus { border-color: var(--accent); }

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 11px 22px;
  font-family: inherit; font-size: .98rem; font-weight: 700;
  border: none; border-radius: var(--radius); cursor: pointer;
  background: var(--accent); color: #fff;
  transition: background .15s, transform .1s, opacity .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--accent-h); }
.btn:active { transform: scale(.98); }
.btn svg { width: 16px; height: 16px; }

.btn-ghost {
  background: var(--surface); color: var(--text); border: 1.5px solid var(--border);
}
.btn-ghost:hover { background: var(--surface2); border-color: var(--muted); }

/* Case-action button grid */
.case-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.case-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  min-height: 44px; padding: 12px 16px; text-align: left;
  font-family: inherit; cursor: pointer;
  background: var(--surface); color: var(--text);
  border: 1.5px solid var(--border); border-radius: var(--radius);
  transition: border-color .15s, background .15s, transform .1s;
}
.case-btn:hover { border-color: var(--accent); background: var(--accent-bg); transform: translateY(-1px); }
.case-btn .cb-name { font-size: .95rem; font-weight: 700; }
.case-btn .cb-ex { font-family: 'JetBrains Mono', monospace; font-size: .76rem; color: var(--muted); }

/* ── Action row (copy / clear) ─────────────────────────────────── */
.action-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.action-row .btn { min-height: 40px; padding: 9px 18px; font-size: .9rem; }

/* ── Live counts ───────────────────────────────────────────────── */
.counts { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.count-item { display: inline-flex; align-items: baseline; gap: 6px; font-size: .9rem; color: var(--muted); }
.count-item .c-num { font-family: 'JetBrains Mono', monospace; font-size: 1.05rem; font-weight: 700; color: var(--text); }

/* ── Unit converter rows ───────────────────────────────────────── */
.cat-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.cat-tab {
  font-family: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
  padding: 9px 16px; min-height: 40px;
  color: var(--text); background: var(--surface);
  border: 1.5px solid var(--border); border-radius: 999px;
  transition: background .15s, border-color .15s, color .15s;
}
.cat-tab:hover { border-color: var(--accent); }
.cat-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.convert-grid { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 14px; }
.convert-col { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.convert-col .net-input { width: 100%; flex: none; }
.swap-btn {
  flex-shrink: 0; width: 44px; height: 44px; align-self: end; margin-bottom: 1px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  background: var(--surface); color: var(--accent);
  border: 1.5px solid var(--border); border-radius: 50%;
  transition: background .15s, border-color .15s, transform .2s;
}
.swap-btn:hover { background: var(--accent-bg); border-color: var(--accent); }
.swap-btn:active { transform: rotate(180deg); }
.swap-btn svg { width: 18px; height: 18px; }
.convert-result { margin-top: 18px; font-size: .95rem; color: var(--muted); text-align: center; }
.convert-result strong { font-family: 'JetBrains Mono', monospace; color: var(--text); font-weight: 700; }

/* ── Color converter ───────────────────────────────────────────── */
.color-top { display: grid; grid-template-columns: 120px 1fr; gap: 20px; align-items: center; }
.swatch {
  width: 120px; height: 120px; border-radius: var(--radius-lg);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  background: #4f46e5;
}
.color-picker-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.color-picker-row input[type=color] {
  width: 52px; height: 44px; padding: 2px; cursor: pointer;
  border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.color-picker-row .picker-label { font-size: .9rem; color: var(--muted); }
.color-fields { display: grid; gap: 12px; margin-top: 8px; }
.color-field { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 10px; }
.color-field label { font-family: 'JetBrains Mono', monospace; font-size: .82rem; font-weight: 700; color: var(--accent-fg); }
.color-field .net-input { width: 100%; flex: none; }
.copy-mini {
  min-height: 40px; padding: 8px 14px; font-size: .82rem; font-weight: 600; cursor: pointer;
  color: var(--accent-fg); background: var(--accent-bg); border: 0; border-radius: var(--radius);
  font-family: inherit; transition: background .15s;
}
.copy-mini:hover { background: #ddd9fb; }

/* ── Status / error line ───────────────────────────────────────── */
.status-line { min-height: 20px; margin-top: 12px; font-size: .88rem; font-weight: 600; }
.status-line.error { color: #b42318; }

/* ── Tool hub grid (index) ─────────────────────────────────────── */
.hub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(264px, 1fr)); gap: 18px; margin-top: 8px; }
.hub-card {
  display: block; text-decoration: none; position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 26px 24px; box-shadow: var(--shadow);
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.hub-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--shadow-lg); text-decoration: none; }
.hub-card .hub-tag { position: absolute; top: 18px; right: 18px; font-size: .72rem; font-weight: 700; color: var(--accent-fg); background: var(--accent-bg); padding: 2px 9px; border-radius: 999px; }
.hub-card .hub-icon { width: 52px; height: 52px; border-radius: 12px; background: var(--accent); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.hub-card .hub-icon svg { width: 27px; height: 27px; stroke: #fff; }
.hub-card h2 { font-family: 'Orbitron', sans-serif; font-size: 1.15rem; font-weight: 700; color: var(--text); margin-bottom: 7px; }
.hub-card p { font-size: .9rem; color: var(--muted); line-height: 1.6; margin-bottom: 16px; }
.hub-card .hub-open { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; font-weight: 700; color: var(--accent); }

/* ── Content sections (how-it-works / faq) ─────────────────────── */
.section { max-width: 860px; margin: 16px auto; padding: 24px 20px; }
.section > h2 { font-family: 'Orbitron', sans-serif; font-size: 1.4rem; font-weight: 700; margin-bottom: 8px; }
.section > .section-sub { color: var(--muted); margin-bottom: 20px; }
.steps { display: grid; gap: 14px; }
.step { display: flex; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow); }
.step-num { flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; background: var(--accent-bg); color: var(--accent-fg); font-weight: 800; display: flex; align-items: center; justify-content: center; }
.step-body h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; }
.step-body p { font-size: .92rem; color: var(--muted); line-height: 1.6; }

.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.faq summary { cursor: pointer; padding: 16px 18px; font-weight: 700; font-size: .98rem; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; float: right; color: var(--accent); font-weight: 700; }
.faq details[open] summary::after { content: '\2013'; }
.faq .faq-body { padding: 0 18px 16px; font-size: .92rem; color: var(--muted); line-height: 1.7; }
.faq .faq-body a { color: var(--accent); }

/* ── Footer ────────────────────────────────────────────────────── */
footer.page-footer { border-top: 1px solid var(--border); padding: 24px 20px; text-align: center; font-size: .82rem; color: var(--muted); margin-top: 24px; }
footer.page-footer nav { margin-bottom: 6px; }
footer.page-footer nav a { color: var(--muted); }
footer.page-footer nav a:hover { color: var(--text); }

/* ── Toast ─────────────────────────────────────────────────────── */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--text); color: #fff; padding: 11px 20px; border-radius: var(--radius); font-size: .88rem; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 200; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 560px) {
  .color-top { grid-template-columns: 1fr; justify-items: center; }
  .convert-grid { grid-template-columns: 1fr; }
  .swap-btn { transform: rotate(90deg); margin: 2px auto; }
  .swap-btn:active { transform: rotate(270deg); }
  .color-field { grid-template-columns: 52px 1fr; }
  .color-field .copy-mini { grid-column: 2; justify-self: start; }
}
/* ── Currency converter ────────────────────────────────────────── */
.try-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 18px; }
.try-row .try-label { font-size: .85rem; color: var(--muted); font-weight: 600; margin-right: 2px; }
.try-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px;
  font-family: 'JetBrains Mono', monospace; font-size: .82rem; font-weight: 600; color: var(--text);
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 7px 13px; cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
}
.try-chip:hover { border-color: var(--accent); background: var(--accent-bg); transform: translateY(-1px); }
.convert-result .conv-amt { font-family: 'JetBrains Mono', monospace; font-weight: 700; color: var(--text); }
.convert-result .conv-amt.accent { color: var(--accent); }
.rate-line { margin-top: 10px; font-size: .82rem; color: var(--muted); text-align: center; }
.card.loading { opacity: .7; }
.card.loading .convert-grid { pointer-events: none; }

/* ── Image & PDF converters (file tools) ───────────────────────── */
/* Drop zone */
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  text-align: center; cursor: pointer; min-height: 150px; padding: 28px 20px;
  border: 2px dashed var(--border); border-radius: var(--radius-lg);
  background: var(--surface2); color: var(--muted);
  transition: border-color .15s, background .15s, color .15s;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--accent); color: var(--accent-fg); outline: none; }
.dropzone.drag { border-color: var(--accent); background: var(--accent-bg); color: var(--accent-fg); }
.dropzone .drop-icon { width: 40px; height: 40px; stroke: var(--accent); fill: none; }
.dropzone .drop-title { font-size: 1rem; font-weight: 700; color: var(--text); }
.dropzone .drop-hint { font-size: .85rem; }

/* Source-image meta grid */
.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-top: 16px; }
.meta-item { display: flex; flex-direction: column; gap: 2px; }
.meta-item .m-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.meta-item .m-val { font-family: 'JetBrains Mono', monospace; font-size: .9rem; font-weight: 600; color: var(--text); word-break: break-word; }

/* Selectable format buttons (reuses case-btn look) — add an active state */
.case-btn.active { border-color: var(--accent); background: var(--accent-bg); }
.case-btn.active .cb-name { color: var(--accent-fg); }

/* Quality slider */
.range-row { display: flex; align-items: center; gap: 14px; margin: 4px 0 4px; }
.range-row input[type=range] { flex: 1; accent-color: var(--accent); height: 28px; cursor: pointer; }
.range-row .range-val { font-family: 'JetBrains Mono', monospace; font-weight: 700; color: var(--text); min-width: 48px; text-align: right; }

/* Options row (page size) */
.opt-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 4px; }
.opt-row .opt-label { font-size: .82rem; font-weight: 700; color: var(--text); }

/* Result preview */
.preview-wrap { display: flex; justify-content: center; margin-bottom: 16px; }
.preview-img {
  max-width: 100%; max-height: 420px; border-radius: var(--radius); border: 1px solid var(--border);
  background-image:
    linear-gradient(45deg, #e6e8f5 25%, transparent 25%), linear-gradient(-45deg, #e6e8f5 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e6e8f5 75%), linear-gradient(-45deg, transparent 75%, #e6e8f5 75%);
  background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}
.result-meta { font-family: 'JetBrains Mono', monospace; font-size: .85rem; color: var(--muted); text-align: center; margin-top: 12px; word-break: break-word; }

/* File list (PDF converter) */
.file-list { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.file-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); }
.file-row .file-name { font-size: .9rem; color: var(--text); word-break: break-word; min-width: 0; }
.file-row .file-rm { flex-shrink: 0; width: 30px; height: 30px; border: none; border-radius: 50%; cursor: pointer; background: transparent; color: var(--muted); font-size: .95rem; line-height: 1; transition: background .15s, color .15s; }
.file-row .file-rm:hover { background: #fde2e1; color: #b42318; }

/* Military Time converter */
.now-line { margin: 0 0 18px; padding: 10px 14px; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); font-size: .95rem; color: var(--muted); text-align: center; }
.now-line strong { font-family: 'JetBrains Mono', monospace; color: var(--accent); font-weight: 700; }
.now-line span { font-family: 'JetBrains Mono', monospace; color: var(--text); }
.conv-note { display: block; margin-top: 4px; font-size: .85rem; color: var(--muted); }
.mil-table-wrap { overflow-x: auto; margin-top: 10px; border: 1px solid var(--border); border-radius: var(--radius); }
.mil-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.mil-table th { text-align: left; padding: 10px 14px; background: var(--surface2); color: var(--text); font-weight: 600; border-bottom: 1px solid var(--border); }
.mil-table td { padding: 8px 14px; border-bottom: 1px solid var(--border); color: var(--muted); }
.mil-table tbody tr:last-child td { border-bottom: none; }
.mil-table td:first-child { font-family: 'JetBrains Mono', monospace; font-weight: 600; color: var(--accent); }
.mil-table td:nth-child(2) { color: var(--text); }
.mil-note { margin-top: 14px; font-size: .9rem; color: var(--muted); }

/* 6 converter tools + Home + Tools = 8 nav links. Show the inline row only on
   wide screens; fall back to the hamburger between 680px and 900px. */
@media (min-width: 680px) and (max-width: 899px) {
  .site-nav .nav-link { display: none; }
  .nav-hamburger { display: flex; }
  .nav-mobile-menu.open { display: flex !important; }
}
@media (min-width: 900px) {
  .nav-link { min-width: 0; padding: 8px 11px; }
}

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

/* "Back to Image Tools" pill — shown by back-to-tools.js when the visitor
   arrived from the standalone Image Tools suite. */
.back-to-tools { display: flex; justify-content: flex-end; margin: 0 0 12px; }
.back-to-tools a { display: inline-flex; align-items: center; gap: 5px; padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px; font-size: .85rem; font-weight: 600; color: var(--accent); background: var(--surface); text-decoration: none; transition: background .15s, color .15s, border-color .15s; }
.back-to-tools a:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* "From the blog" link list on the hub */
.blog-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.blog-links li { position: relative; padding-left: 20px; }
.blog-links li::before { content: "\2192"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.blog-links a { color: var(--text); font-weight: 600; text-decoration: none; }
.blog-links a:hover { color: var(--accent); text-decoration: underline; }
