/* Free website tools (ADR-0126): /tools and /tools/<slug>. Theme tokens from
   styles.css; logical properties so Arabic mirrors itself. */
.tl-wrap { max-width: 920px; padding-top: 18px; padding-bottom: 60px; }
.tl-hero { text-align: center; margin: 18px auto 22px; max-width: 760px; }
.tl-hero h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); margin: 0 0 8px; }

.tl-tool { padding: 22px; margin-bottom: 34px; }
.tl-drop {
  border: 2px dashed var(--line); border-radius: 14px; padding: 34px 18px; text-align: center; cursor: pointer;
  background: var(--bg); transition: border-color .15s, background .15s;
}
.tl-drop:hover, .tl-drop:focus-visible, .tl-drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--bg)); outline: none; }
/* Font Awesome's kit swaps <i> for <svg>: size both. */
.tl-drop > i, .tl-drop > svg { font-size: 2.4rem; height: 2.4rem; color: var(--accent); }
.tl-drop-big { font-size: 1.15rem; font-weight: 700; margin-top: 8px; }
.tl-drop-small { color: var(--muted); margin-top: 4px; font-size: .92rem; }
.tl-link { color: var(--accent); font-weight: 600; text-decoration: underline; }

.tl-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.tl-item { position: relative; border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: var(--card); }
.tl-item img { display: block; width: 100%; height: 96px; object-fit: contain; background: var(--bg); border-radius: 6px; }
.tl-item .tl-name { font-size: .78rem; color: var(--muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-item .tl-btns { display: flex; justify-content: space-between; margin-top: 4px; }
.tl-item button { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 6px; width: 28px; height: 26px; cursor: pointer; font-size: .8rem; }
.tl-item button:hover { border-color: var(--accent); color: var(--accent); }
.tl-item .tl-n { position: absolute; top: 8px; inset-inline-start: 8px; background: var(--accent); color: #fff; border-radius: 999px; font-size: .72rem; font-weight: 700; padding: 1px 7px; }

.tl-opts { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 16px; }
.tl-opts label { display: flex; flex-direction: column; gap: 4px; font-size: .86rem; font-weight: 600; color: var(--muted); }
.tl-opts select { min-width: 170px; }
/* The tool's fields: same look as the site's forms (.field in styles.css), with a drawn arrow on selects. */
.tl-opts select, .tl-mode input, .tl-mode textarea {
  box-sizing: border-box; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px;
  background-color: var(--card, #fff); color: var(--ink); font-family: inherit; font-size: .95rem; font-weight: 500; line-height: 1.3;
  transition: border-color .15s, box-shadow .15s;
}
.tl-opts select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-inline-end: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2364748b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 12px 8px;
}
[dir="rtl"] .tl-opts select { background-position: left 14px center; }
.tl-opts select:hover, .tl-mode input:hover, .tl-mode textarea:hover { border-color: var(--muted); }
.tl-opts select:focus, .tl-mode input:focus, .tl-mode textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(12, 100, 174, .18);
}
.tl-mode textarea { resize: vertical; min-height: 180px; }
.tl-tabs { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 12px; }
.tl-tab { border: 0; background: var(--card); color: var(--ink); padding: 8px 14px; font-weight: 600; cursor: pointer; font-family: inherit; }
.tl-tab.on { background: var(--accent); color: #fff; }
.tl-mode input, .tl-mode textarea { width: 100%; box-sizing: border-box; font-family: inherit; }
.tl-mode textarea { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .86rem; }

.tl-go { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 18px; }
.tl-convert { font-size: 1.02rem; padding: 12px 22px; }
.tl-convert:disabled { opacity: .55; cursor: default; }
.tl-free { color: var(--muted); font-size: .9rem; }
.tl-msg { margin-top: 12px; min-height: 1.2em; font-size: .92rem; }
.tl-msg.err { color: var(--danger); }
.tl-done { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 14px; padding: 14px 16px; border-radius: 12px;
  background: color-mix(in srgb, #0d7a56 10%, var(--card)); border: 1px solid color-mix(in srgb, #0d7a56 30%, var(--line)); }
.tl-done > i, .tl-done > svg { font-size: 1.8rem; height: 1.8rem; color: #0d7a56; flex: none; }
.tl-done > div { flex: 1; min-width: 180px; }
.tl-done-big { font-weight: 700; }
.tl-done-meta { color: var(--muted); font-size: .86rem; }
.tl-saved { margin-top: 10px; font-size: .92rem; }
.tl-saved.ok { color: #0d7a56; font-weight: 600; }
.tl-saved.ok a { margin-inline-start: 4px; }
.tl-saved.err { color: var(--danger); }
.tl-gate { margin-top: 14px; padding: 18px; border-radius: 12px; border: 1px solid var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--card)); }
.tl-gate-big { font-weight: 700; font-size: 1.1rem; }
.tl-gate p { margin: 6px 0 12px; color: var(--ink); }
.tl-gate-btns { display: flex; gap: 10px; flex-wrap: wrap; }

.tl-how, .tl-faq, .tl-more { margin-bottom: 32px; }
.tl-pitch { text-align: center; }
.tl-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-bottom: 34px; }
.tl-card { display: flex; flex-direction: column; gap: 6px; padding: 18px; text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s; }
.tl-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.tl-card-icon { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--accent) 12%, var(--card)); color: var(--accent); font-size: 1.2rem; }
.tl-card-name { font-weight: 700; font-size: 1.05rem; }
.tl-card-tag { color: var(--muted); font-size: .9rem; line-height: 1.45; }
@media (max-width: 560px) { .tl-tool { padding: 16px; } .tl-opts select { min-width: 0; width: 100%; } .tl-opts label { flex: 1 1 140px; } }
