/* Link & text tools: url-shortener, open-in-app-link, link-in-bio, utm-builder,
   instagram-bio-fonts, link-safety-checker, sms-link-checker, sms-character-counter,
   contact-link-generator. Tokens only — dark mode follows hi4.css. */

.tl-first { padding-top: 40px; }
.tl-tap { min-height: 40px; }
.tl-mono { font-family: var(--mono); }
.tl-row-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Short-link results */
.tl-result { border: 1.5px solid var(--accent-line); background: var(--accent-tint); border-radius: var(--r-md); padding: 14px; display: flex; flex-direction: column; gap: 10px; animation: pop .25s ease-out; }
.tl-result .big { font-size: 20px; font-weight: 800; overflow-wrap: anywhere; color: var(--ink); line-height: 1.25; }
.tl-result .sub { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.tl-result.is-err { border-color: color-mix(in srgb, var(--red) 40%, transparent); background: var(--red-soft); }
.tl-result.is-sel { box-shadow: 0 0 0 3px var(--accent-soft); }

/* Device-only history lists */
.tl-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.tl-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.tl-list li:last-child { border-bottom: 0; }
.tl-list .meta { min-width: 0; font-size: 14px; overflow-wrap: anywhere; }
.tl-list .meta small { display: block; color: var(--muted-2); font-size: 12px; }

/* Bookmarklet */
.tl-bookmarklet { cursor: grab; border-style: dashed; }

/* Checklists (SMS link checker) */
.tl-check { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.tl-check li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--soft); border: 1px solid var(--line); }
.tl-check .ico { flex: 0 0 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; line-height: 1; background: var(--surface); color: var(--muted); }
.tl-check li.pass .ico { background: var(--green-soft); color: var(--green); }
.tl-check li.warn .ico { background: var(--amber-soft); color: var(--amber); }
.tl-check li.fail .ico { background: var(--red-soft); color: var(--red); }
.tl-check li.fail { border-color: color-mix(in srgb, var(--red) 35%, transparent); }
.tl-check li.warn { border-color: color-mix(in srgb, var(--amber) 35%, transparent); }
.tl-check strong { display: block; font-size: 15px; }
.tl-check p { font-size: 14px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.tl-score { display: flex; flex-wrap: wrap; gap: 8px; }

/* SMS counter */
.tl-stats { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr)); }
.tl-stats .stat { padding: 14px; }
.tl-stats .stat .v { font-size: 26px; }
.tl-sms-view { font-family: var(--mono); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--soft); border-radius: var(--r); padding: 12px 14px; min-height: 48px; color: var(--ink-2); }
.tl-sms-view mark { background: var(--amber-soft); color: var(--amber); outline: 1.5px solid var(--amber); border-radius: 3px; padding: 0 1px; }
.tl-sms-view .ext { background: var(--accent-soft); color: var(--accent); border-radius: 3px; }
.tl-sms-view .cut { border-left: 2px solid var(--accent); margin-left: 1px; }
.tl-chars { display: flex; flex-wrap: wrap; gap: 6px; }
.tl-chars code { background: var(--amber-soft); color: var(--amber); border-radius: 6px; padding: 2px 8px; font-size: 14px; }

/* Fonts */
.tl-font-tools { position: sticky; top: calc(var(--header-h) + 8px); z-index: 5; background: var(--bg); padding: 10px 0; }
.font-row .btn { min-height: 40px; }
.tl-tpl { white-space: pre-wrap; font-size: 15px; line-height: 1.6; background: var(--soft); border-radius: var(--r); padding: 12px 14px; overflow-wrap: anywhere; }

/* Link-in-bio builder */
.phone-screen .bio { min-height: 100%; }
.tl-bio-pv .bio-wrap { padding-top: 0; }
.tl-bio-pv .bio-cover { height: 110px; }
.tl-bio-pv .bio-avatar { width: 80px; height: 80px; margin: -40px auto 0; font-size: 28px; overflow: hidden; }
.tl-bio-pv .bio-avatar img { width: 100%; height: 100%; object-fit: cover; }
.tl-bio-pv .bio-name { justify-content: center; text-align: center; font-size: 20px; overflow-wrap: anywhere; }
.tl-bio-pv .bio-meta { text-align: center; white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 4px; }
.tl-bio-pv .bio-actions { grid-template-columns: repeat(var(--n, 2), 1fr); margin: 14px 0; }
.tl-bio-pv .bio-link span { overflow-wrap: anywhere; min-width: 0; }
.tl-bio-social { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 10px 0 14px; }
.tl-bio-social a { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--bio-card); color: var(--bio-accent); border: 1px solid rgba(16, 19, 38, .08); }
.tl-bio-social svg { width: 20px; height: 20px; }
.tl-bio-empty { text-align: center; font-size: 13px; color: var(--bio-muted); padding: 10px; border: 1.5px dashed rgba(16, 19, 38, .15); border-radius: 14px; }
.tl-links { display: flex; flex-direction: column; gap: 10px; }
.tl-link-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.tl-link-row .fields { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tl-link-row .ctl { display: flex; flex-direction: column; gap: 4px; }
.tl-link-row .ctl .btn { --bh: 40px; }
.tl-theme { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
.tl-theme button { border: 1.5px solid var(--line-2); border-radius: var(--r); background: var(--surface); padding: 8px; display: flex; flex-direction: column; gap: 6px; align-items: stretch; cursor: pointer; font-size: 12px; font-weight: 700; color: var(--ink-2); min-height: 40px; }
.tl-theme button i { display: block; height: 30px; border-radius: 8px; }
.tl-theme button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-tint); color: var(--accent); }
.tl-avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; overflow: hidden; color: var(--muted-2); flex: 0 0 auto; }
.tl-avatar img { width: 100%; height: 100%; object-fit: cover; }
.tl-file { position: relative; overflow: hidden; }
.tl-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.tl-file:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
fieldset.tl-fs { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
fieldset.tl-fs legend { font-size: 18px; font-weight: 800; padding: 0; margin-bottom: 4px; color: var(--ink); }

/* Open-in-app */
.tl-app { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r); background: var(--soft); }
.tl-app .icon-tile { width: 40px; height: 40px; }
.tl-platforms { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.tl-platforms > div { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; font-size: 14px; color: var(--ink-2); background: var(--surface); }
.tl-platforms strong { display: block; margin-bottom: 2px; color: var(--ink); }

/* UTM bulk table */
.tl-utm-table td { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; word-break: break-all; }
.tl-utm-table td:first-child, .tl-utm-table td:last-child { font-family: var(--font); word-break: normal; white-space: nowrap; }
.tl-sugg { display: flex; flex-direction: column; gap: 6px; }

/* Safety tips */
.tl-sign { display: flex; flex-direction: column; gap: 8px; }
.tl-sign .n { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--red-soft); color: var(--red); font-weight: 800; }
.tl-sign .eg { font-size: 13px; font-family: var(--mono); color: var(--muted); background: var(--soft); border-radius: 8px; padding: 6px 10px; overflow-wrap: anywhere; }

@media (max-width: 480px) {
  .tl-result .big { font-size: 18px; }
  .tl-utm-table td:first-child { white-space: normal; }
}
.app-pill svg { width: 18px; height: 18px; flex: 0 0 auto; }
.tl-mobile-only { display: none; }
@media (max-width: 959px) { .tl-mobile-only { display: inline-flex; } }
/* hi4.css also has an .opt option-button rule; keep "optional" hints inside labels plain. */
.label > .opt { display: inline; border: 0; padding: 0; background: none; border-radius: 0; font-size: 13px; font-weight: 500; color: var(--muted-2); cursor: auto; }
.output-box .out.tl-msg { font-family: var(--font); color: var(--muted); }
.tl-tabs-wrap { flex-wrap: wrap; overflow: visible; }
.tl-tabs-wrap .tab { min-height: 40px; }
