/* ==========================================================================
   DocsDown — tools.css
   Shared styling for /tools/ hub + all /tools/{slug}/ pages.
   ========================================================================== */

.tl-wrap { max-width: 1000px; margin: 0 auto; padding: 0 1.25rem; }

/* --- Hero --- */
.tl-hero {
  position: relative;
  background:
    radial-gradient(900px 300px at 12% -35%, rgba(56,189,248,0.2), transparent 60%),
    radial-gradient(800px 280px at 88% 0%, rgba(168,85,247,0.16), transparent 62%),
    linear-gradient(140deg, #070f1f 0%, #0d2242 55%, #13386e 100%);
  color: #fff;
  padding: 3rem 0 3.25rem;
  text-align: center;
  overflow: hidden;
}
.tl-hero::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.055) 1px, transparent 1px);
  background-size: 22px 22px; opacity: .5; pointer-events: none;
}
.tl-hero .tl-wrap { position: relative; z-index: 1; }
.tl-hero h1 { font-size: clamp(1.7rem, 4.2vw, 2.55rem); font-weight: 800; letter-spacing: -0.025em; line-height: 1.12; margin: 0.7rem 0 0.7rem; }
.tl-hero p { color: rgba(255,255,255,0.83); max-width: 680px; margin: 0 auto; font-size: 1rem; }
.tl-pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.73rem; font-weight: 700;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.18);
  color: #dbeafe; padding: 0.3rem 0.8rem; border-radius: 999px; backdrop-filter: blur(6px);
}

/* --- Breadcrumb --- */
.tl-breadcrumb { background: #fff; border-bottom: 1px solid #e8eaed; }
.tl-breadcrumb .tl-wrap {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem;
  padding: 0.62rem 1.25rem; font-size: 0.86rem; color: #5f6368;
}
.tl-breadcrumb a { color: #1a73e8; text-decoration: none; font-weight: 600; }
.tl-breadcrumb a:hover { text-decoration: underline; }
.tl-breadcrumb .sep { color: #94a3b8; font-size: 0.72rem; }
.tl-breadcrumb .current { color: #202124; font-weight: 700; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tl-main { padding: 2rem 0 3rem; }

/* --- Grid + cards --- */
.tl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.9rem; }
.tl-grid-related { margin-top: 1rem; }
.tl-card {
  display: flex; flex-direction: column; gap: 0.3rem;
  padding: 1.1rem 1.15rem;
  background: #fff; border: 1px solid #e6ecf5; border-radius: 16px;
  text-decoration: none; color: #16233a;
  transition: border-color .16s, box-shadow .18s, transform .16s;
}
.tl-card:hover { border-color: #1a73e8; box-shadow: 0 12px 28px rgba(26,115,232,0.13); transform: translateY(-3px); }
.tl-card-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.35rem; }
.tl-card-ico { font-size: 1.45rem; line-height: 1; }
.tl-card-name { font-weight: 800; font-size: 1rem; letter-spacing: -0.01em; }
.tl-card-desc { font-size: 0.83rem; color: #64748b; line-height: 1.5; }
.tl-card-go { margin-top: 0.5rem; font-size: 0.8rem; font-weight: 800; color: #1a73e8; }
.tl-badge {
  font-size: 0.6rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0.14rem 0.45rem; border-radius: 999px; white-space: nowrap;
}
.tl-badge-convert { background: #e0edff; color: #1a56c4; }
.tl-badge-optimize { background: #dcfce7; color: #15803d; }
.tl-badge-edit { background: #fef3c7; color: #b45309; }
.tl-badge-create { background: #f3e8ff; color: #7e22ce; }
.tl-badge-privacy { background: #ffe4e6; color: #be123c; }

/* --- Sections --- */
.tl-sec { margin: 2.75rem 0 0; }
.tl-sec h2 { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.015em; margin: 0 0 0.8rem; color: #16233a; }
.tl-sec p { color: #3f4a5a; line-height: 1.75; font-size: 0.95rem; margin: 0 0 0.85rem; }

/* --- Steps --- */
.tl-steps { counter-reset: tl; list-style: none; margin: 0.6rem 0 0; padding: 0; display: grid; gap: 0.8rem; }
.tl-steps li {
  counter-increment: tl; position: relative;
  background: #fff; border: 1px solid #e6ecf5; border-radius: 14px;
  padding: 1rem 1.1rem 1rem 3.5rem;
}
.tl-steps li::before {
  content: counter(tl); position: absolute; left: 1rem; top: 1rem;
  width: 1.75rem; height: 1.75rem; border-radius: 50%;
  background: linear-gradient(135deg, #1a73e8, #60a5fa); color: #fff;
  font-weight: 800; font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center;
}
.tl-steps b { display: block; color: #16233a; font-size: 0.97rem; margin-bottom: 0.25rem; }
.tl-steps p { margin: 0; font-size: 0.9rem; color: #566274; }

/* --- FAQ --- */
.tl-faq details { background: #fff; border: 1px solid #e6ecf5; border-radius: 13px; padding: 0.95rem 1.15rem; margin-bottom: 0.55rem; }
.tl-faq summary { cursor: pointer; font-weight: 700; color: #16233a; font-size: 0.95rem; list-style: none; display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.tl-faq summary::-webkit-details-marker { display: none; }
.tl-faq summary::after { content: "+"; color: #1a73e8; font-weight: 800; font-size: 1.15rem; }
.tl-faq details[open] summary::after { content: "−"; }
.tl-faq p { color: #566274; font-size: 0.92rem; line-height: 1.7; margin: 0.65rem 0 0; }

/* ===================== SHARED TOOL UI PRIMITIVES ===================== */
.tl-tool {
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  border: 1px solid #e6ecf5; border-radius: 20px; padding: 1.5rem;
  margin-top: -3rem; position: relative; z-index: 2;
  box-shadow: 0 18px 45px rgba(15,34,66,0.1), 0 2px 6px rgba(15,34,66,0.05);
}

.tt-drop {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.3rem; text-align: center;
  border: 2px dashed #c3d4ee; border-radius: 16px; background: #f8fbff;
  padding: 2.25rem 1.25rem; cursor: pointer; overflow: hidden;
  transition: border-color .18s, background .18s, transform .18s, box-shadow .18s;
}
.tt-drop * { pointer-events: none; }
.tt-drop-btn, .tt-drop-ico, .tt-drop strong, .tt-drop small { pointer-events: none; }
.tt-drop:hover, .tt-drop.drag { border-color: #1a73e8; background: #f0f7ff; transform: translateY(-2px); box-shadow: 0 10px 28px rgba(26,115,232,0.14); }
.tt-drop-ico { font-size: 2.4rem; line-height: 1; }
.tt-drop strong { font-size: 1.05rem; color: #16233a; font-weight: 800; }
.tt-drop small { color: #64748b; font-size: 0.84rem; }
.tt-drop-btn {
  margin-top: 0.85rem;
  display: inline-block;
  background: linear-gradient(135deg, #1a73e8, #0d5bbd);
  color: #fff; font-weight: 800; font-size: 0.9rem;
  padding: 0.7rem 1.5rem; border-radius: 11px;
  box-shadow: 0 8px 20px rgba(26,115,232,0.28);
  transition: box-shadow .16s, transform .12s;
}
.tt-drop:hover .tt-drop-btn { box-shadow: 0 12px 26px rgba(26,115,232,0.4); transform: translateY(-1px); }
.tt-drop:focus-visible { outline: 3px solid rgba(26,115,232,0.5); outline-offset: 3px; }
.tt-drop input[type="file"] { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none !important; }

.tt-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.9rem; margin-top: 1.1rem; padding: 1.1rem 1.2rem; background: #fff; border: 1px solid #e9eef6; border-radius: 15px; }
.tt-ctrl label { display: block; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: #7b8794; margin-bottom: 0.38rem; }
.tt-ctrl select, .tt-ctrl input[type=text], .tt-ctrl input[type=number], .tt-ctrl input[type=color] {
  width: 100%; padding: 0.66rem 0.8rem;
  border: 1.5px solid #dfe6f0; border-radius: 11px;
  font-size: 0.93rem; color: #16233a; background: #fbfdff;
  transition: border-color .15s, box-shadow .15s;
}
.tt-ctrl input[type=color] { padding: 0.2rem; height: 42px; cursor: pointer; }
.tt-ctrl input[type=file] { width: 100%; padding: 0.5rem; border: 1.5px dashed #c3d4ee; border-radius: 11px; background: #f8fbff; font-size: 0.82rem; color: #566274; cursor: pointer; }
.tt-ctrl input[type=file]::file-selector-button { margin-right: 0.6rem; padding: 0.4rem 0.8rem; border: none; border-radius: 8px; background: #1a73e8; color: #fff; font-weight: 700; font-size: 0.8rem; cursor: pointer; }
.tt-ctrl input[type=file]::file-selector-button:hover { background: #0d5bbd; }
.tt-ctrl select:focus, .tt-ctrl input:focus { outline: none; border-color: #1a73e8; box-shadow: 0 0 0 4px rgba(26,115,232,0.13); background: #fff; }
.tt-range { display: flex; align-items: center; gap: 0.8rem; }
.tt-range input[type=range] { -webkit-appearance: none; appearance: none; flex: 1; height: 6px; border-radius: 999px; background: linear-gradient(90deg, #1a73e8, #60a5fa); outline: none; }
.tt-range input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 3px solid #1a73e8; box-shadow: 0 2px 6px rgba(26,115,232,0.35); cursor: pointer; }
.tt-range input[type=range]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 3px solid #1a73e8; cursor: pointer; }
.tt-range span { font-weight: 800; color: #1a73e8; min-width: 46px; text-align: right; font-variant-numeric: tabular-nums; }

.tt-btns { display: flex; flex-wrap: wrap; gap: 0.65rem; align-items: center; margin-top: 1.25rem; }
.tt-btn {
  border: none; border-radius: 12px; padding: 0.85rem 1.5rem;
  font-weight: 800; font-size: 0.95rem; cursor: pointer; white-space: nowrap;
  transition: transform .12s, box-shadow .16s, background .16s;
}
.tt-btn:active { transform: scale(0.98); }
.tt-btn:disabled { opacity: .55; cursor: not-allowed; }
.tt-btn-primary { background: linear-gradient(135deg, #1a73e8, #0d5bbd); color: #fff; box-shadow: 0 8px 22px rgba(26,115,232,0.3); }
.tt-btn-primary:not(:disabled):hover { box-shadow: 0 12px 28px rgba(26,115,232,0.42); }
.tt-btn-green { background: linear-gradient(135deg, #10b981, #059669); color: #fff; box-shadow: 0 8px 22px rgba(16,185,129,0.28); }
.tt-btn-ghost { background: #fff; color: #16233a; border: 1.5px solid #dfe6f0; }
.tt-btn-ghost:hover { border-color: #1a73e8; color: #1a73e8; }
.tt-btn-sm { padding: 0.5rem 0.95rem; font-size: 0.82rem; border-radius: 10px; }

.tt-preview { position: relative; margin-top: 1.15rem; text-align: center; background: #f4f7fc repeating-conic-gradient(#e9eef6 0% 25%, #f7fafd 0% 50%) 50% / 18px 18px; border: 1px solid #e6ecf5; border-radius: 14px; padding: 1rem; overflow: hidden; }
.tt-preview img, .tt-preview canvas { max-width: 100%; height: auto; display: block; margin: 0 auto; border-radius: 8px; }

.tt-list { display: flex; flex-direction: column; gap: 0.65rem; margin-top: 1.15rem; }
.tt-item { display: grid; grid-template-columns: 60px 1fr auto; align-items: center; gap: 0.9rem; background: #fff; border: 1px solid #e9eef6; border-radius: 13px; padding: 0.75rem 0.95rem; }
.tt-thumb { width: 60px; height: 60px; object-fit: cover; border-radius: 9px; background: #eef2f8; border: 1px solid #e6ecf5; }
.tt-meta { min-width: 0; }
.tt-name { font-weight: 700; font-size: 0.92rem; color: #16233a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-detail { font-size: 0.81rem; color: #64748b; margin-top: 0.22rem; }
.tt-detail b { color: #059669; }
.tt-actions { display: flex; flex-direction: column; gap: 0.4rem; align-items: flex-end; }

.tt-note { text-align: center; color: #64748b; font-size: 0.82rem; margin: 1rem 0 0; }
.tt-error { color: #dc2626; font-size: 0.88rem; margin-top: 0.75rem; }
.tt-hint { color: #64748b; font-size: 0.82rem; margin-top: 0.5rem; }
.tt-badge-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.85rem; }
.tt-stat { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; font-weight: 700; background: #eef4ff; color: #1a56c4; border-radius: 999px; padding: 0.28rem 0.7rem; }
.tt-stat-green { background: #e8f9ef; color: #15803d; }

.tt-progress { height: 8px; border-radius: 999px; background: #e9eef6; overflow: hidden; margin-top: 1rem; }
.tt-progress > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #1a73e8, #60a5fa); transition: width .25s; }

@media (max-width: 640px) {
  .tl-tool { padding: 1.1rem; border-radius: 16px; margin-top: -2rem; }
  .tt-item { grid-template-columns: 52px 1fr; }
  .tt-actions { grid-column: 1 / -1; flex-direction: row; justify-content: flex-end; }
  .tt-btn { width: 100%; }
}

.tl-sec { content-visibility: auto; contain-intrinsic-size: auto 500px; }
@media (pointer: coarse) {
  .tl-card { min-height: 44px; }
}
.tl-calc-box { display: grid; gap: 0.9rem; }
.tl-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
.tl-3col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.9rem; }
@media (max-width: 640px) { .tl-2col, .tl-3col { grid-template-columns: 1fr; } }
.tl-f { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.tl-f span { font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.tl-in { width: 100%; padding: 0.8rem 1rem; font-size: 1.1rem; border-radius: 10px; border: 1px solid var(--input-border, #d1d5db); background: var(--bg, #fff); color: var(--text); font-weight: 600; outline: none; box-sizing: border-box; }
.tl-in:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,115,232,0.15); }
.tl-res { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 12px; padding: 1rem 1.25rem; display: grid; gap: 0.4rem; }
.tl-res:empty { display: none; }
.tl-res-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; font-size: 0.95rem; }
.tl-res-row b { font-size: 1.05rem; color: #166534; }
.tl-big { font-size: 1.6rem; font-weight: 800; text-align: center; padding: 0.4rem 0 0.2rem; }
.tl-big small { font-size: 0.9rem; font-weight: 600; color: var(--muted); }
