/* ==========================================================================
   ToolNest — plugin styles (grid, tool pages, tool UIs)
   ========================================================================== */

:root {
	--tn-primary: #5b5bd6;
	--tn-primary-dark: #4646b8;
	--tn-primary-soft: #eeeefc;
	--tn-ink: #15192b;
	--tn-ink-soft: #555d7a;
	--tn-line: #e4e7f2;
	--tn-bg: #f6f7fb;
	--tn-card: #ffffff;
	--tn-ok: #16a34a;
	--tn-err: #dc2626;
	--tn-radius: 14px;
	--tn-shadow: 0 1px 2px rgba(21, 25, 43, .05), 0 8px 24px -12px rgba(21, 25, 43, .12);
	--tn-shadow-lift: 0 2px 4px rgba(21, 25, 43, .06), 0 16px 32px -12px rgba(91, 91, 214, .25);
}

.tn-wrap {
	max-width: 1120px;
	margin: 0 auto;
	padding: 0 20px 64px;
	color: var(--tn-ink);
	font-size: 16px;
	line-height: 1.65;
}

.tn-wrap *, .tn-wrap *::before, .tn-wrap *::after { box-sizing: border-box; }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.tn-hero { text-align: center; padding: 56px 0 36px; }

.tn-hero__title {
	font-size: clamp(2rem, 4.5vw, 3.1rem);
	line-height: 1.12;
	font-weight: 800;
	letter-spacing: -.02em;
	margin: 0 0 18px;
}

.tn-hero__title span {
	background: linear-gradient(100deg, var(--tn-primary), #9333ea 70%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.tn-hero__sub {
	max-width: 640px;
	margin: 0 auto 28px;
	color: var(--tn-ink-soft);
	font-size: 1.06rem;
}

.tn-search {
	position: relative;
	max-width: 560px;
	margin: 0 auto 22px;
}

.tn-search svg {
	position: absolute;
	left: 18px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--tn-ink-soft);
	pointer-events: none;
}

.tn-search input {
	width: 100%;
	padding: 16px 20px 16px 50px;
	font-size: 1rem;
	border: 1px solid var(--tn-line);
	border-radius: 999px;
	background: var(--tn-card);
	color: var(--tn-ink);
	box-shadow: var(--tn-shadow);
	outline: none;
	transition: border-color .15s, box-shadow .15s;
}

.tn-search input:focus {
	border-color: var(--tn-primary);
	box-shadow: 0 0 0 4px var(--tn-primary-soft), var(--tn-shadow);
}

.tn-cats {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
}

.tn-cats a {
	display: inline-block;
	padding: 7px 16px;
	font-size: .86rem;
	font-weight: 600;
	color: var(--tn-ink-soft);
	background: var(--tn-card);
	border: 1px solid var(--tn-line);
	border-radius: 999px;
	text-decoration: none;
	transition: all .15s;
}

.tn-cats a:hover {
	color: var(--tn-primary);
	border-color: var(--tn-primary);
	background: var(--tn-primary-soft);
}

/* --------------------------------------------------------------------------
   Sections & cards
   -------------------------------------------------------------------------- */

.tn-section { margin-top: 44px; scroll-margin-top: 90px; }

.tn-section__title {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 1.35rem;
	font-weight: 750;
	letter-spacing: -.01em;
	margin: 0 0 18px;
}

.tn-section__count {
	font-size: .75rem;
	font-weight: 700;
	color: var(--tn-primary);
	background: var(--tn-primary-soft);
	padding: 3px 10px;
	border-radius: 999px;
}

.tn-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 14px;
}

.tn-card {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 20px 18px;
	background: var(--tn-card);
	border: 1px solid var(--tn-line);
	border-radius: var(--tn-radius);
	text-decoration: none;
	color: var(--tn-ink);
	box-shadow: var(--tn-shadow);
	transition: transform .15s, box-shadow .15s, border-color .15s;
}

.tn-card:hover {
	transform: translateY(-3px);
	border-color: var(--tn-primary);
	box-shadow: var(--tn-shadow-lift);
}

.tn-card__icon { color: var(--tn-primary); }

.tn-card__name { font-weight: 700; font-size: .98rem; line-height: 1.3; }

.tn-card__desc { font-size: .82rem; color: var(--tn-ink-soft); line-height: 1.45; }

.tn-empty { text-align: center; color: var(--tn-ink-soft); padding: 40px 0; font-size: 1.05rem; }

/* --------------------------------------------------------------------------
   Homepage about block
   -------------------------------------------------------------------------- */

.tn-home-about {
	margin-top: 64px;
	padding: 36px;
	background: var(--tn-card);
	border: 1px solid var(--tn-line);
	border-radius: var(--tn-radius);
}

.tn-home-about h2 { margin-top: 0; font-size: 1.5rem; letter-spacing: -.01em; }
.tn-home-about h3 { font-size: 1.15rem; }
.tn-home-about li { margin-bottom: 6px; }

/* --------------------------------------------------------------------------
   Tool page
   -------------------------------------------------------------------------- */

.tn-breadcrumb {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	font-size: .85rem;
	color: var(--tn-ink-soft);
	padding: 22px 0 6px;
}

.tn-breadcrumb a { color: var(--tn-primary); text-decoration: none; font-weight: 600; }
.tn-breadcrumb a:hover { text-decoration: underline; }
.tn-breadcrumb__current { font-weight: 600; color: var(--tn-ink); }

.tn-tool-head {
	display: flex;
	gap: 16px;
	align-items: center;
	padding: 14px 0 22px;
}

.tn-tool-head__icon {
	flex: 0 0 auto;
	display: grid;
	place-items: center;
	width: 64px;
	height: 64px;
	color: var(--tn-primary);
	background: var(--tn-primary-soft);
	border-radius: 16px;
}

.tn-tool-head__title { margin: 0 0 4px; font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.015em; }
.tn-tool-head__desc { margin: 0; color: var(--tn-ink-soft); }

.tn-privacy {
	text-align: center;
	font-size: .88rem;
	color: var(--tn-ink-soft);
	margin: 14px 0 0;
}

/* --------------------------------------------------------------------------
   The tool app card
   -------------------------------------------------------------------------- */

.tn-app {
	background: var(--tn-card);
	border: 1px solid var(--tn-line);
	border-radius: var(--tn-radius);
	box-shadow: var(--tn-shadow);
	padding: 26px;
}

/* Drop zone */
.tn-drop {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 170px;
	padding: 28px;
	text-align: center;
	border: 2px dashed #c9cdf0;
	border-radius: 12px;
	background: #fafbff;
	color: var(--tn-ink-soft);
	cursor: pointer;
	transition: border-color .15s, background .15s;
}

.tn-drop:hover, .tn-drop.tn-drop--over {
	border-color: var(--tn-primary);
	background: var(--tn-primary-soft);
}

.tn-drop strong { color: var(--tn-ink); font-size: 1.05rem; }
.tn-drop input[type="file"] { display: none; }
.tn-drop__hint { font-size: .82rem; }

/* File list / thumbnails */
.tn-files { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 0; }

.tn-thumb {
	position: relative;
	width: 110px;
	border: 1px solid var(--tn-line);
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
}

.tn-thumb img { width: 100%; height: 80px; object-fit: cover; display: block; }
.tn-thumb__label {
	display: block;
	font-size: .68rem;
	padding: 5px 6px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: var(--tn-ink-soft);
}

.tn-thumb__x {
	position: absolute;
	top: 4px;
	right: 4px;
	width: 22px;
	height: 22px;
	border: 0;
	border-radius: 50%;
	background: rgba(21, 25, 43, .75);
	color: #fff;
	font-size: 13px;
	line-height: 1;
	cursor: pointer;
}

.tn-filerow {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 10px 14px;
	border: 1px solid var(--tn-line);
	border-radius: 10px;
	font-size: .9rem;
	background: #fff;
}

.tn-filerow__name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.tn-filerow__meta { color: var(--tn-ink-soft); font-size: .8rem; }

/* Controls */
.tn-controls {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	align-items: flex-end;
	margin-top: 18px;
}

.tn-field { display: flex; flex-direction: column; gap: 6px; min-width: 150px; flex: 1; }
.tn-field--sm { flex: 0 1 150px; min-width: 120px; }
.tn-field label { font-size: .8rem; font-weight: 700; color: var(--tn-ink-soft); text-transform: uppercase; letter-spacing: .04em; }

.tn-field input[type="text"],
.tn-field input[type="number"],
.tn-field input[type="url"],
.tn-field input[type="datetime-local"],
.tn-field select,
.tn-field textarea {
	padding: 10px 12px;
	border: 1px solid var(--tn-line);
	border-radius: 9px;
	font-size: .95rem;
	font-family: inherit;
	color: var(--tn-ink);
	background: #fff;
	outline: none;
	transition: border-color .15s, box-shadow .15s;
}

.tn-field input:focus, .tn-field select:focus, .tn-field textarea:focus {
	border-color: var(--tn-primary);
	box-shadow: 0 0 0 3px var(--tn-primary-soft);
}

.tn-field input[type="range"] { accent-color: var(--tn-primary); }
.tn-field--check { flex-direction: row; align-items: center; gap: 8px; }
.tn-field--check label { text-transform: none; letter-spacing: 0; font-size: .9rem; font-weight: 600; color: var(--tn-ink); }

textarea.tn-textarea {
	width: 100%;
	min-height: 180px;
	padding: 14px;
	border: 1px solid var(--tn-line);
	border-radius: 10px;
	font-size: .92rem;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	line-height: 1.55;
	color: var(--tn-ink);
	background: #fff;
	resize: vertical;
	outline: none;
}

textarea.tn-textarea:focus { border-color: var(--tn-primary); box-shadow: 0 0 0 3px var(--tn-primary-soft); }

/* Buttons */
.tn-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 13px 26px;
	font-size: .98rem;
	font-weight: 700;
	font-family: inherit;
	color: #fff;
	background: linear-gradient(120deg, var(--tn-primary), var(--tn-primary-dark));
	border: 0;
	border-radius: 10px;
	cursor: pointer;
	box-shadow: 0 4px 14px -4px rgba(91, 91, 214, .5);
	transition: transform .12s, box-shadow .12s, opacity .12s;
}

.tn-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -6px rgba(91, 91, 214, .6); }
.tn-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.tn-btn--ghost {
	background: #fff;
	color: var(--tn-primary);
	border: 1px solid var(--tn-primary);
	box-shadow: none;
}

.tn-btn--sm { padding: 8px 16px; font-size: .85rem; }

.tn-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }

/* Output / status */
.tn-out { margin-top: 20px; }

.tn-status {
	margin-top: 16px;
	padding: 12px 16px;
	border-radius: 10px;
	font-size: .9rem;
	font-weight: 600;
}

.tn-status--ok { background: #ecfdf5; color: var(--tn-ok); border: 1px solid #bbf7d0; }
.tn-status--err { background: #fef2f2; color: var(--tn-err); border: 1px solid #fecaca; }
.tn-status--busy { background: var(--tn-primary-soft); color: var(--tn-primary-dark); border: 1px solid #d6d6f5; }

.tn-progress { height: 8px; background: var(--tn-line); border-radius: 99px; overflow: hidden; margin-top: 14px; }
.tn-progress__bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--tn-primary), #9333ea); transition: width .2s; }

.tn-result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 16px; }
.tn-result-grid figure { margin: 0; border: 1px solid var(--tn-line); border-radius: 10px; overflow: hidden; background: #fff; }
.tn-result-grid img, .tn-result-grid canvas { width: 100%; display: block; }
.tn-result-grid figcaption { padding: 8px; text-align: center; }

.tn-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-top: 18px; }
.tn-stat {
	background: #fafbff;
	border: 1px solid var(--tn-line);
	border-radius: 10px;
	padding: 14px;
	text-align: center;
}
.tn-stat b { display: block; font-size: 1.5rem; color: var(--tn-primary); letter-spacing: -.02em; }
.tn-stat span { font-size: .78rem; color: var(--tn-ink-soft); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }

.tn-code {
	display: block;
	width: 100%;
	margin-top: 14px;
	padding: 14px;
	background: #14172b;
	color: #d6e2ff;
	border-radius: 10px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: .85rem;
	line-height: 1.55;
	white-space: pre-wrap;
	word-break: break-all;
	max-height: 360px;
	overflow: auto;
}

.tn-note { font-size: .85rem; color: var(--tn-ink-soft); margin-top: 10px; }

/* Canvas preview (crop, filters) */
.tn-canvas-wrap { margin-top: 16px; text-align: center; }
.tn-canvas-wrap canvas { max-width: 100%; border: 1px solid var(--tn-line); border-radius: 10px; }

/* SERP preview */
.tn-serp {
	margin-top: 16px;
	padding: 18px 20px;
	border: 1px solid var(--tn-line);
	border-radius: 10px;
	background: #fff;
	font-family: Arial, sans-serif;
	max-width: 600px;
}
.tn-serp__url { color: #202124; font-size: .8rem; }
.tn-serp__title { color: #1a0dab; font-size: 1.22rem; line-height: 1.3; margin: 3px 0; }
.tn-serp__desc { color: #4d5156; font-size: .88rem; line-height: 1.5; }

/* Audio player */
.tn-app audio { width: 100%; margin-top: 14px; }
.tn-wave { width: 100%; height: 90px; background: #fafbff; border: 1px solid var(--tn-line); border-radius: 10px; margin-top: 14px; }

/* --------------------------------------------------------------------------
   Article, table, FAQ
   -------------------------------------------------------------------------- */

.tn-article {
	margin-top: 36px;
	background: var(--tn-card);
	border: 1px solid var(--tn-line);
	border-radius: var(--tn-radius);
	padding: 36px;
}

.tn-article h2 { font-size: 1.45rem; letter-spacing: -.01em; margin: 1.6em 0 .6em; }
.tn-article h2:first-child { margin-top: 0; }
.tn-article h3 { font-size: 1.12rem; margin: 1.4em 0 .5em; }
.tn-article p { margin: 0 0 1em; }
.tn-article li { margin-bottom: 7px; }
.tn-article ol, .tn-article ul { padding-left: 24px; margin: 0 0 1.1em; }

.tn-table-wrap { overflow-x: auto; margin: 8px 0 4px; }

.tn-table {
	width: 100%;
	border-collapse: collapse;
	font-size: .92rem;
	border: 1px solid var(--tn-line);
	border-radius: 10px;
	overflow: hidden;
}

.tn-table th {
	background: var(--tn-primary-soft);
	color: var(--tn-primary-dark);
	text-align: left;
	font-weight: 700;
	padding: 11px 14px;
	border-bottom: 2px solid #d6d6f5;
}

.tn-table td { padding: 10px 14px; border-bottom: 1px solid var(--tn-line); vertical-align: top; }
.tn-table tr:nth-child(even) td { background: #fafbff; }
.tn-table tr:last-child td { border-bottom: 0; }

.tn-faq { margin-top: 28px; }
.tn-faq h2 { font-size: 1.45rem; }

.tn-faq__item {
	border: 1px solid var(--tn-line);
	border-radius: 10px;
	margin-bottom: 10px;
	background: #fff;
	overflow: hidden;
}

.tn-faq__item summary {
	padding: 14px 18px;
	font-weight: 700;
	font-size: .96rem;
	cursor: pointer;
	list-style: none;
	position: relative;
	padding-right: 40px;
}

.tn-faq__item summary::-webkit-details-marker { display: none; }

.tn-faq__item summary::after {
	content: "+";
	position: absolute;
	right: 16px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 1.3rem;
	color: var(--tn-primary);
	font-weight: 400;
}

.tn-faq__item[open] summary::after { content: "–"; }
.tn-faq__item[open] summary { border-bottom: 1px solid var(--tn-line); }
.tn-faq__item p { padding: 12px 18px; margin: 0; color: var(--tn-ink-soft); font-size: .93rem; }

/* Related */
.tn-related { margin-top: 40px; }

/* Ads */
.tn-ad { margin: 26px 0; text-align: center; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 640px) {
	.tn-hero { padding: 36px 0 24px; }
	.tn-app, .tn-article, .tn-home-about { padding: 20px; }
	.tn-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
	.tn-card { padding: 14px 12px; }
	.tn-card__desc { display: none; }
	.tn-controls { flex-direction: column; align-items: stretch; }
	.tn-field { min-width: 0; }
}
