/* ── Converters — page & tool styles ───────────────────────────────
   Builds on css/shared.css design tokens (:root). Same visual family
   as the other lkforge tools (Space Grotesk + JetBrains Mono), with an
   indigo accent (#4f46e5). 100% client-side — no network calls. */

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-size: clamp(1.7rem, 4.5vw, 2.3rem); font-weight: 800; letter-spacing: -.5px; line-height: 1.15; }
.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: 'Space Grotesk', 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: 'Space Grotesk', 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-size: 1.2rem; font-weight: 800; 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-size: 1.5rem; font-weight: 800; 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; }

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