/* Free tools section: /tools hub and /tools/<slug> pages */

/* ── Hub ─────────────────────────────────── */
.tl-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.tl-filter { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; margin-bottom: 2.5rem; }
.tl-chip { font: 600 0.88rem/1 'Inter', sans-serif; color: var(--text); background: #fff; border: 1px solid rgba(110,110,110,0.25); border-radius: 50px; padding: 0.7rem 1.25rem; cursor: pointer; transition: all 0.2s; }
.tl-chip:hover { border-color: var(--primary); color: var(--primary); }
.tl-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.tl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 1.25rem; }
.tl-card { position: relative; display: flex; flex-direction: column; gap: 0.6rem; padding: 1.6rem; background: #fff; border: 1px solid #E5E5E5; border-radius: 18px; text-decoration: none; color: var(--text); transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s; }
.tl-card[hidden] { display: none; }
.tl-card:hover { transform: translateY(-4px); border-color: rgba(227,30,36,0.45); box-shadow: 0 18px 40px rgba(0,0,0,0.08); }
.tl-card-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: rgba(227,30,36,0.08); color: var(--primary); }
.tl-card-ic svg { width: 24px; height: 24px; }
.tl-card-cat { font: 700 0.72rem/1 'Inter', sans-serif; letter-spacing: 1.5px; text-transform: uppercase; color: #6B6B6B; margin-top: 0.4rem; }
.tl-card-name { font: 800 1.12rem/1.3 'Sora', sans-serif; margin: 0; }
.tl-card p { font-size: 0.92rem; line-height: 1.65; color: #5E5E5E; margin: 0; flex: 1; }
.tl-card-go { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 700; font-size: 0.88rem; color: var(--primary); margin-top: 0.4rem; }
.tl-card:hover .tl-card-go svg { transform: translateX(3px); }
.tl-card-go svg { transition: transform 0.2s; }
.tl-all { text-align: center; margin-top: 2.25rem; }

/* ── Tool page ───────────────────────────── */
.tl-app-sec { padding: 3rem 0 1rem; }
.tl-app { max-width: 1280px; margin: 0 auto; background: #fff; border: 1px solid #E5E5E5; border-radius: 22px; box-shadow: 0 20px 60px rgba(0,0,0,0.07); padding: clamp(1.1rem, 3vw, 2.25rem); }
.tl-private { max-width: 1280px; margin: 1rem auto 0; display: flex; align-items: center; justify-content: center; gap: 0.5rem; font-size: 0.86rem; color: #5E5E5E; text-align: center; }
.tl-private svg { width: 15px; height: 15px; flex-shrink: 0; color: #1F7A4A; }

.tl-steps { counter-reset: tls; list-style: none; padding: 0; margin: 0 0 2.5rem; display: grid; gap: 0.9rem; }
.tl-steps li { counter-increment: tls; position: relative; padding-left: 3rem; font-size: 1.02rem; line-height: 1.75; color: #4A4A4A; }
.tl-steps li::before { content: counter(tls); position: absolute; left: 0; top: 0.1rem; width: 2rem; height: 2rem; border-radius: 50%; background: var(--primary); color: #fff; font: 700 0.9rem/2rem 'Sora', sans-serif; text-align: center; }
.wc-intro .tl-steps { margin: 1.75rem 0 0; }
.tl-side { display: grid; gap: 1.25rem; }
.tl-why-h { font: 800 1.35rem/1.3 'Sora', sans-serif; margin: 0 0 0.9rem; }
.tl-why p { font-size: 1rem !important; line-height: 1.8 !important; color: #4A4A4A !important; margin: 0 0 0.9rem !important; }
.tl-why p:last-child { margin-bottom: 0 !important; }
.wc-card p a { color: var(--primary); font-weight: 600; text-decoration: none; }
.wc-card p a:hover { text-decoration: underline; }
.tl-guides { list-style: none; margin: 0.25rem 0 0; padding: 0; display: grid; gap: 0.2rem; }
.tl-guides a { display: flex; justify-content: space-between; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid #EEE; color: var(--text); font-weight: 600; font-size: 0.95rem; text-decoration: none; transition: color 0.2s; }
.tl-guides li:last-child a { border-bottom: 0; }
.tl-guides a span { color: var(--primary); }
.tl-guides a:hover { color: var(--primary); }

/* ── Tool widgets ────────────────────────── */
.tl-app [hidden] { display: none !important; }
.tl-app :where(h2, h3) { font-family: 'Sora', sans-serif; }
.tl-app h2.tl-panel-title { font-size: 1.05rem; font-weight: 800; margin: 0 0 0.9rem; }
.tl-drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.4rem; text-align: center; padding: 2.4rem 1rem; border: 2px dashed rgba(110,110,110,0.35); border-radius: 18px; background: #FAFAFA; cursor: pointer; transition: border-color 0.2s, background 0.2s; }
.tl-drop:hover, .tl-drop.is-over { border-color: var(--primary); background: #FFF6F6; }
.tl-drop:focus-within { outline: 2px solid var(--primary); outline-offset: 3px; }
.tl-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.tl-drop svg { width: 40px; height: 40px; color: var(--primary); }
.tl-drop b { font: 700 1.05rem/1.4 'Sora', sans-serif; color: var(--text); }
.tl-drop span { font-size: 0.86rem; color: #5E5E5E; }

.tl-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; }
.tl-row + .tl-row, .tl-drop + .tl-row, .tl-row + .tl-out, .tl-drop + .tl-out { margin-top: 1.25rem; }
.tl-field { display: flex; flex-direction: column; gap: 0.4rem; flex: 1 1 180px; min-width: 0; }
.tl-field.grow2 { flex-grow: 2; }
.tl-field > label, .tl-label { font: 600 0.84rem/1.3 'Inter', sans-serif; color: #3A3A3A; }
.tl-hint { font-size: 0.78rem; color: #6B6B6B; }
.tl-input, .tl-app select, .tl-app textarea { width: 100%; font: 400 0.95rem/1.4 'Inter', sans-serif; color: var(--text); background: #fff; border: 1px solid #D6D6D6; border-radius: 12px; padding: 0.75rem 0.9rem; transition: border-color 0.2s, box-shadow 0.2s; }
.tl-app textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.tl-input:focus, .tl-app select:focus, .tl-app textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(227,30,36,0.15); }
.tl-app input[type=range] { width: 100%; accent-color: var(--primary); }
.tl-app input[type=checkbox], .tl-app input[type=radio] { accent-color: var(--primary); width: 1.05rem; height: 1.05rem; }
.tl-app input[type=color] { width: 3rem; height: 2.9rem; padding: 0.2rem; border: 1px solid #D6D6D6; border-radius: 12px; background: #fff; cursor: pointer; flex-shrink: 0; }
.tl-check { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.92rem; color: #3A3A3A; cursor: pointer; }
.tl-checks { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; }
.tl-color { display: flex; gap: 0.5rem; align-items: center; }

.tl-seg { display: inline-flex; flex-wrap: wrap; background: #F2F2F2; border-radius: 12px; padding: 4px; gap: 4px; }
.tl-seg button { font: 600 0.86rem/1 'Inter', sans-serif; border: 0; background: transparent; color: #3A3A3A; padding: 0.65rem 1rem; border-radius: 9px; cursor: pointer; }
.tl-seg button[aria-pressed=true] { background: #fff; color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

.tl-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; font: 700 0.9rem/1 'Inter', sans-serif; padding: 0.85rem 1.4rem; border-radius: 50px; border: 1px solid var(--primary); background: var(--primary); color: #fff; cursor: pointer; text-decoration: none; transition: transform 0.2s, box-shadow 0.2s, background 0.2s; white-space: nowrap; }
.tl-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(227,30,36,0.28); }
.tl-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.tl-btn.ghost { background: #fff; color: var(--text); border-color: #D6D6D6; }
.tl-btn.ghost:hover { border-color: var(--primary); color: var(--primary); box-shadow: none; }
.tl-btn.sm { padding: 0.6rem 1rem; font-size: 0.82rem; }
.tl-btn svg { width: 16px; height: 16px; }

.tl-out { border-top: 1px solid #EEE; padding-top: 1.25rem; }
.tl-out[hidden] { display: none; }
.tl-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.tl-actions + * { margin-top: 1rem; }

.tl-files { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.tl-file { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 1rem; align-items: center; padding: 0.75rem; border: 1px solid #EEE; border-radius: 14px; background: #FCFCFC; }
.tl-file img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; background: #EEE; }
.tl-file-name { font-weight: 600; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-file-meta { font-size: 0.82rem; color: #5E5E5E; margin-top: 0.2rem; }
.tl-save { font-weight: 700; color: #1F7A4A; }
.tl-save.neg { color: #A35A00; }
@media (max-width: 560px) { .tl-file { grid-template-columns: 48px minmax(0, 1fr); } .tl-file img { width: 48px; height: 48px; } .tl-file .tl-btn { grid-column: 1 / -1; } }

.tl-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0.75rem; }
.tl-stat { background: #FAFAFA; border: 1px solid #EEE; border-radius: 14px; padding: 0.9rem 1rem; }
.tl-stat b { display: block; font: 800 1.5rem/1.15 'Sora', sans-serif; font-variant-numeric: tabular-nums; }
.tl-stat span { font-size: 0.8rem; color: #5E5E5E; }

.tl-meter { display: grid; gap: 0.35rem; }
.tl-meter-top { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.84rem; color: #3A3A3A; }
.tl-meter-top b { font-variant-numeric: tabular-nums; }
.tl-bar { height: 8px; border-radius: 8px; background: #EEE; overflow: hidden; }
.tl-bar i { display: block; height: 100%; width: 0; border-radius: 8px; background: #1F7A4A; transition: width 0.25s, background 0.25s; }
.tl-bar i.warn { background: #D98A00; }
.tl-bar i.bad { background: var(--primary); }

.tl-code { position: relative; }
.tl-code pre { margin: 0; background: #141414; color: #EDEDED; border-radius: 14px; padding: 1.1rem 1.1rem 1.1rem; font: 500 0.82rem/1.65 ui-monospace, Consolas, monospace; overflow-x: auto; white-space: pre-wrap; word-break: break-all; max-height: 420px; }
.tl-code .tl-copy { position: absolute; top: 0.6rem; right: 0.6rem; }
.tl-copy { font: 600 0.78rem/1 'Inter', sans-serif; padding: 0.5rem 0.8rem; border-radius: 8px; border: 1px solid rgba(255,255,255,0.25); background: rgba(255,255,255,0.1); color: #fff; cursor: pointer; }
.tl-copy:hover { background: rgba(255,255,255,0.2); }
.tl-copy.light { border-color: #D6D6D6; background: #fff; color: var(--text); }
.tl-copy.light:hover { border-color: var(--primary); color: var(--primary); }

.tl-badge { display: inline-flex; align-items: center; gap: 0.3rem; font: 700 0.74rem/1 'Inter', sans-serif; letter-spacing: 0.5px; padding: 0.4rem 0.6rem; border-radius: 6px; }
.tl-badge.ok { color: #1F7A4A; background: #E6F4EC; }
.tl-badge.bad { color: #B3161B; background: #FDEAEA; }
.tl-badge.warn { color: #8A4B00; background: #FFF2DF; }

.tl-grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 820px) { .tl-grid2 { grid-template-columns: minmax(0, 1fr); } }
.tl-panel { background: #FAFAFA; border: 1px solid #EEE; border-radius: 16px; padding: 1.1rem; }
.tl-checker { background-image: linear-gradient(45deg, #EEE 25%, transparent 25%), linear-gradient(-45deg, #EEE 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #EEE 75%), linear-gradient(-45deg, transparent 75%, #EEE 75%); background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; }
.tl-canvas-wrap { display: grid; place-items: center; border-radius: 14px; overflow: hidden; min-height: 200px; padding: 1rem; }
.tl-canvas-wrap canvas, .tl-canvas-wrap img { max-width: 100%; height: auto; display: block; box-shadow: 0 6px 20px rgba(0,0,0,0.12); }
.tl-msg { font-size: 0.88rem; padding: 0.75rem 1rem; border-radius: 12px; background: #FFF2DF; color: #6B3A00; }
.tl-msg[hidden] { display: none; }
.tl-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0; background: #141414; color: #fff; font: 600 0.88rem/1 'Inter', sans-serif; padding: 0.85rem 1.25rem; border-radius: 50px; z-index: 3000; transition: opacity 0.2s, transform 0.2s; pointer-events: none; }
.tl-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
