/* Free tools (/tools): hub and tool pages. Built on the site theme variables in styles.css
   and the card language of /ourapps (gradient cards, 24px radius, soft lift on hover). */

/* ---------- Base ---------- */
.tl-page { position: relative; overflow: hidden; }
.tl-page::before {
  content: ''; position: absolute; inset: -20% -10% auto -10%; height: 900px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 50% at 18% 20%, rgba(90, 210, 255, 0.16), transparent 70%),
    radial-gradient(50% 45% at 85% 10%, rgba(168, 85, 247, 0.12), transparent 70%);
}

/* ---------- Hero ---------- */
.tl-hero { padding: 8rem 0 2.5rem; }
.tl-hero-grid { display: grid; gap: 2.5rem; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; }
.tl-crumbs { font-size: 0.85rem; color: var(--text-muted); margin: 0 0 1.25rem; display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.tl-crumbs a { color: var(--text-muted); text-decoration: none; }
.tl-crumbs a:hover { color: var(--accent-soft); }
.tl-crumbs span[aria-current] { color: var(--text-soft); }
.tl-kicker {
  display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.85rem; border-radius: var(--radius-pill);
  background: rgba(90, 210, 255, 0.08); border: 1px solid var(--border-bright); color: var(--accent-soft);
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; margin: 0 0 1rem;
}
.tl-kicker::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.tl-h1 { margin: 0 0 1rem; color: var(--text); font-size: clamp(2.1rem, 4.6vw, 3.4rem); line-height: 1.05; font-weight: 700; letter-spacing: -0.03em; max-width: 18ch; }
.tl-h1 em { font-style: normal; background: var(--accent-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tl-lead { margin: 0 0 1.5rem; max-width: 40rem; color: var(--text-soft); font-size: 1.1rem; line-height: 1.65; }
.tl-hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.tl-hero-meta { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin: 1.25rem 0 0; color: var(--text-muted); font-size: 0.9rem; }
.tl-hero-meta span::before { content: '✓  '; color: var(--green-accent); }

/* Screenshot preview frame (used in heroes and hub cards) */
.tl-shot {
  position: relative; border-radius: var(--radius-lg); overflow: hidden; background: #050814;
  border: 1px solid rgba(90, 210, 255, 0.16); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 80px rgba(90, 210, 255, 0.08);
  aspect-ratio: 16 / 10;
}
.tl-shot img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.tl-shot-wide { aspect-ratio: 1.91 / 1; }
.tl-shot::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(5, 8, 20, 0.55)); pointer-events: none; }

/* ---------- Sections ---------- */
.tl-section { padding: 3rem 0; }
.tl-section.alt { background: linear-gradient(180deg, rgba(10, 15, 31, 0.6), rgba(5, 8, 20, 0.2)); border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle); }
.tl-h2 { margin: 0 0 0.6rem; color: var(--text); font-size: clamp(1.5rem, 2.8vw, 2rem); line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; }
.tl-h3 { margin: 0 0 0.4rem; color: var(--text); font-size: 1.1rem; font-weight: 600; }
.tl-sub { margin: 0 0 2rem; color: var(--text-muted); max-width: 42rem; line-height: 1.6; }
.tl-p { margin: 0 0 1rem; color: var(--text-soft); line-height: 1.7; }
.tl-muted { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; }

/* ---------- Tool panels ---------- */
.tl-panel {
  background: linear-gradient(160deg, rgba(22, 32, 62, 0.75), rgba(10, 15, 34, 0.94));
  border: 1px solid rgba(90, 210, 255, 0.12); border-radius: var(--radius-lg); padding: 1.75rem;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.3);
}
.tl-panel + .tl-panel { margin-top: 1.25rem; }
.tl-panel-title { margin: 0 0 0.25rem; color: var(--text); font-size: 1.15rem; font-weight: 600; display: flex; align-items: center; gap: 0.6rem; }
.tl-panel-title .n { display: inline-grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 10px; background: rgba(90, 210, 255, 0.12); color: var(--accent); font-size: 0.9rem; flex: none; }
.tl-panel-sub { margin: 0 0 1.25rem; color: var(--text-muted); font-size: 0.92rem; line-height: 1.55; }
.tl-grid { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); align-items: start; }
.tl-stack { display: grid; gap: 1rem; }
.tl-row { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.tl-row > .tl-input { flex: 1 1 240px; }

.tl-field { display: grid; gap: 0.45rem; margin: 0 0 1.1rem; }
.tl-field label, .tl-label { color: var(--text-soft); font-size: 0.92rem; font-weight: 500; }
.tl-input, .tl-select, .tl-textarea {
  width: 100%; box-sizing: border-box; background: rgba(5, 8, 20, 0.6); color: var(--text);
  border: 1px solid var(--border-medium); border-radius: 14px; padding: 0.8rem 0.95rem;
  font: inherit; font-size: 16px; /* 16px stops iOS zooming into the field */
  min-height: 48px; transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
  -webkit-appearance: none; appearance: none;
}
.tl-select { background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%), linear-gradient(135deg, var(--accent) 50%, transparent 50%); background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 2.4rem; }
.tl-textarea { min-height: 8rem; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; line-height: 1.5; }
.tl-input:focus, .tl-select:focus, .tl-textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(90, 210, 255, 0.16); background: rgba(5, 8, 20, 0.85); }
.tl-hint { color: var(--text-muted); font-size: 0.84rem; line-height: 1.55; }

/* Sliders */
.tl-slider { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem 1rem; align-items: center; margin: 0 0 1.2rem; }
.tl-slider label { color: var(--text-soft); font-size: 0.92rem; font-weight: 500; grid-column: 1 / -1; }
.tl-slider input[type=range] { width: 100%; accent-color: var(--accent); min-height: 32px; }
.tl-slider output { min-width: 6.5rem; text-align: right; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; background: rgba(90, 210, 255, 0.08); border: 1px solid var(--border-bright); border-radius: 10px; padding: 0.35rem 0.6rem; }

/* Buttons (site classes, with bigger touch targets on phones) */
.tl-btn { cursor: pointer; min-height: 46px; }
.tl-btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.tl-cta { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.5rem; }

/* Results */
.tl-result { background: rgba(5, 8, 20, 0.55); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 1.2rem; }
.tl-kpis { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 0 0 1.1rem; }
.tl-kpi { background: linear-gradient(160deg, rgba(90, 210, 255, 0.08), rgba(5, 8, 20, 0.4)); border: 1px solid var(--border-bright); border-radius: var(--radius-md); padding: 1rem 1.05rem; }
.tl-kpi .v { display: block; color: var(--text); font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.tl-kpi .k { display: block; color: var(--text-muted); font-size: 0.82rem; margin-top: 0.25rem; line-height: 1.4; }

.tl-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-sm); }
.tl-table { width: 100%; border-collapse: collapse; font-size: 0.93rem; min-width: 320px; }
.tl-table th, .tl-table td { text-align: left; padding: 0.7rem 0.6rem; border-bottom: 1px solid var(--border-subtle); color: var(--text-soft); vertical-align: top; }
.tl-table th { color: var(--text-muted); font-weight: 500; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.03em; }
.tl-table td.num, .tl-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tl-table tr:last-child td { border-bottom: 0; }

.tl-badge { display: inline-block; padding: 0.2rem 0.65rem; border-radius: var(--radius-pill); font-size: 0.78rem; font-weight: 600; white-space: nowrap; }
.tl-badge.ok { background: rgba(16, 185, 129, 0.14); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.4); }
.tl-badge.warn { background: rgba(251, 191, 36, 0.12); color: #fde68a; border: 1px solid rgba(251, 191, 36, 0.4); }
.tl-badge.bad { background: rgba(248, 113, 113, 0.12); color: #fca5a5; border: 1px solid rgba(248, 113, 113, 0.4); }
.tl-badge.info { background: rgba(90, 210, 255, 0.1); color: var(--accent-soft); border: 1px solid var(--border-bright); }

.tl-status { min-height: 1.4rem; color: var(--text-muted); font-size: 0.92rem; margin: 0.6rem 0 0; line-height: 1.5; }
.tl-status.err { color: #fca5a5; }
.tl-status.ok { color: #6ee7b7; }

pre.tl-code { background: rgba(5, 8, 20, 0.7); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 1rem 1.1rem; overflow: auto; color: var(--text-soft); font-size: 0.86rem; line-height: 1.6; white-space: pre; margin: 0; max-height: 420px; }

/* Bars */
.tl-bar { display: flex; height: 2.6rem; border-radius: 14px; overflow: hidden; border: 1px solid var(--border-subtle); background: rgba(5, 8, 20, 0.6); }
.tl-bar > div { display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 600; color: #050814; min-width: 0; overflow: hidden; white-space: nowrap; }
.tl-legend { display: flex; flex-wrap: wrap; gap: 0.5rem 1.1rem; margin: 0.7rem 0 0; font-size: 0.86rem; color: var(--text-soft); }
.tl-legend span::before { content: ""; display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 4px; margin-right: 0.45rem; background: var(--sw, var(--accent)); vertical-align: -1px; }

/* Time-zone grid */
.tl-tz-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 0.5rem; }
.tl-tz { display: grid; grid-template-columns: 8.5rem repeat(24, minmax(22px, 1fr)); gap: 3px; align-items: center; font-size: 0.72rem; min-width: 700px; }
.tl-tz .lbl { color: var(--text-soft); font-size: 0.84rem; padding-right: 0.5rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-tz .h { color: var(--text-muted); text-align: center; }
.tl-tz .c { height: 1.9rem; border-radius: 6px; background: rgba(5, 8, 20, 0.7); border: 1px solid var(--border-subtle); }
.tl-tz .c.work { background: rgba(90, 210, 255, 0.2); }
.tl-tz .c.all { background: var(--accent-gradient); border-color: var(--accent); box-shadow: 0 0 12px rgba(90, 210, 255, 0.35); }

/* Drop zone */
.tl-drop { border: 1.5px dashed var(--border-bright); border-radius: var(--radius-md); padding: 2rem 1rem; text-align: center; background: rgba(5, 8, 20, 0.5); cursor: pointer; color: var(--text-soft); transition: border-color var(--transition-fast), background var(--transition-fast); display: block; }
.tl-drop:hover, .tl-drop.over { border-color: var(--accent); background: rgba(90, 210, 255, 0.06); }
.tl-drop input { display: none; }

/* Social previews */
.tl-preview { background: #fff; color: #111; border-radius: 14px; overflow: hidden; border: 1px solid var(--border-medium); font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); }
.tl-preview img { width: 100%; display: block; aspect-ratio: 1.91 / 1; object-fit: cover; background: #e5e7eb; }
.tl-preview .body { padding: 0.75rem 0.9rem; }
.tl-preview .site { font-size: 0.74rem; color: #6b7280; text-transform: uppercase; letter-spacing: 0.02em; }
.tl-preview .ttl { font-size: 0.98rem; font-weight: 600; margin: 0.2rem 0; line-height: 1.3; color: #111; }
.tl-preview .dsc { font-size: 0.85rem; color: #4b5563; line-height: 1.4; }

/* How it works, guide, tips */
.tl-steps { counter-reset: step; list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.tl-steps li { counter-increment: step; position: relative; padding: 1.4rem 1.3rem 1.3rem 4.2rem; color: var(--text-soft); line-height: 1.6; background: linear-gradient(160deg, rgba(22, 32, 62, 0.6), rgba(10, 15, 34, 0.9)); border: 1px solid rgba(90, 210, 255, 0.1); border-radius: var(--radius-md); }
.tl-steps li::before { content: counter(step); position: absolute; left: 1.2rem; top: 1.3rem; width: 2.2rem; height: 2.2rem; border-radius: 12px; background: rgba(90, 210, 255, 0.12); border: 1px solid var(--border-bright); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 0.95rem; }

.tl-guide { display: grid; gap: 1.1rem; max-width: 48rem; }
.tl-guide h3 { margin: 0; color: var(--text); font-size: 1.12rem; font-weight: 600; }
.tl-guide p { margin: 0.4rem 0 0; color: var(--text-soft); line-height: 1.7; }

.tl-tips { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); list-style: none; margin: 0; padding: 0; }
.tl-tips li { padding: 1rem 1.1rem 1rem 2.7rem; position: relative; background: rgba(16, 185, 129, 0.06); border: 1px solid rgba(16, 185, 129, 0.22); border-radius: var(--radius-sm); color: var(--text-soft); line-height: 1.6; font-size: 0.95rem; }
.tl-tips li::before { content: '✓'; position: absolute; left: 1rem; top: 0.95rem; color: var(--green-accent); font-weight: 700; }

.tl-faq { display: grid; gap: 0.75rem; max-width: 52rem; }
.tl-faq details { background: linear-gradient(160deg, rgba(22, 32, 62, 0.6), rgba(10, 15, 34, 0.9)); border: 1px solid rgba(90, 210, 255, 0.1); border-radius: var(--radius-md); padding: 0 1.2rem; transition: border-color var(--transition-fast); }
.tl-faq details[open] { border-color: var(--border-bright); }
.tl-faq summary { cursor: pointer; color: var(--text); font-weight: 600; list-style: none; padding: 1.05rem 0; display: flex; justify-content: space-between; gap: 1rem; align-items: center; min-height: 48px; }
.tl-faq summary::-webkit-details-marker { display: none; }
.tl-faq summary::after { content: '+'; color: var(--accent); font-size: 1.4rem; line-height: 1; font-weight: 400; transition: transform var(--transition-fast); }
.tl-faq details[open] summary::after { transform: rotate(45deg); }
.tl-faq p { margin: 0 0 1.1rem; color: var(--text-soft); line-height: 1.7; }

/* Cards (hub and related tools), styled like /ourapps */
.tl-cards { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.tl-card {
  display: flex; flex-direction: column; gap: 0.9rem; text-decoration: none; color: inherit; position: relative; overflow: hidden;
  background: linear-gradient(160deg, rgba(22, 32, 62, 0.75), rgba(10, 15, 34, 0.92));
  border: 1px solid rgba(90, 210, 255, 0.1); border-radius: 24px; padding: 1.2rem 1.2rem 1.4rem;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2); transition: transform 0.35s cubic-bezier(.4, 0, .2, 1), border-color 0.35s, box-shadow 0.35s;
  animation: tlCardIn 0.5s cubic-bezier(.19, 1, .22, 1) both;
}
.tl-card:nth-child(2) { animation-delay: 0.06s; } .tl-card:nth-child(3) { animation-delay: 0.12s; } .tl-card:nth-child(4) { animation-delay: 0.18s; }
.tl-card:nth-child(5) { animation-delay: 0.24s; } .tl-card:nth-child(6) { animation-delay: 0.3s; } .tl-card:nth-child(n+7) { animation-delay: 0.36s; }
.tl-card:hover, .tl-card:focus-visible { transform: translateY(-4px); border-color: rgba(90, 210, 255, 0.25); box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35), 0 0 40px rgba(90, 210, 255, 0.08); outline: none; }
.tl-card .shot { border-radius: 16px; overflow: hidden; aspect-ratio: 16 / 10; border: 1px solid rgba(255, 255, 255, 0.1); background: #050814; }
.tl-card .shot img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; transition: transform 0.5s ease; }
.tl-card:hover .shot img { transform: scale(1.04); }
.tl-card .group { color: var(--accent); font-size: 0.74rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.tl-card .t { display: block; color: var(--text); font-weight: 650; font-size: 1.12rem; line-height: 1.25; transition: color 0.3s; }
.tl-card:hover .t { color: var(--accent); }
.tl-card .d { display: block; color: var(--text-muted); font-size: 0.92rem; line-height: 1.55; }
.tl-card .go { margin-top: auto; color: var(--accent-soft); font-weight: 600; font-size: 0.92rem; }
.tl-card .go::after { content: ' →'; }
@keyframes tlCardIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

.tl-groups { display: grid; gap: 3rem; }
.tl-group-title { display: flex; align-items: baseline; gap: 0.8rem; margin: 0 0 1.25rem; color: var(--text); font-size: 1.35rem; font-weight: 650; letter-spacing: -0.01em; }
.tl-group-title small { color: var(--text-muted); font-weight: 400; font-size: 0.9rem; }

.tl-feature { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 2rem 0 0; }
.tl-feature div { padding: 1.1rem 1.2rem; border-radius: var(--radius-md); background: rgba(5, 8, 20, 0.5); border: 1px solid var(--border-subtle); }
.tl-feature strong { display: block; color: var(--text); margin-bottom: 0.3rem; font-size: 0.98rem; }
.tl-feature span { color: var(--text-muted); font-size: 0.9rem; line-height: 1.55; }

.tl-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Tablet and below ---------- */
@media (max-width: 1040px) {
  .tl-hero-grid { grid-template-columns: 1fr; }
  .tl-hero-grid .tl-shot { max-width: 720px; }
  .tl-grid { grid-template-columns: 1fr; }
}

/* ---------- Phones ---------- */
@media (max-width: 680px) {
  .tl-hero { padding: 6.5rem 0 1.75rem; }
  .tl-h1 { font-size: clamp(1.9rem, 8.5vw, 2.4rem); }
  .tl-lead { font-size: 1rem; }
  .tl-hero-actions { flex-direction: column; }
  .tl-hero-actions .btn { width: 100%; justify-content: center; }
  .tl-section { padding: 2.2rem 0; }
  .tl-panel { padding: 1.2rem; border-radius: 20px; }
  .tl-panel-title { font-size: 1.05rem; }
  .tl-row { flex-direction: column; align-items: stretch; }
  .tl-row > .tl-input { flex: none; }
  .tl-row .btn, .tl-row .tl-btn { width: 100%; justify-content: center; }
  .tl-cta { flex-direction: column; }
  .tl-cta .btn { width: 100%; justify-content: center; }
  .tl-kpis { grid-template-columns: 1fr 1fr; gap: 0.6rem; }
  .tl-kpi .v { font-size: 1.25rem; }
  .tl-cards { grid-template-columns: 1fr; gap: 1rem; }
  .tl-card { border-radius: 20px; }
  .tl-steps { grid-template-columns: 1fr; }
  .tl-faq summary { font-size: 0.98rem; }
  .tl-bar { height: 2.9rem; }
  .tl-bar > div { font-size: 0.72rem; }
  .tl-group-title { font-size: 1.15rem; }
  .tl-slider { grid-template-columns: 1fr; }
  .tl-slider output { justify-self: start; }
  .tl-drop { padding: 1.5rem 0.9rem; }
}

@media (prefers-reduced-motion: reduce) {
  .tl-card, .tl-card .shot img { animation: none; transition: none; }
}
