/* Social tools: first-screen layouts. Loaded on every non-AI social tool page (after _social-kit.css).
   .sp        two columns on desktop: .sp-in (what you type) | .sp-out (what you get). One column under 900px.
   .sp-panel  tinted result panel    .is-stick  stays in view while the other column scrolls
   .sp-scroll a list that scrolls inside the panel so input and results share one screen. */
.sp-in, .sp-out { min-width: 0; }
.sp-out > .wk-sec:first-child, .sp-out > .wk-top:first-child { margin-top: 0; }
.sp-panel .wk-sec + .wk-sec { margin-top: 18px; }

@media (min-width: 901px) {
  .sp { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 26px; align-items: start; }
  .sp > :not(.sp-in):not(.sp-out) { grid-column: 1 / -1; }
  .sp-panel { padding: 18px; border: 1px solid #dfe3f5; border-radius: 16px; background: linear-gradient(180deg, #f6f7ff, #fbfbfe); }
  .sp-out.is-stick { position: sticky; top: 80px; }
  .sp-scroll { max-height: max(300px, calc(100vh - 420px)); overflow-y: auto; padding-right: 8px; scrollbar-width: thin; }
}
@media (max-width: 900px) {
  .sp-out { margin-top: 22px; }
}

/* ---- Font generators: type on the left, every style on the right, all on one screen ---- */
.fz-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.fz-nav[hidden] { display: none; }
.fz-tip { display: flex; align-items: flex-start; gap: 8px; }
.fz-tip .i { flex: none; margin-top: 3px; color: var(--brand); }
@media (min-width: 901px) {
  .fz.sp { grid-template-columns: minmax(300px, 390px) minmax(0, 1fr); }
  .fz .sp-out { padding: 4px 4px 4px 14px; border: 1px solid #dfe3f5; border-radius: 16px; background: linear-gradient(180deg, #f6f7ff, #fbfbfe); }
  .fz .fz-out { margin-top: 0; max-height: max(380px, calc(100vh - 345px)); overflow-y: auto; padding: 0 10px 14px 0; scrollbar-width: thin; }
  .fz .fz-out:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 12px; }
  .fz .fz-group-h { position: sticky; top: 0; z-index: 2; margin: 0; padding: 12px 0 10px; background: #f7f8ff; }
  .fz .fz-group + .fz-group { margin-top: 10px; }
  .tool-box .fz .fz-list { gap: 8px; }
  .tool-box .fz .fz-list .tw-row { padding: 10px 10px 10px 14px; border-radius: 14px; gap: 8px; }
  .fz .fz-body .txt { font-size: 18px; line-height: 1.4; }
  .fz .fz-name { font-size: 10.5px; margin-bottom: 1px; }
  .tool-box .fz .sk-copy { min-height: 32px; padding: 0 10px; font-size: 12.5px; }
  .fz .fz-empty { margin: 14px 14px 14px 0; min-height: 300px; align-content: center; }
  .fz .fz-more { margin: 14px 0 6px; }
}
@media (max-width: 900px) {
  /* Phone: the text box stays pinned under the site header while the styles scroll beneath it. */
  .fz .sp-in { display: contents; }
  .fz .wk-box.is-big { position: sticky; top: 68px; z-index: 6; box-shadow: 0 -8px 0 0 #fff, 0 10px 24px -14px rgba(15, 23, 42, .45); }
  .fz .sp-out { margin-top: 0; }
  .fz .fz-out { margin-top: 18px; }
  .fz-nav, .fz-tip { display: none; }
}

/* ---- Character counter: text on the left, platform limits on the right ---- */
@media (min-width: 901px) {
  .cc .tx-stats { margin-top: 12px; }
  .cc .tx-stats > div { padding: 9px 6px 8px; }
  .cc .tx-stats b { font-size: 19px; }
  [data-tool-root] .cc .wk-box textarea { min-height: 190px; }
  .cc .cc-list.sp-scroll { max-height: max(340px, calc(100vh - 400px)); }
}

/* ---- Line break generator: caption left, preview and ready-to-paste text right ---- */
@media (min-width: 901px) {
  .lb .lb-preview { max-height: 190px; overflow-y: auto; }
  [data-tool-root] .lb textarea.lb-out { min-height: 104px; }
  .lb .tx-stats { margin-top: 12px; }
}

/* ---- WhatsApp and Telegram links: details left, link, preview and QR right ---- */
.sp-out.wa-out { padding-top: 0; border-top: 0; }
@media (min-width: 901px) {
  .sp-out.wa-out { padding: 18px; border: 1px solid #dfe3f5; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; }
  .sp-out.wa-out .wa-qr { padding: 10px; }
  .sp-out.wa-out .wa-qr canvas { width: 150px; height: 150px; }
  .sp-out.wa-out .wa-qr small { max-width: 160px; }
  .sp-out.wa-out .wa-qr .btn { font-size: 12.5px; padding: 6px 9px; }
  .sp-out.wa-out .wa-link { background: #fff; }
  .wa .wa-phone { grid-template-columns: minmax(0, 190px) minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .sp-out.wa-out { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
}

/* ---- YouTube embed code and timestamp links ---- */
.yt-ts-empty span:last-child { max-width: 340px; font-size: 14px; line-height: 1.5; }
.sp-out:has(#ytTsOut:not([hidden])) .yt-ts-empty { display: none; }
@media (min-width: 901px) {
  .yt-w.sp .yt-opts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .yt-w.sp .sp-panel .wk-empty { background: #fff; min-height: 240px; align-content: center; }
  .yt-w.sp .yt-ch { margin-top: 4px; }
}

/* ---- Thumbnail downloader: one centred box, thumbnails right under it ---- */
.yt-w .yt-form { max-width: 760px; margin: 0 auto; }
.yt-w .yt-form .wk-top, .yt-w .yt-form .wk-try { justify-content: center; }
.yt-w .yt-empty { max-width: 760px; margin-left: auto; margin-right: auto; }

/* ---- Size guides and resizers: the sizes people came for sit beside the drop zone ---- */
.ir-start { display: grid; gap: 18px; }
.ir-sizes { min-width: 0; }
.ir-sizes h3 { margin: 0 0 10px; font-size: 15.5px; letter-spacing: -.01em; }
.ir-sizes h3 small { font-weight: 500; color: var(--muted); font-size: 13px; }
.ir-size-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.ir-size { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); font: inherit; color: var(--ink); text-align: left; cursor: pointer; transition: border-color .15s, background .15s; }
.ir-size:hover { border-color: var(--brand); }
.ir-size[aria-pressed="true"] { border-color: var(--brand); background: var(--sk-tint, #eef2ff); box-shadow: inset 0 0 0 1px var(--brand); }
.ir-shape { flex: none; display: grid; place-items: center; width: 40px; height: 40px; }
.ir-shape i { display: block; border-radius: 4px; background: linear-gradient(135deg, #4f46e5, #db2777); }
.ir-size span { min-width: 0; }
.ir-size b { display: block; font-size: 14px; font-weight: 600; line-height: 1.3; }
.ir-size em { display: block; font-style: normal; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ir-size em strong { color: var(--brand-ink, #3730a3); font-weight: 700; }
.ir-start:has(.img-pick.is-small) .ir-sizes { display: none; }
@media (min-width: 901px) {
  .ir-start { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; }
  .ir-start:has(.img-pick.is-small) { grid-template-columns: minmax(0, 1fr); }
  .ir-start .img-pick:not(.is-small) { grid-template-rows: 1fr auto; }
  .ir-start .img-pick:not(.is-small) .img-drop { min-height: 250px; }
  .ir-size-list { max-height: 320px; overflow-y: auto; padding-right: 4px; scrollbar-width: thin; }
}

/* Grid maker: mini diagrams of each layout */
.ir-shape.gm-mini { display: grid; grid-template-columns: repeat(var(--c, 3), 1fr); gap: 2px; place-items: stretch; align-content: center; }
.ir-shape.gm-mini i { width: auto; height: 11px; border-radius: 2px; }
.gm-mini.is-car { gap: 0; }
.gm-mini.is-car i { border-radius: 0; border-right: 1px dashed rgba(255, 255, 255, .85); }
.gm-mini.is-car i:first-child { border-radius: 3px 0 0 3px; } .gm-mini.is-car i:last-child { border-radius: 0 3px 3px 0; border-right: 0; }

/* Thumbnail downloader on a wide screen: the full-size thumbnail on the left, the smaller sizes beside it,
   so the picture and its Download button share the first screen. */
@media (min-width: 901px) {
  .tool-box .yt-w .yt-thumbs { grid-template-columns: minmax(0, 6fr) minmax(0, 3fr) minmax(0, 3fr); align-items: start; }
  .tool-box .yt-w .yt-thumb.is-main { grid-column: 1; grid-row: 1 / span 3; }
  .tool-box .yt-w .yt-thumb:not(.is-main) .yt-thumb-meta strong { font-size: 13.5px; }
}

/* ---- Font tools, second pass: style filter and a profile preview of the chosen style ---- */
[data-tool-root] .fz-filter { width: 100%; height: 42px; margin-top: 14px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); font-size: 14.5px; min-height: 0; }
.fz-nav { border-top: 0; padding-top: 0; margin-top: 10px; }
.fz-nomatch { margin: 14px 0; }
.fz-mock { margin-top: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); box-shadow: 0 14px 34px -26px rgba(79, 70, 229, .5); }
.fz-mock[hidden] { display: none; }
.fz-mock-h { display: flex; align-items: center; gap: 12px; }
.fz-mock-av { flex: none; width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(135deg, #f59e0b, #db2777 55%, #7c3aed); box-shadow: 0 0 0 2px #fff, 0 0 0 4px #e1306c; }
.fz-mock-h b { display: block; font-size: 14.5px; }
.fz-mock-h small { display: block; font-size: 12px; color: var(--muted); }
.fz-mock-text { margin: 12px 0 0; font-size: 17px; line-height: 1.45; overflow-wrap: anywhere; max-height: 5.8em; overflow: hidden; }
.fz-mock-meta { display: flex; justify-content: space-between; gap: 10px; margin: 10px 0 0; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 12.5px; color: var(--muted); }
.fz-mock-meta span:first-child { font-weight: 600; text-transform: uppercase; letter-spacing: .05em; font-size: 11px; }
.fz-mock-meta b { color: var(--ink); font-variant-numeric: tabular-nums; }
.fz-mock-meta .is-over, .fz-mock-meta .is-over b { color: #b4232f; }
.fz .fz-list .tw-row.is-sel { border-color: var(--brand); }
.fz .fz-list .tw-row[hidden] { display: none; }
@media (max-width: 900px) { .fz-mock, [data-tool-root] .fz-filter { display: none; } }
