/* Общие стили инструментов раздела /tools/ (UTM, ссылки на мессенджеры, промокоды). Вид как у QR-генератора. */
.tl-app { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr); gap: 28px; align-items: start; margin-top: 8px; text-align: left; }
.tl-left { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.tl-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
body.inner-page .tl-tabs button { border: 1px solid #d9d7e6; background: #fff; color: #0d072d; border-radius: 999px; padding: 8px 14px; font: 500 14px/20px 'Inter', sans-serif; cursor: pointer; transition: .15s; }
body.inner-page .tl-tabs button i { margin-right: 4px; color: #6655db; }
body.inner-page .tl-tabs button.is-active { background: #0d072d; color: #fff; border-color: #0d072d; }
body.inner-page .tl-tabs button.is-active i { color: #fff; }
.tl-tabs-label { width: 100%; font: 600 14px/20px 'Inter', sans-serif; color: #0d072d; margin: 0 0 2px; }
.rs .tl-card { padding: 20px; margin: 0; }
.tl-card label, .tl-card .tl-label { display: block; font: 600 14px/20px 'Inter', sans-serif; margin: 14px 0 6px; color: #0d072d; }
.tl-card > label:first-child, .tl-card > div:first-child > label:first-child, .tl-row label { margin-top: 0; }
.tl-card label small { display: block; font-weight: 400; font-size: 12px; line-height: 16px; color: #57536d; }
body.inner-page .tl-card label.rs-check { display: flex; align-items: center; gap: 9px; margin: 0; font: 400 15px/1.4 'Inter', sans-serif; }
.tl-card input[type=text], .tl-card input[type=url], .tl-card input[type=tel], .tl-card input[type=number], .tl-card textarea, .tl-card select {
    width: 100%; box-sizing: border-box; border: 1px solid #d9d7e6; border-radius: 10px; padding: 10px 12px; font: 16px/1.4 'Inter', sans-serif; background: #fff; color: #0d072d; }
.tl-card textarea { resize: vertical; }
.tl-card input:focus, .tl-card textarea:focus, .tl-card select:focus { outline: none; border-color: #6655db; box-shadow: 0 0 0 3px rgba(102, 85, 219, .15); }
.tl-card input.is-error { border-color: #d64545; }
.tl-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; align-items: start; margin-top: 14px; }
.tl-checks { display: grid; gap: 8px; margin-top: 14px; }
.tl-hint { font-size: 13px; line-height: 1.5; color: #57536d; margin: 8px 0 0; }
.tl-hint code { overflow-wrap: anywhere; word-break: break-all; background: #ecebf5; border-radius: 6px; padding: 1px 5px; font-size: 12px; }

.tl-right { position: sticky; top: 90px; background: #f0f0f7; border-radius: 24px; padding: 24px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
body.inner-page .rs .tl-app .tl-right h2, body.inner-page .tl-right > h2 { font: 600 18px/1.3 'Inter', sans-serif !important; margin: 0 !important; color: #0d072d !important; border: 0 !important; padding: 0 !important; text-transform: none !important; letter-spacing: 0 !important; }
.tl-out { background: #fff; border-radius: 16px; padding: 16px; box-shadow: 0 8px 24px rgba(20, 15, 60, .06); font: 15px/1.5 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; color: #0d072d; word-break: break-all; white-space: pre-wrap; min-height: 56px; margin: 0; }
.tl-out.is-empty { color: #8a87a0; font-family: 'Inter', sans-serif; word-break: normal; }
textarea.tl-out { width: 100%; box-sizing: border-box; border: 0; resize: vertical; min-height: 260px; }
.tl-warn { font-size: 13px; line-height: 1.5; color: #8a4a00; background: #fff4e0; border-radius: 10px; padding: 10px 12px; margin: 0; }
.tl-ok { font-size: 13px; color: #57536d; margin: 0; }
.tl-actions { display: grid; gap: 10px; }
.tl-actions.is-disabled { opacity: .5; pointer-events: none; }
.rs .tl-actions .btn-generate { width: 100%; max-width: none; margin: 0; }
.tl-actions-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
body.inner-page .tl-actions-row .rs-secondary-btn { width: 100%; min-height: 42px; padding: 8px 6px; font: 400 14px/20px 'Inter', sans-serif !important; text-align: center; text-decoration: none; display: flex; align-items: center; justify-content: center; gap: 6px; box-sizing: border-box; }
.tl-sub { font: 600 14px/20px 'Inter', sans-serif; color: #0d072d; margin: 8px 0 0; }
.tl-preview { display: flex; justify-content: center; padding: 6px 0; }
.tl-history { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; margin: 0; padding: 0; list-style: none; min-width: 0; }
.tl-history li { padding: 0 !important; min-width: 0; }
.tl-history li::before { display: none !important; content: none !important; }
.tl-history button { width: 100%; text-align: left; background: #fff; border: 1px solid #e3e1ee; border-radius: 10px; padding: 8px 10px; font: 13px/1.4 ui-monospace, Menlo, monospace; color: #302951; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; max-width: 100%; box-sizing: border-box; }
.tl-history button:hover { border-color: #6655db; }
.tl-link-btn { background: none; border: 0; color: #6655db; padding: 0; cursor: pointer; font-size: 13px; text-decoration: underline; justify-self: start; }
.tl-stat { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: #57536d; margin: 0; }
.tl-stat b { color: #0d072d; font-weight: 600; }

.tl-cta { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: center; background: #0d072d; color: #fff; border-radius: 24px; padding: 28px 32px; margin: 40px 0; }
.rs-content .tl-cta h2 { color: #fff; font: 400 28px/1.2 'Geologica', 'Inter', sans-serif; margin: 0 0 8px; border: 0; padding: 0; }
.rs-content .tl-cta p { color: #d9d6ef !important; margin: 0; }
.rs-content .tl-cta a { background: #ff5b3b; color: #fff; text-decoration: none; border-radius: 12px; padding: 14px 22px; font-weight: 600; white-space: nowrap; }
.rs-content .tl-table-wrap { overflow-x: auto; }

@media (max-width: 900px) {
    .tl-app { grid-template-columns: 1fr; }
    .tl-right { position: static; }
    .tl-cta { grid-template-columns: 1fr; padding: 24px; }
    .rs-content .tl-cta a { text-align: center; }
}

/* Вторая очередь: счётчики, калькуляторы, текстовые инструменты */
.tl-app--wide { grid-template-columns: minmax(0, 1.35fr) minmax(300px, .85fr); }
.tl-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tl-kpis > div { background: #fff; border-radius: 14px; padding: 12px 14px; box-shadow: 0 6px 18px rgba(20, 15, 60, .05); }
.tl-kpis b { display: block; overflow-wrap: anywhere; font: 600 24px/1.2 'Inter', sans-serif; color: #0d072d; }
.tl-kpis span { font-size: 13px; color: #57536d; }
.tl-kpis > div.is-main { grid-column: 1 / -1; background: #0d072d; }
.tl-kpis > div.is-main b { color: #fff; font-size: 30px; }
.tl-kpis > div.is-main span { color: #d9d6ef; }
.tl-limits { display: grid; gap: 8px; }
.tl-limit { font-size: 13px; color: #302951; }
.tl-limit > div { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.tl-limit i { display: block; height: 6px; border-radius: 4px; background: #e3e1ee; overflow: hidden; }
.tl-limit i s { display: block; height: 100%; background: #3fb37f; text-decoration: none; }
.tl-limit.is-over i s { background: #e5533d; }
.tl-limit.is-over b { color: #c2410c; }
.tl-card textarea.tl-big { min-height: 260px; font-size: 16px; line-height: 1.5; }
.tl-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
body.inner-page .tl-btns .rs-secondary-btn { min-height: 40px; padding: 8px 12px; font: 400 14px/20px 'Inter', sans-serif !important; }
body.inner-page .tl-btns .rs-secondary-btn.is-active { background: #0d072d; color: #fff; }
.tl-unit { position: relative; }
.tl-unit span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: #8a87a0; font-size: 15px; pointer-events: none; }
.tl-unit input { padding-right: 34px !important; }
@media (max-width: 900px) { .tl-app--wide { grid-template-columns: 1fr; } }

.tl-kpis > div.is-empty { grid-column: 1 / -1; background: transparent; box-shadow: none; padding: 4px 0; }
.tl-kpis > div.is-empty b { display: none; }
.tl-kpis > div.is-empty span { font-size: 15px; color: #8a87a0; }
