/* ================================================================
   ToolBox — Main Stylesheet  (matches all blade templates)
   ================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@700;800&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg:           #0a0a0f;
  --surface:      #13131a;
  --surface2:     #1c1c28;
  --surface3:     #22222f;
  --border:       #2a2a3a;
  --accent:       #7c6bff;
  --accent-dim:   rgba(124,107,255,.12);
  --accent2:      #40e0c8;
  --text:         #e8e8f0;
  --text-muted:   #7070a0;
  --text-dim:     #404060;
  --danger:       #e04040;
  --danger-dim:   rgba(224,64,64,.1);
  --success:      #40c870;
  --success-dim:  rgba(64,200,112,.1);
  --warning:      #e0a040;
  --radius:       10px;
  --radius-lg:    16px;
  --shadow:       0 8px 32px rgba(0,0,0,.5);
  --shadow-sm:    0 4px 16px rgba(0,0,0,.3);
}

/* ── Reset ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: 'Inter', sans-serif;
       font-size: 15px; line-height: 1.6; overflow-x: hidden; min-height: 100vh;
       display: flex; flex-direction: column; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
main { flex: 1; }

/* ── HEADER (.header) ───────────────────────── */
.header {
  position: sticky; top: 0; z-index: 200;
  background: rgba(10,10,15,.95); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px; display: flex; align-items: center; gap: 16px; height: 62px;
}
.logo {
  font-family: 'Roboto', sans-serif; font-weight: 800; font-size: 20px;
  display: flex; align-items: center; gap: 8px; white-space: nowrap; flex-shrink: 0;
}
.logo-icon {
  width: 30px; height: 30px; background: var(--accent); border-radius: 7px;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}

/* ── SEARCH (.search-wrap / .s-input / .s-results) ── */
.search-wrap { flex: 1; max-width: 460px; position: relative; }
.search-wrap .s-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 14px; pointer-events: none;
}
.s-input {
  width: 100%; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 9px; padding: 9px 12px 9px 36px; color: var(--text);
  font-family: inherit; font-size: 14px; outline: none; transition: border-color .2s;
}
.s-input::placeholder { color: var(--text-dim); }
.s-input:focus { border-color: var(--accent); }
.s-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  max-height: 360px; overflow-y: auto; z-index: 300; display: none; box-shadow: var(--shadow);
}
.s-results.open { display: block; }
.sr-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  cursor: pointer; transition: background .15s; border-bottom: 1px solid var(--border);
}
.sr-item:last-child { border-bottom: none; }
.sr-item:hover { background: var(--surface2); }
.sr-emoji { font-size: 18px; flex-shrink: 0; }
.sr-name { font-size: 14px; font-weight: 500; }
.sr-cat { font-size: 11px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }

/* ── HEADER NAV (.h-nav / .n-btn) ───────────── */
.h-nav { display: flex; gap: 2px; margin-left: auto; }
.n-btn {
  font-size: 13px; font-weight: 500; padding: 6px 12px; border-radius: 6px;
  color: var(--text-muted); transition: color .2s, background .2s; white-space: nowrap;
}
.n-btn:hover { color: var(--text); background: var(--surface2); }

/* ── BREADCRUMB (.bc-nav / .bc-list / .bc-sep) ── */
.bc-nav { padding: 12px 24px 0; max-width: 920px; margin: 0 auto; }
.bc-list {
  list-style: none; display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-muted); flex-wrap: wrap;
}
.bc-list a { color: var(--text-muted); transition: color .2s; }
.bc-list a:hover { color: var(--accent); }
.bc-sep { color: var(--text-dim); }

/* ── HERO (home page) ───────────────────────── */
.hero {
  text-align: center; padding: 72px 24px 40px;
  position: relative; overflow: hidden;
}
.hero-glow {
  position: absolute; top: -120px; left: 50%; transform: translateX(-50%);
  width: 700px; height: 400px;
  background: radial-gradient(ellipse, rgba(124,107,255,.15) 0%, transparent 70%);
  pointer-events: none;
}
.hero-h1 {
  font-family: 'Roboto', sans-serif; font-size: clamp(34px, 6vw, 68px);
  font-weight: 800; line-height: 1.08; letter-spacing: -2px; margin-bottom: 14px;
}
.hero-accent { color: var(--accent); }
.hero-sub { font-size: 17px; color: var(--text-muted); max-width: 500px; margin: 0 auto 32px; }
.hero-stats { display: flex; justify-content: center; gap: 48px; flex-wrap: wrap; }
.h-stat-n { font-family: 'Roboto', sans-serif; font-size: 32px; font-weight: 800; color: var(--accent); }
.h-stat-l { font-size: 13px; color: var(--text-muted); }

/* ── POPULAR STRIP (.pop-strip) ─────────────── */
.pop-strip {
  max-width: 1440px; margin: 0 auto 32px; padding: 0 24px;
}
.pop-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
}
.pop-head h2 { font-family: 'Roboto', sans-serif; font-size: 16px; font-weight: 700; }
.pop-badge {
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  color: var(--warning); background: rgba(224,160,64,.1);
  border: 1px solid rgba(224,160,64,.3); padding: 3px 9px; border-radius: 20px;
}
.pop-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.pop-chip {
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  padding: 7px 14px; font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all .2s; display: flex; align-items: center; gap: 6px;
}
.pop-chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

/* ── TYPE LEGEND ────────────────────────────── */
.type-legend {
  max-width: 1440px; margin: 0 auto 16px; padding: 0 24px;
  display: flex; gap: 20px; flex-wrap: wrap; font-size: 12px; color: var(--text-muted);
}
.leg { display: flex; align-items: center; gap: 6px; }
.leg-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ── FILTER TABS (.f-tabs / .f-tab) ────────── */
.f-tabs {
  max-width: 1440px; margin: 0 auto 28px; padding: 0 24px;
  display: flex; gap: 4px; overflow-x: auto; flex-wrap: nowrap;
}
.f-tabs::-webkit-scrollbar { height: 0; }
.f-tab {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text-muted); font-family: inherit; font-size: 13px; font-weight: 500;
  padding: 7px 14px; cursor: pointer; transition: all .2s; white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
}
.f-tab:hover { color: var(--text); border-color: var(--border); background: var(--surface2); }
.f-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.f-cnt {
  background: rgba(255,255,255,.12); border-radius: 10px;
  padding: 1px 7px; font-size: 11px; font-family: 'JetBrains Mono', monospace;
}
.f-tab.active .f-cnt { background: rgba(255,255,255,.2); }

/* ── CATEGORIES (.cats-wrap / .cat-sec) ──────── */
.cats-wrap { max-width: 1440px; margin: 0 auto; padding: 0 24px 80px; }
.cat-sec { margin-bottom: 52px; animation: fadeUp .4s ease both; }
@keyframes fadeUp { from { opacity:0; transform:translateY(14px); } to { opacity:1; transform:none; } }
.cat-hd {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.cat-ico {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0;
}
.cat-title { font-family: 'Roboto', sans-serif; font-size: 19px; font-weight: 700; }
.cat-cnt {
  margin-left: auto; font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--text-muted);
  background: var(--surface2); padding: 3px 10px; border-radius: 20px;
}

/* ── TOOL GRID (.tools-grid / .tool-card) ────── */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 9px; }
.tool-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; display: flex; align-items: center; gap: 10px;
  transition: border-color .2s, background .2s, transform .15s;
  position: relative; overflow: hidden;
}
a.tool-card { cursor: pointer; }
a.tool-card:hover {
  border-color: var(--accent); background: var(--surface2);
  transform: translateY(-2px); box-shadow: var(--shadow-sm);
}
.tool-card.type-api { opacity: .5; cursor: default; }
.tc-e { font-size: 19px; flex-shrink: 0; width: 28px; text-align: center; }
.tc-n { font-size: 13px; font-weight: 500; flex: 1; line-height: 1.3; }
.tc-b {
  font-size: 9px; font-family: 'JetBrains Mono', monospace;
  padding: 2px 6px; border-radius: 10px; white-space: nowrap; flex-shrink: 0;
}
.badge-browser { color: var(--success); background: var(--success-dim); border: 1px solid rgba(64,200,112,.2); }
.badge-server  { color: var(--warning); background: rgba(224,160,64,.1); border: 1px solid rgba(224,160,64,.2); }
.badge-api     { color: var(--text-dim); background: var(--surface2); border: 1px solid var(--border); }

/* ── TOOL PAGE ── hero (.t-hero / .t-wrap) ───── */
.t-hero {
  text-align: center; padding: 52px 24px 32px;
  position: relative; overflow: hidden;
}
.t-glow {
  position: absolute; top: -80px; left: 50%; transform: translateX(-50%);
  width: 600px; height: 320px;
  background: radial-gradient(ellipse, rgba(124,107,255,.12) 0%, transparent 70%);
  pointer-events: none;
}
.t-tag {
  display: inline-block; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 20px; padding: 4px 14px;
  font-size: 12px; font-family: 'JetBrains Mono', monospace; color: var(--text-muted);
  margin-bottom: 14px; text-transform: uppercase; letter-spacing: .5px;
}
.t-h1 {
  font-family: 'Roboto', sans-serif; font-size: clamp(26px, 5vw, 50px);
  font-weight: 800; letter-spacing: -1.5px; margin-bottom: 12px;
}
.t-sub { font-size: 16px; color: var(--text-muted); max-width: 520px; margin: 0 auto 16px; }
.privacy-badge {
  display: inline-block; font-size: 12px; color: var(--success);
  background: var(--success-dim); border: 1px solid rgba(64,200,112,.25);
  border-radius: 20px; padding: 5px 14px; margin-top: 8px;
}
.privacy-server { color: var(--warning); background: rgba(224,160,64,.08); border-color: rgba(224,160,64,.25); }

.t-wrap { max-width: 880px; margin: 0 auto; padding: 0 24px; }

/* ── TOOL CARDS (inside tool pages) ─────────── */
/* These blade files use inline styles + .tool-card / .input-group / .tool-input / .btn-primary etc */
.tool-card { /* already defined above — also used as a container */ }

/* tool-card containers now use .card class */

.input-group { margin-bottom: 18px; }
.input-group label {
  display: block; font-size: 12px; font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted); margin-bottom: 7px; letter-spacing: .4px;
}
.tool-input {
  width: 100%; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 11px 13px; color: var(--text);
  font-family: inherit; font-size: 14px; outline: none; transition: border-color .2s;
}
.tool-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
textarea.tool-input { resize: vertical; min-height: 120px; line-height: 1.6; }
select.tool-input { cursor: pointer; }
select.tool-input option { background: var(--surface2); }
input[type=color].tool-input { height: 44px; padding: 4px; cursor: pointer; }
input[type=range] { accent-color: var(--accent); cursor: pointer; }

/* ── BUTTONS ─────────────────────────────────── */
.btn-primary, .btn-secondary, .btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 9px; padding: 12px 24px;
  font-family: 'Roboto', sans-serif; font-weight: 700; font-size: 14px;
  cursor: pointer; transition: opacity .2s, transform .1s, box-shadow .2s;
  text-decoration: none;
}
.btn-primary:hover, .btn-secondary:hover, .btn-danger:hover {
  opacity: .88; transform: translateY(-1px); box-shadow: var(--shadow-sm);
}
.btn-primary:active, .btn-secondary:active { transform: none; }
.btn-primary   { background: var(--accent); color: #fff; }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-primary:disabled, .btn-secondary:disabled { opacity: .38; pointer-events: none; cursor: not-allowed; }

/* ── RESULT BOX ──────────────────────────────── */
.result-box {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-top: 18px;
}

/* ── UPLOAD AREA ─────────────────────────────── */
.upload-area {
  border: 2px dashed var(--border); border-radius: 12px;
  padding: 48px 24px; text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s;
}
.upload-area:hover { border-color: var(--accent); background: var(--accent-dim); }

/* ── STATS BOXES (inside tools) ──────────────── */
.stat-box { background: var(--surface2); border: 1px solid var(--border); border-radius: 9px; padding: 14px; text-align: center; }
.stat-num { font-family: 'Roboto', sans-serif; font-size: 1.25rem; font-weight: 800; color: var(--accent); word-break: break-word; }
.stat-lbl { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ── TOOL INFO SECTION ───────────────────────── */
.t-info {
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 52px 0; margin-top: 40px;
}
.t-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
@media (max-width: 768px) { .t-info-grid { grid-template-columns: 1fr; } }
.t-about h2, .t-faq h2 {
  font-family: 'Roboto', sans-serif; font-size: 20px; font-weight: 700;
  margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.t-about p { color: var(--text-muted); line-height: 1.8; margin-bottom: 16px; }
.t-meta { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.t-meta-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px; background: var(--surface2); border-radius: 9px;
  border: 1px solid var(--border); font-size: 14px;
}
.t-meta-lbl { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 2px; }
.t-meta-val { color: var(--text); font-weight: 500; }

/* ── FAQ (.faq-item) ─────────────────────────── */
.faq-item {
  border-bottom: 1px solid var(--border); padding: 14px 0;
}
.faq-item summary {
  cursor: pointer; font-weight: 600; font-size: 14px;
  list-style: none; display: flex; align-items: center; justify-content: space-between;
  padding-right: 8px; user-select: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; color: var(--accent); font-size: 18px; font-weight: 300; }
.faq-item[open] summary::after { content: '−'; }
.faq-ans { padding: 10px 0 4px; color: var(--text-muted); font-size: 14px; line-height: 1.7; }

/* ── RELATED (.related-sec / .related-grid) ─── */
.related-sec { padding: 48px 0; }
.related-h2 {
  font-family: 'Roboto', sans-serif; font-size: 20px; font-weight: 700;
  margin-bottom: 20px;
}
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.related-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; display: flex; align-items: flex-start; gap: 12px;
  transition: border-color .2s, background .2s;
}
.related-card:hover { border-color: var(--accent); background: var(--surface2); }
.r-ico { font-size: 24px; flex-shrink: 0; }
.r-name { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.r-desc { font-size: 12px; color: var(--text-muted); line-height: 1.4; }

/* ── FOOTER ──────────────────────────────────── */
.footer {
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 52px 24px 32px; margin-top: auto;
}
.footer-inner { max-width: 1440px; margin: 0 auto; }
.f-brand { text-align: center; margin-bottom: 36px; }
.f-logo { font-family: 'Roboto', sans-serif; font-weight: 800; font-size: 22px; margin-bottom: 8px; }
.f-desc { color: var(--text-muted); font-size: 14px; }
.f-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 28px; margin-bottom: 36px;
}
.f-col h3 { font-size: 13px; font-weight: 600; margin-bottom: 12px; color: var(--text); }
.f-col ul { list-style: none; }
.f-col li { margin-bottom: 8px; }
.f-col a { font-size: 13px; color: var(--text-muted); transition: color .2s; }
.f-col a:hover { color: var(--accent); }
.f-bottom {
  border-top: 1px solid var(--border); padding-top: 20px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  font-size: 13px; color: var(--text-muted);
}
.f-blinks { display: flex; gap: 20px; }
.f-blinks a { color: var(--text-muted); transition: color .2s; }
.f-blinks a:hover { color: var(--accent); }

/* ── SCROLLBAR ───────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ── CODE / PRE ──────────────────────────────── */
pre, .code-block {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 9px;
  padding: 16px; font-family: 'JetBrains Mono', monospace; font-size: 13px;
  overflow-x: auto; line-height: 1.7; color: var(--text); white-space: pre-wrap; word-break: break-all;
}
code { font-family: 'JetBrains Mono', monospace; background: var(--surface2); padding: 2px 6px; border-radius: 4px; font-size: .9em; }

/* ── TABLE ───────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  background: var(--surface2); padding: 10px 14px; text-align: left;
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 1px solid var(--border);
}
td { padding: 11px 14px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface2); }

/* ── ALERTS ──────────────────────────────────── */
.alert { border-radius: 9px; padding: 14px 16px; font-size: 13px; margin-top: 16px; display: flex; gap: 10px; }
.alert-info    { background: rgba(64,160,224,.08); border: 1px solid rgba(64,160,224,.3); color: #80c0f0; }
.alert-success { background: var(--success-dim); border: 1px solid rgba(64,200,112,.3); color: var(--success); }
.alert-warn    { background: rgba(224,160,64,.08); border: 1px solid rgba(224,160,64,.3); color: var(--warning); }
.alert-danger  { background: var(--danger-dim); border: 1px solid rgba(224,64,64,.3); color: #f08080; }

/* ── EXTERNAL LINK BUTTON (.ext-btn) ────────── */
.ext-btn {
  display: inline-block; background: var(--accent); color: #fff;
  padding: .5rem 1.25rem; border-radius: 8px; text-decoration: none;
  font-weight: 600; transition: opacity .2s;
}
.ext-btn:hover { opacity: .85; }

/* ── RESPONSIVE ──────────────────────────────── */
@media (max-width: 768px) {
  .header { padding: 0 16px; gap: 10px; }
  .h-nav { display: none; }
  .hero { padding: 44px 16px 28px; }
  .hero-stats { gap: 28px; }
  .cats-wrap { padding: 0 16px 60px; }
  .tools-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .t-wrap { padding: 0 16px; }
  .f-grid { grid-template-columns: repeat(2, 1fr); }
  div.tool-card { padding: 18px; }
  .pop-strip { padding: 0 16px; }
  .f-tabs { padding: 0 16px; }
  .type-legend { padding: 0 16px; }
}

/* ================================================================
   TOOL PAGE COMPONENT CLASSES
   (used inside individual tool blade files)
   ================================================================ */

/* ── Card (.card / .card-title) ─────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 20px;
}
.card-title {
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Drop Zone (.dz / .dz-ico / .dz-lbl / .dz-sub / .dz-a) ── */
.dz {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 44px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  position: relative;
}
.dz:hover, .dz.dz-a {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.dz input[type=file] {
  position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer;
}
.dz-ico { font-size: 40px; margin-bottom: 12px; }
.dz-lbl { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.dz-sub { font-size: 13px; color: var(--text-muted); }

/* ── File List (.flist / .fi / .fi-n / .fi-s / .fi-rm) ─── */
.flist { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.fi {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.fi-n { flex: 1; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fi-s { font-size: 12px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; white-space: nowrap; }
.fi-rm {
  background: none; border: none; color: var(--text-dim);
  font-size: 16px; padding: 4px 6px; border-radius: 4px;
  cursor: pointer; transition: color .2s, background .2s; line-height: 1;
}
.fi-rm:hover { color: var(--danger); background: var(--danger-dim); }

/* ── Field (.field) ─────────────────────────── */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  margin-bottom: 7px;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 13px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.field input[type=color]  { height: 44px; padding: 4px; cursor: pointer; }
.field input[type=range]  { padding: 0; accent-color: var(--accent); cursor: pointer; }
.field textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.field select option { background: var(--surface2); }

/* ── Grids (.grid-2 / .grid-3) ─────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
@media (max-width: 640px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ── Buttons (.btn / .btn-sm / .btn-row) ────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 9px;
  padding: 11px 22px;
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: opacity .2s, transform .1s, box-shadow .2s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover   { opacity: .88; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active  { transform: none; }
.btn:disabled { opacity: .38; pointer-events: none; cursor: not-allowed; }
.btn-sm      { padding: 7px 14px; font-size: 12px; border-radius: 7px; }
.btn-row     { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; margin-bottom: 8px; }

/* ── Output Box (.out-box / .out-hd / .out-lbl) ── */
.out-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 420px;
  overflow-y: auto;
}
.out-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.out-lbl {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .6px;
}

/* ── Copy Button (.copy-btn) ────────────────── */
.copy-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  transition: all .2s;
}
.copy-btn:hover   { border-color: var(--accent); color: var(--accent); }
.copy-btn.copied  { border-color: var(--success); color: var(--success); }

/* ── Stats Grid (.stats-grid / .stat-box / .stat-n / .stat-l) ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(125px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 12px;
  text-align: center;
}
.stat-n, .stat-num {
  font-family: 'Roboto', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
  word-break: break-word;
}
.stat-l, .stat-lbl {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Progress Bar (.prog-bar / .prog-fill / .prog-lbl) ── */
.prog-lbl  { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.prog-bar  { height: 6px; background: var(--surface2); border: 1px solid var(--border); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.prog-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width .3s; }

/* ── Result Card (.result-card / .result-hd / .r-ico / .r-ttl / .r-acts / .r-meta) ── */
.result-card {
  background: linear-gradient(135deg, var(--success-dim) 0%, rgba(64,200,112,.02) 100%);
  border: 1px solid rgba(64,200,112,.3);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 20px;
  animation: fadeUp .4s ease;
}
.result-hd {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.r-ico  { font-size: 28px; }
.r-ttl  { font-family: 'Roboto', sans-serif; font-weight: 700; font-size: 18px; color: var(--success); }
.r-meta { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; font-family: 'JetBrains Mono', monospace; }
.r-acts { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* ── Checkbox label (.ck-label) ─────────────── */
.ck-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  user-select: none;
}
.ck-label input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.ck-label:hover { color: var(--text); }

/* ── CRITICAL FIXES ──────────────────────────── */

/* Tool page wrapper - ensure proper padding on t-wrap section */
.t-wrap > * + * { margin-top: 0; }

/* result-card full reset - no float/overflow issues */
.result-card {
  background: linear-gradient(135deg, rgba(64,200,112,.08) 0%, rgba(64,200,112,.02) 100%) !important;
  border: 1px solid rgba(64,200,112,.3) !important;
  border-radius: var(--radius-lg) !important;
  padding: 22px 24px !important;
  margin-top: 20px !important;
  display: block !important;
  width: 100% !important;
  box-sizing: border-box !important;
}
.result-hd { display: flex !important; align-items: center !important; gap: 12px !important; margin-bottom: 6px !important; }
.r-ttl { font-family: 'Syne', sans-serif !important; font-weight: 700 !important; font-size: 18px !important; color: var(--success) !important; }
.r-meta { font-size: 13px !important; color: var(--text-muted) !important; margin-bottom: 14px !important; font-family: 'JetBrains Mono', monospace !important; }
.r-acts { display: flex !important; gap: 10px !important; flex-wrap: wrap !important; margin-top: 14px !important; }

/* Fix .card when it contains result-card (no double border) */
.card > .result-card { margin-top: 16px; }

/* Fix field inputs that don't have class="tool-input" (older blades use bare inputs) */
.field input:not([type=color]):not([type=range]):not([type=checkbox]):not([type=radio]),
.field select,
.field textarea {
  width: 100%;
  background: var(--surface2) !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  padding: 11px 13px !important;
  color: var(--text) !important;
  font-family: inherit !important;
  font-size: 14px !important;
  outline: none !important;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-dim) !important;
}

/* btn-primary / btn-secondary already defined, make sure they cascade */
.btn.btn-primary   { background: var(--accent) !important; color: #fff !important; }
.btn.btn-secondary { background: var(--surface2) !important; color: var(--text) !important; border: 1px solid var(--border) !important; }
.btn.btn-danger    { background: var(--danger) !important; color: #fff !important; }

/* alert classes (used in tools) */
.alert-error  { background: var(--danger-dim)  !important; border: 1px solid rgba(224,64,64,.3)   !important; color: #f08080 !important; border-radius: 9px !important; padding: 12px 16px !important; font-size: 13px !important; margin-top: 12px !important; }
.alert-success{ background: var(--success-dim) !important; border: 1px solid rgba(64,200,112,.3)  !important; color: var(--success) !important; border-radius: 9px !important; padding: 12px 16px !important; font-size: 13px !important; margin-top: 12px !important; }
.alert-info   { background: rgba(64,160,224,.08) !important; border: 1px solid rgba(64,160,224,.3) !important; color: #80c0f0 !important; border-radius: 9px !important; padding: 12px 16px !important; font-size: 13px !important; margin-top: 12px !important; }
.alert-warn   { background: rgba(224,160,64,.08) !important; border: 1px solid rgba(224,160,64,.3) !important; color: var(--warning) !important; border-radius: 9px !important; padding: 12px 16px !important; font-size: 13px !important; margin-top: 12px !important; }

/* Ensure tool_content section has proper spacing */
#tool-content-area, .t-wrap { padding-bottom: 16px; }
