/* =========================================================
   ToolsHub v1.1 — "Yolk" style (DM Sans + Bricolage Grotesque)
   1. Tokens & base   2. Header & menu   3. Page layout & headings
   4. Search, categories, tool cards   5. Tips, SEO text, FAQ
   6. Tool page   7. Content   8. Ads   9. Footer
   10. Tool UI kit (th-* classes used by the tools' JS — keep the names)
   ========================================================= */

/* 1. Tokens & base ---------------------------------------- */
:root {
	--bg: #f1f6f5;
	--ink: #12302f;
	--mute: #55706e;
	--line: #d3e1de;
	--card: #ffffff;
	--soft: #f8fbfa;
	--hover: #eef4f3;
	--yolk: #ffb81f;
	--yolk-h: #ffc43d;
	--yolk-d: #c98a00;
	--teal: #1f7a74;
	--teal-soft: #e6f3f1;
	--err: #b3261e;
	--err-soft: #fdecea;
	--head: 56px;
	--font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
	--display: 'Bricolage Grotesque', 'DM Sans', system-ui, sans-serif;
	color-scheme: light;
}
@media (min-width: 860px) { :root { --head: 64px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--head) + 16px); }
body { margin: 0; font: 16px/1.55 var(--font); background: var(--bg); color: var(--ink); min-height: 100vh; display: flex; flex-direction: column; }
.site-main { flex: 1 0 auto; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.02em; }
p { margin: 0 0 1em; }
img, svg, video, canvas { max-width: 100%; height: auto; }
svg { flex-shrink: 0; }
a { color: var(--teal); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
[hidden] { display: none !important; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 10px; }
.skip-link:focus { left: 8px; }
.screen-reader-text, .th-visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }

/* 2. Header & menu ---------------------------------------- */
.site-header {
	position: sticky; top: 0; z-index: 20;
	background: #fff; border-bottom: 1px solid var(--line);
	height: var(--head);
	display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; padding: 0 6px;
}
.brand { grid-column: 2; justify-self: center; display: flex; align-items: center; color: var(--ink); text-decoration: none; min-width: 0; }
/* Logo: scales smoothly from 40px (small phones) to 56px (large screens) */
.brand img { height: clamp(30px, 1vw + 26px, 40px); width: auto; max-width: min(100%, 170px); object-fit: contain; display: block; }
.brand-text { font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: -.02em; }

.nav-toggle { grid-column: 1; grid-row: 1; width: 40px; height: 40px; border: 0; background: transparent; border-radius: 12px; cursor: pointer; display: grid; place-content: center; gap: 5px; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--ink); border-radius: 2px; transition: .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.primary-nav { position: absolute; left: 0; right: 0; top: var(--head); background: #fff; border-top: 1px solid var(--line); padding: 8px 12px 14px; display: none; box-shadow: 0 14px 24px #12302f1f; }
.primary-nav.is-open { display: block; }
.primary-nav .menu { list-style: none; margin: 0; padding: 0; }
.primary-nav a { display: block; padding: 12px 14px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 500; }
.primary-nav a:hover { background: var(--hover); }
.primary-nav .current-menu-item > a,
.primary-nav .current_page_item > a,
.primary-nav .current-menu-ancestor > a { background: var(--yolk); font-weight: 700; }

@media (min-width: 860px) {
	.site-header { display: flex; padding: 0 24px; gap: 0; }
	.nav-toggle { display: none; }
	.primary-nav { position: static; display: block; background: none; border: 0; padding: 0; box-shadow: none; margin-left: 40px; }
	.primary-nav .menu { display: flex; gap: 10px; flex-wrap: wrap; }
	/* Header links look like buttons */
	.primary-nav a { padding: 5px 12px; font-size: 14px; line-height: 1.4; border: 2px solid var(--ink); border-radius: 10px; background: #fff; font-weight: 700; box-shadow: 0 2px 0 var(--ink); transition: transform .08s, box-shadow .08s, background .15s; }
	.primary-nav a:hover { background: #f3f8f7; }
	.primary-nav a:active { transform: translateY(2px); box-shadow: 0 0 0 var(--ink); }
	.primary-nav .current-menu-item > a, .primary-nav .current_page_item > a, .primary-nav .current-menu-ancestor > a { background: var(--yolk); }
}

/* 3. Page layout & headings -------------------------------- */
.wrap, .container { max-width: 1180px; margin: 0 auto; padding: 28px 16px 48px; width: 100%; }
.container--narrow { max-width: 820px; }
.section, .page-head { padding: 0; }
.hd { text-align: center; margin-bottom: 24px; }
.hd h1, .page-title { font-size: clamp(28px, 6vw, 44px); line-height: 1.1; font-weight: 800; letter-spacing: -.025em; margin: 0; }
.hd p, .page-desc { color: var(--mute); margin: 10px auto 0; max-width: 56ch; }
.page-title { margin-bottom: 8px; }
.block { margin-top: 36px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.block-title { font-size: 22px; font-weight: 800; margin: 0 0 14px; }
.block-link { font-weight: 700; color: var(--teal); text-decoration: none; }
.block-link:hover { text-decoration: underline; }
.empty { text-align: center; color: var(--mute); padding: 40px 12px; border: 2px dashed var(--line); border-radius: 14px; margin: 0; }
.center { text-align: center; }

.btn { border: 2px solid var(--ink); background: #fff; border-radius: 12px; padding: 11px 20px; font-weight: 700; cursor: pointer; box-shadow: 0 3px 0 var(--ink); transition: transform .08s, box-shadow .08s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; color: var(--ink); }
.btn:hover { background: #f3f8f7; }
.btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
.btn--primary { background: var(--yolk); }
.btn--primary:hover { background: var(--yolk-h); }
.btn--ghost { background: #fff; }

.breadcrumbs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; font-size: 13.5px; color: var(--mute); margin-bottom: 14px; }
.breadcrumbs a { color: var(--mute); text-decoration: none; }
.breadcrumbs a:hover { color: var(--teal); text-decoration: underline; }
.breadcrumbs .sep { opacity: .6; }

/* 4. Search, categories, tool cards ------------------------ */
.tool-filter { max-width: 620px; margin: 22px auto 0; }
.search-box { display: flex; align-items: center; gap: 10px; background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 0 16px; color: var(--mute); min-height: 54px; }
.search-box:focus-within { border-color: var(--teal); }
.search-box input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 13px 0; font-size: 16px; color: var(--ink); outline: none; }
.search-box kbd { font: 700 12px var(--font); border: 2px solid var(--line); border-radius: 6px; padding: 1px 7px; color: var(--mute); }
@media (max-width: 600px) { .search-box kbd { display: none; } }

.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.chip { padding: 7px 14px; border-radius: 999px; border: 2px solid var(--line); background: #fff; cursor: pointer; font-weight: 500; font-size: 14px; }
.chip:hover { border-color: var(--teal); }
.chip[aria-pressed="true"] { background: var(--yolk); border-color: var(--ink); font-weight: 700; }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.cat-tile { display: flex; flex-direction: column; gap: 8px; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); text-decoration: none; transition: transform .12s, box-shadow .12s, border-color .12s; }
a.cat-tile:hover { border-color: var(--ink); box-shadow: 0 3px 0 var(--ink); transform: translateY(-2px); }
.cat-icon { width: 48px; height: 48px; border-radius: 50%; background: var(--yolk); color: var(--ink); display: grid; place-items: center; margin-bottom: 4px; }
.cat-name { font-family: var(--display); font-weight: 800; font-size: 19px; letter-spacing: -.01em; }
.cat-desc { color: var(--mute); font-size: 14.5px; }
.cat-count { font-weight: 700; font-size: 14px; color: var(--teal); margin-top: auto; }
.cat-tile.is-soon { background: var(--soft); border-style: dashed; }
.cat-tile.is-soon .cat-icon { background: #fff; border: 2px solid var(--line); color: var(--mute); }
.cat-tile.is-soon .cat-count { color: var(--mute); font-weight: 500; }
@media (max-width: 520px) { .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .cat-tile { padding: 14px; } .cat-desc { display: none; } .cat-name { font-size: 16px; } }

.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.tool-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); text-decoration: none; transition: transform .12s, box-shadow .12s, border-color .12s; }
.tool-card:hover { border-color: var(--ink); box-shadow: 0 3px 0 var(--ink); transform: translateY(-2px); }
.tool-card__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tool-card__title { font-weight: 700; font-size: 16.5px; }
.tool-card__desc { color: var(--mute); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tool-icon { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%; background: var(--yolk); display: grid; place-items: center; font-size: 22px; font-weight: 800; color: var(--ink); overflow: hidden; }
.tool-icon img { width: 100%; height: 100%; object-fit: cover; }
.tool-icon--sm { width: 34px; height: 34px; font-size: 16px; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font: 700 11px var(--font); text-transform: uppercase; letter-spacing: .04em; vertical-align: 2px; }
.badge--new { background: var(--teal-soft); color: var(--teal); }

/* 5. Tips, SEO text, FAQ ----------------------------------- */
.tips { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 28px; color: var(--mute); font-size: 14.5px; }
.tips div { padding: 14px 16px; border-left: 4px solid var(--yolk); background: #ffffff90; border-radius: 0 12px 12px 0; }
.tips b { color: var(--ink); display: block; }

.seo-faq { display: grid; gap: 24px; margin-top: 36px; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 24px 20px; }
.seo-faq h2 { font-size: 24px; font-weight: 800; }
@media (min-width: 900px) { .seo-faq { grid-template-columns: 1fr 1fr; gap: 48px; padding: 36px; } }
.seo-text p { color: var(--mute); }

.faq details, .entry-content details { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 0 16px; margin-bottom: 10px; }
.faq summary, .entry-content summary { list-style: none; cursor: pointer; padding: 15px 28px 15px 0; font-weight: 700; position: relative; }
.faq summary::-webkit-details-marker, .entry-content summary::-webkit-details-marker { display: none; }
.faq summary::after, .entry-content summary::after { content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 22px; font-weight: 500; color: var(--mute); }
.faq details[open] summary::after, .entry-content details[open] summary::after { content: "−"; }
.faq details p, .entry-content details p { color: var(--mute); margin: 0 0 15px; }

/* 6. Tool page -------------------------------------------- */
.tool-shell { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 20px; }
.tool-app { min-height: 300px; }
.tool-app.is-ready { min-height: 0; }
.tool-loading { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 300px; color: var(--mute); }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2.5px solid var(--yolk-d); border-right-color: transparent; border-radius: 50%; animation: th-spin .7s linear infinite; vertical-align: -2px; }
@keyframes th-spin { to { transform: rotate(360deg); } }

.more-tools { margin-top: 32px; }
.tool-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; padding-top: 32px; align-items: start; }
.tool-sidebar:empty, .tool-sidebar:not(:has(*)) { display: none; }
@media (min-width: 1024px) { .tool-layout:has(.tool-sidebar .ad-slot) { grid-template-columns: minmax(0, 1fr) 300px; } .tool-sidebar { position: sticky; top: calc(var(--head) + 16px); } }
.tool-sidebar { display: flex; flex-direction: column; gap: 18px; }
.side-box { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.side-title { font-size: 18px; font-weight: 800; margin-bottom: 10px; }
.side-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.side-list a { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; color: var(--ink); text-decoration: none; font-weight: 500; }
.side-list a:hover { background: var(--hover); }

/* 7. Content ---------------------------------------------- */
.entry-content { font-size: 16.5px; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content h2 { font-size: 26px; font-weight: 800; margin: 1.6em 0 .5em; }
.entry-content h3 { font-size: 20px; font-weight: 800; margin: 1.4em 0 .4em; }
.entry-content ul, .entry-content ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.entry-content li { margin-bottom: .4em; }
.entry-content li::marker { color: var(--teal); font-weight: 700; }
.entry-content img { border-radius: 14px; }
.entry-content table { width: 100%; border-collapse: collapse; margin: 0 0 1.4em; font-size: 15px; display: block; overflow-x: auto; background: #fff; border-radius: 12px; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }
.entry-content th { background: var(--soft); }
.entry-content blockquote { margin: 0 0 1.2em; padding: 14px 16px; border-left: 4px solid var(--yolk); background: #ffffff90; border-radius: 0 12px 12px 0; }
.entry-content code { background: #fff; border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; font-size: .92em; }
.page-content { padding-bottom: 24px; }

.post-list { display: grid; gap: 12px; }
.post-item { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; }
.post-item__title { font-size: 21px; margin: 0 0 4px; }
.post-item__title a { color: var(--ink); text-decoration: none; }
.post-item__meta { color: var(--mute); font-size: 14px; margin-bottom: 8px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 28px; }
.pagination .page-numbers { padding: 8px 14px; border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); text-decoration: none; font-weight: 700; }
.pagination .page-numbers.current { background: var(--yolk); border-color: var(--ink); }
.big-404 { font-family: var(--display); font-size: 96px; font-weight: 800; line-height: 1; margin: 0; color: var(--yolk-d); }

/* 8. Ads -------------------------------------------------- */
.ad-slot { margin: 20px auto; text-align: center; overflow: hidden; }
.ad-slot__label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--mute); margin-bottom: 4px; }
.ad-slot__inner { display: flex; justify-content: center; align-items: center; }
.ad-slot__inner > * { max-width: 100%; }
.ad-slot--tool_top .ad-slot__inner, .ad-slot--tool_bottom .ad-slot__inner, .ad-slot--archive_top .ad-slot__inner, .ad-slot--home_middle .ad-slot__inner { min-height: 100px; }
.ad-slot--tool_sidebar { margin: 0; }
.ad-slot--tool_sidebar .ad-slot__inner, .ad-slot--tool_content .ad-slot__inner { min-height: 250px; }
@media (min-width: 768px) { .ad-slot--tool_top .ad-slot__inner, .ad-slot--tool_bottom .ad-slot__inner, .ad-slot--archive_top .ad-slot__inner, .ad-slot--home_middle .ad-slot__inner { min-height: 90px; } }
@media (max-width: 1023px) { .ad-slot--tool_sidebar { display: none; } }

/* 9. Footer ----------------------------------------------- */
.site-footer { text-align: center; color: var(--mute); font-size: 14px; padding: 8px 16px 28px; }
.footer-menu { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; }
.footer-menu a, .footer-copy a { color: var(--mute); text-decoration: none; }
.footer-menu a:hover, .footer-copy a:hover { color: var(--teal); text-decoration: underline; }
.footer-copy { margin: 0; }

/* 10. Tool UI kit ----------------------------------------- */
/* These class names are used by toolkit.js and every tool on R2. Restyle freely, but keep the names. */
.th-tool { display: flex; flex-direction: column; gap: 18px; }
.th-tool > .th-filelist { order: 1; }
.th-tool > .th-summary { order: 2; }

.th-dropzone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 4px; padding: 36px 16px; border: 2px dashed #9dbcb7; border-radius: 16px; background: var(--soft); cursor: pointer; transition: .15s; }
.th-dropzone:hover, .th-dropzone.is-drag { border-color: var(--teal); background: var(--teal-soft); }
.th-dropzone * { pointer-events: none; }
.th-dropzone__icon { width: 52px; height: 52px; margin: 0 auto 10px; border-radius: 50%; background: var(--yolk); color: var(--ink); display: grid; place-items: center; }
.th-dropzone__title { font-weight: 700; font-size: 18px; margin: 0; }
.th-dropzone__hint { color: var(--mute); font-size: 14px; margin: 0; order: 3; padding-top: 12px; }
.th-dropzone::after { content: "Choose files"; order: 2; margin-top: 12px; border: 2px solid var(--ink); background: var(--yolk); border-radius: 12px; padding: 10px 20px; font-weight: 700; box-shadow: 0 3px 0 var(--ink); }
.th-dropzone:hover::after { background: var(--yolk-h); }
.th-dropzone--compact { flex-direction: row; gap: 12px; padding: 14px 16px; }
.th-dropzone--compact .th-dropzone__icon { width: 38px; height: 38px; margin: 0; }
.th-dropzone--compact .th-dropzone__icon svg { width: 20px; height: 20px; }
.th-dropzone--compact .th-dropzone__title { font-size: 16px; }
.th-dropzone--compact .th-dropzone__hint, .th-dropzone--compact::after { display: none; }

.th-panel { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.th-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.th-field__label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-weight: 700; font-size: 14px; color: var(--ink); }
.th-field__value { color: var(--teal); }
.th-field__help { font-size: 13px; color: var(--mute); margin: 0; }
.th-input, .th-select { width: 100%; padding: 11px 12px; border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); min-height: 46px; }
.th-input:focus, .th-select:focus { border-color: var(--teal); outline: 0; }
.th-input:disabled, .th-select:disabled { background: var(--soft); color: var(--mute); }
.th-color { width: 100%; height: 46px; padding: 4px; border: 2px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; }
.th-range { width: 100%; accent-color: var(--teal); height: 40px; margin: 0; }

.th-seg { display: flex; flex-wrap: wrap; gap: 8px; }
.th-seg button { flex: 1 1 auto; min-width: 64px; min-height: 44px; padding: 8px 12px; border: 2px solid var(--line); border-radius: 12px; background: #fff; font-weight: 700; cursor: pointer; }
.th-seg button:hover { border-color: var(--teal); }
.th-seg button[aria-pressed="true"] { background: var(--yolk); border-color: var(--ink); box-shadow: 0 2px 0 var(--ink); }
.th-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.th-check { display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; border: 2px solid var(--line); border-radius: 10px; background: #fff; font-weight: 500; font-size: 14px; cursor: pointer; }
.th-check input { width: 18px; height: 18px; accent-color: var(--teal); }

.th-btn { border: 2px solid var(--ink); background: #fff; color: var(--ink); border-radius: 12px; padding: 9px 18px; min-height: 44px; font-weight: 700; cursor: pointer; box-shadow: 0 3px 0 var(--ink); transition: transform .08s, box-shadow .08s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; }
.th-btn:hover { background: #f3f8f7; }
.th-btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
.th-btn:disabled { opacity: .45; pointer-events: none; }
.th-btn--primary { background: var(--yolk); }
.th-btn--primary:hover { background: var(--yolk-h); }
.th-btn--sm { min-height: 36px; padding: 6px 12px; font-size: 14px; box-shadow: 0 2px 0 var(--ink); }

/* "Your files" panel */
.th-filelist { list-style: none; margin: 0; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: #fff; border: 2px solid var(--yolk); border-radius: 20px; max-height: 62vh; overflow: auto; }
.th-filelist::before { content: "Your files"; font-family: var(--display); font-size: 21px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 2px; }
.th-filelist:empty::after { content: "No files yet. The files you add will be listed here."; text-align: center; color: var(--mute); padding: 40px 12px; border: 2px dashed var(--line); border-radius: 14px; }
.th-file { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 14px; padding: 10px; background: #fff; }
.th-file__thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; background: #e6efed; }
.th-file__info { min-width: 0; }
.th-file__name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-file__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13.5px; color: var(--mute); }
.th-file__actions { display: flex; gap: 6px; align-items: center; }
.th-file__actions .th-btn:not(.th-btn--primary) { border: 0; box-shadow: none; background: none; color: var(--mute); padding: 4px 8px; min-height: 36px; }
.th-file__actions .th-btn:not(.th-btn--primary):hover { background: var(--hover); }
.th-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.th-tag--good { background: var(--teal-soft); color: var(--teal); }
.th-tag--neutral { background: var(--hover); color: var(--mute); }
.th-tag--bad { background: var(--err-soft); color: var(--err); }
.th-file .spinner { border-width: 2px !important; }

.th-summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-radius: 14px; background: var(--soft); border: 1px solid var(--line); }
.th-summary__text { font-weight: 500; }
.th-summary__text strong { color: var(--teal); }
.th-summary__actions { display: flex; flex-wrap: wrap; gap: 10px; }

.th-note { font-size: 13px; color: var(--mute); margin: 0; }
.th-error { padding: 14px 16px; border-radius: 12px; background: var(--err-soft); color: var(--err); font-weight: 700; margin: 0; }
.th-toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 120px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; max-width: 90vw; transition: .25s; z-index: 30; pointer-events: none; }
.th-toast.is-show { transform: translate(-50%, 0); }

/* Inline field (number + unit), per-file options */
.th-inline { display: flex; gap: 8px; }
.th-inline > .th-input { flex: 1 1 auto; min-width: 0; }
.th-inline > .th-select { flex: 0 0 96px; }
.th-row-opt { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.th-row-opt > span { font-size: 13px; font-weight: 700; }
.th-mini { padding: 6px 8px; min-height: 36px; border: 2px solid var(--line); border-radius: 8px; background: #fff; font-size: 14px; color: var(--ink); max-width: 100%; }
.th-mini:focus { border-color: var(--teal); outline: 0; }
input.th-mini { width: 96px; }
.th-file.is-working { border-color: var(--yolk); }

/* ---------- First-fold layout for tool pages ----------
   Goal: upload box, options, file list and the main button all visible
   without scrolling on laptops, desktops and tablets. */
.is-tool-page .wrap { padding-top: 12px; }
.is-tool-page .breadcrumbs { margin-bottom: 4px; font-size: 12.5px; }
.is-tool-page .hd { margin-bottom: 14px; }
.is-tool-page .hd h1 { font-size: clamp(24px, 2.6vw + 10px, 34px); }
.is-tool-page .hd p { margin-top: 4px; font-size: 15px; }
.is-tool-page .ad-slot--tool_top { margin: 0 auto 14px; }
.tool-shell { padding: 16px; }

.th-tool { gap: 12px; }
.th-dropzone { padding: 18px 14px; gap: 2px; }
.th-dropzone__icon { width: 42px; height: 42px; margin-bottom: 6px; }
.th-dropzone__icon svg { width: 22px; height: 22px; }
.th-dropzone__title { font-size: 16px; }
.th-dropzone::after { margin-top: 8px; padding: 7px 16px; font-size: 15px; }
.th-dropzone__hint { font-size: 12.5px; padding-top: 6px; }
.th-dropzone--compact { padding: 10px 14px; }
.th-panel { gap: 10px; }
.th-field { gap: 5px; }
.th-field__label { font-size: 13.5px; }
.th-field__help { font-size: 12.5px; }
.th-input, .th-select { min-height: 40px; padding: 7px 10px; }
.th-range { height: 30px; }
.th-checks { gap: 6px; }
.th-check { padding: 5px 9px; font-size: 13.5px; }
.th-seg { gap: 6px; }
.th-seg button { min-width: 52px; min-height: 36px; padding: 4px 8px; font-size: 14px; }
.th-file { padding: 7px; gap: 10px; grid-template-columns: 44px minmax(0, 1fr) auto; }
.th-file__thumb { width: 44px; height: 44px; }
.th-file__name { font-size: 14.5px; }
.th-row-opt { margin-top: 4px; }
.th-filelist { padding: 12px; gap: 8px; }
.th-filelist::before { font-size: 18px; }
.th-filelist:empty::after { padding: 24px 12px; }
.th-summary { padding: 10px 12px; gap: 8px; }
.th-summary .th-btn { min-height: 40px; padding: 7px 14px; }

/* The action bar (Compress / Convert / ZIP) stays reachable while scrolling a long list */
.th-tool > .th-summary { position: sticky; bottom: 8px; z-index: 5; box-shadow: 0 6px 20px #12302f26; background: #fff; }

/* Two columns from tablet width: options left, "Your files" + buttons right */
@media (min-width: 700px) {
	.th-tool:has(> .th-filelist) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 16px; align-items: start; }
	.th-tool:has(> .th-filelist) > * { grid-column: 1; }
	.th-tool:has(> .th-filelist) > .th-filelist {
		grid-column: 2; grid-row: 1 / span 3;
		/* height that leaves room for header, title and the button bar */
		height: clamp(240px, calc(100vh - var(--head) - 300px), 560px);
		height: clamp(240px, calc(100dvh - var(--head) - 300px), 560px);
		max-height: none; min-height: 0;
	}
	.th-tool:has(> .th-filelist) > .th-summary { grid-column: 2; grid-row: 4; position: static; box-shadow: none; background: var(--soft); }
}
@media (min-width: 700px) and (max-height: 700px) {
	.is-tool-page .hd p { display: none; }
}
@media (max-width: 480px) {
	.th-file { grid-template-columns: 48px minmax(0, 1fr); }
	.th-file__thumb { width: 48px; height: 48px; }
	.th-file__actions { grid-column: 1 / -1; justify-content: flex-end; }
	.th-summary { flex-direction: column; align-items: stretch; }
	.th-summary__text { font-size: 13.5px; }
	.th-summary__actions { flex-wrap: nowrap; gap: 6px; }
	.th-summary__actions .th-btn { flex: 1 1 auto; padding: 6px 8px; font-size: 14px; }
	.th-summary__actions .th-btn svg { display: none; }
	.tool-shell { padding: 14px; border-radius: 18px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 2s !important; transition-duration: .01ms !important; } }
