@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ToolSala shell: sidebar layout and the palette every tool inherits.
 * Only the frame is styled here — each tool keeps its own markup and script. */

:root {
	--tk-primary: #0b84ff !important;
	--tk-secondary: #0b84ff !important;
	--tk-bg: #ffffff !important;
	--tk-surface: #ffffff !important;
	--tk-surface-2: #f7f7f8 !important;
	--tk-surface-3: #ececec !important;
	--tk-text: #0d0d0d !important;
	--tk-text-dim: #8f8f8f !important;
	--tk-border: #dcdcdc !important;
	--tk-header-bg: rgb(255 255 255 / .86) !important;
	--tk-radius: 12px !important;
	--tk-shadow: 0 1px 2px rgb(0 0 0 / .04), 0 8px 24px -16px rgb(0 0 0 / .18) !important;
	--tk-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;

	--tk-side: #f9f9f9;
	--tk-side-width: 224px;
	--tk-hover: #ececec;
	--tk-active: #e6e6e6;
	--tk-icon: #5d5d5d;
}

html.dark {
	--tk-bg: #212121 !important;
	--tk-surface: #262626 !important;
	--tk-surface-2: #2f2f2f !important;
	--tk-surface-3: #3a3a3a !important;
	--tk-text: #ececec !important;
	--tk-text-dim: #9b9b9b !important;
	--tk-border: #3a3a3a !important;
	--tk-header-bg: rgb(33 33 33 / .86) !important;

	--tk-side: #171717;
	--tk-hover: #2f2f2f;
	--tk-active: #343434;
	--tk-icon: #b4b4b4;
}

.tk-body {
	background: var(--tk-bg);
	color: var(--tk-text);
	font-family: var(--tk-font-family);
	-webkit-font-smoothing: antialiased;
}

/* ---- frame ------------------------------------------------------------- */
.tk-body.tk-has-shell {
	display: grid;
	min-height: 100vh;
	grid-template-columns: var(--tk-side-width) minmax(0, 1fr);
	grid-template-rows: auto 1fr auto;
}
.tk-has-shell > .tk-side { grid-area: 1 / 1 / 4 / 2; }
.tk-has-shell > .tk-topbar { grid-area: 1 / 2 / 2 / 3; }
.tk-has-shell > .tk-main { grid-area: 2 / 2 / 3 / 3; min-width: 0; }
.tk-has-shell > .tk-footer { grid-area: 3 / 2 / 4 / 3; }
.tk-has-shell > .tk-header { display: none; }

/* ---- sidebar ----------------------------------------------------------- */
.tk-side {
	position: sticky;
	top: 0;
	display: flex;
	height: 100vh;
	flex-direction: column;
	border-right: 1px solid var(--tk-border);
	background: var(--tk-side);
}
.tk-side a { color: inherit; text-decoration: none; }
.tk-side svg { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.tk-side-brand { display: flex; align-items: center; gap: 10px; padding: 16px 14px; border-bottom: 1px solid var(--tk-border); }
.tk-side-brand img { width: auto; max-width: 132px; height: 30px; object-fit: contain; }
.tk-side-mark { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 10px; background: var(--tk-text); color: var(--tk-bg); font-size: 16px; font-weight: 700; }
.tk-side-name { font-size: 18px; font-weight: 650; letter-spacing: -.015em; }

.tk-side-scroll { flex: 1; padding: 8px 8px 14px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.tk-side-scroll::-webkit-scrollbar { width: 6px; }
.tk-side-scroll::-webkit-scrollbar-thumb { border-radius: 99px; background: color-mix(in srgb, var(--tk-text) 18%, transparent); }

.tk-side-label { padding: 14px 10px 6px; color: var(--tk-text-dim); font-size: 12px; font-weight: 500; }

.tk-side-link {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 34px;
	padding: 0 10px;
	border-radius: 9px;
	color: var(--tk-text);
	font-size: 13.5px;
	line-height: 1.3;
}
.tk-side-link svg { color: var(--tk-icon); }
.tk-side-link > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-side-link:hover { background: var(--tk-hover); }
.tk-side-link.is-active { background: var(--tk-active); font-weight: 600; }
.tk-side-link.is-active svg { color: var(--tk-text); }

.tk-side-group summary { list-style: none; cursor: pointer; }
.tk-side-group summary::-webkit-details-marker { display: none; }
.tk-side-caret { width: 14px !important; height: 14px !important; margin-left: auto; color: color-mix(in srgb, var(--tk-text) 35%, transparent); transition: transform .15s ease; }
.tk-side-group[open] > summary .tk-side-caret { transform: rotate(90deg); }
.tk-side-sub { display: grid; padding: 2px 0 6px 38px; }
.tk-side-sub a { overflow: hidden; padding: 6px 8px 6px 0; color: color-mix(in srgb, var(--tk-text) 68%, transparent); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.tk-side-sub a:hover { color: var(--tk-text); }

.tk-side-foot { padding: 8px; border-top: 1px solid var(--tk-border); }
.tk-side-foot .tk-side-link { width: 100%; border: 0; background: transparent; font-family: inherit; cursor: pointer; }
.tk-side-user { display: flex; align-items: center; gap: 9px; padding: 7px 8px; }
.tk-side-user b { font-size: 13px; font-weight: 600; }
.tk-side-user small { color: var(--tk-text-dim); font-size: 11.5px; }

/* ---- top bar ----------------------------------------------------------- */
.tk-topbar {
	position: sticky;
	top: 0;
	z-index: 30;
	display: none;
	align-items: center;
	gap: 10px;
	height: 54px;
	padding: 0 12px;
	border-bottom: 1px solid var(--tk-border);
	background: var(--tk-header-bg);
	backdrop-filter: blur(8px);
}
.tk-topbar .tk-side-mark { width: 28px; height: 28px; border-radius: 8px; font-size: 13px; }
.tk-topbar .tk-side-name { font-size: 16px; }
.tk-topbar .tk-icon-btn { display: grid; width: 34px; height: 34px; place-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--tk-text-dim); cursor: pointer; }
.tk-topbar .tk-icon-btn:hover { background: var(--tk-hover); color: var(--tk-text); }
.tk-topbar .tk-icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#tk-nav-toggle { display: none; }

/* ---- content ----------------------------------------------------------- */
.tk-has-shell > .tk-main { padding-top: 12px; padding-bottom: 46px; }
.tk-has-shell > .tk-footer { border-top: 1px solid var(--tk-border); background: var(--tk-bg); }

/* ---- mobile ------------------------------------------------------------ */
@media (max-width: 900px) {
	.tk-body.tk-has-shell { grid-template-columns: minmax(0, 1fr); }
	.tk-has-shell > .tk-side {
		position: fixed;
		z-index: 80;
		top: 0;
		left: 0;
		width: 280px;
		transform: translateX(-100%);
		transition: transform .2s ease;
	}
	.tk-has-shell > .tk-side.is-open { transform: none; box-shadow: 0 0 0 100vmax rgb(0 0 0 / .32); }
	.tk-has-shell > .tk-topbar,
	.tk-has-shell > .tk-main,
	.tk-has-shell > .tk-footer { grid-column: 1 / -1; }
	.tk-topbar { display: flex; }
	#tk-nav-toggle { display: grid; }
	.tk-has-shell > .tk-main { padding-top: 6px; }
}

/* one icon at a time on the theme button, whatever the tool stylesheets do */
html:not(.dark) .tk-side-foot .tk-moon { display: none; }
html.dark .tk-side-foot .tk-sun { display: none; }

/* mobile header brand */
.tk-topbar-brand { display: flex; align-items: center; gap: 9px; color: inherit; text-decoration: none; }
.tk-topbar-brand img { width: auto; max-width: 120px; height: 26px; object-fit: contain; }

/* ---- QR code generator ---------------------------------------------------
 * Three cards in the order a phone needs them: pick a type, fill it in, see the
 * code, with the design studio folded away behind the palette button. On a wide
 * screen the grid puts the first and third card back into the left column and
 * these rules seam them into the single panel they have always been, so the
 * desktop layout does not move.
 *
 * Every selector is qualified with .tk-qr-workspace on purpose. Tailwind writes
 * its utilities into the page at runtime, after this file, so a single class
 * here loses to flex-wrap, grid-cols-2 and friends on equal specificity. Two
 * classes win regardless of order. */

@media ( min-width: 1024px ) {
	.tk-qr-workspace .tk-qr-layout { row-gap: 0; }
	/* Placed rather than auto flowed: the preview keeps its own tall height
	 * without that height deciding how far down the design studio starts. */
	.tk-qr-workspace .tk-qr-fields { grid-column: 1; grid-row: 1; }
	.tk-qr-workspace .tk-qr-design { grid-column: 1; grid-row: 2; }
	.tk-qr-workspace .tk-qr-preview { grid-column: 2; grid-row: 1 / span 2; }
	.tk-qr-workspace .tk-qr-fields { border-bottom: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
	.tk-qr-workspace .tk-qr-design { border-top-left-radius: 0; border-top-right-radius: 0; }
	/* The phone-only pieces the wide layout never wanted. */
	.tk-qr-workspace .tk-qr-theme-slot { display: none; }
	.tk-qr-workspace #qr-design-toggle { display: none; }
	.tk-qr-workspace .tk-qr-design > summary { pointer-events: none; }
	.tk-qr-workspace .tk-qr-tabs .tk-chip svg,
	.tk-qr-workspace .tk-qr-actions .tk-btn svg { display: none; }
}

/* The design studio folds. Its summary already carries the card head styling. */
.tk-qr-workspace .tk-qr-design > summary { list-style: none; cursor: pointer; }
.tk-qr-workspace .tk-qr-design > summary::-webkit-details-marker { display: none; }

@media ( max-width: 1023px ) {
	.tk-qr-workspace { padding-right: 12px; padding-left: 12px; }
	.tk-qr-workspace .tk-qr-layout { grid-template-columns: minmax( 0, 1fr ); gap: 10px; }
	.tk-qr-workspace .tk-qr-layout > * { min-width: 0; }
	.tk-qr-workspace .tk-qr-fields,
	.tk-qr-workspace .tk-qr-preview,
	.tk-qr-workspace .tk-qr-design { padding: 14px; }

	/* Seven types wrapped onto three rows of pills. One flat scrolling row of
	 * icons reads faster and costs a third of the height. */
	.tk-qr-workspace .tk-qr-tabs { flex-wrap: nowrap; gap: 2px; margin: -2px -14px 14px; padding: 2px 10px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
	.tk-qr-workspace .tk-qr-tabs::-webkit-scrollbar { display: none; }
	.tk-qr-workspace .tk-qr-tabs .tk-chip { display: grid; width: 64px; flex: 0 0 auto; justify-items: center; gap: 5px; padding: 9px 4px 8px; border: 0; border-radius: 12px; background: transparent; font-size: 11px; font-weight: 650; }
	.tk-qr-workspace .tk-qr-tabs .tk-chip svg { width: 21px; height: 21px; }
	.tk-qr-workspace .tk-qr-tabs .tk-chip:hover { background: var( --tk-surface-2 ); }
	.tk-qr-workspace .tk-qr-tabs .tk-chip.is-active { background: var( --tk-surface-3 ); color: var( --tk-text ); }

	/* One clear question, and a pill to answer it in. */
	.tk-qr-workspace .tk-qr-fields .tk-label { color: var( --tk-text ); font-size: 15px; font-weight: 750; letter-spacing: -.01em; }
	.tk-qr-workspace .tk-qr-fields .tk-input { height: 46px; padding-right: 18px; padding-left: 18px; border-radius: 999px; }
	.tk-qr-workspace .tk-qr-fields .tk-textarea { padding: 13px 18px; border-radius: 18px; }

	/* The code on the left, its presets standing beside it, actions underneath. */
	.tk-qr-workspace .tk-qr-preview { display: grid; grid-template-columns: minmax( 0, 1fr ) auto; align-items: start; gap: 10px; }
	.tk-qr-workspace .tk-qr-preview > .tk-qr-preview-head { grid-column: 1 / -1; margin-bottom: 0; }
	.tk-qr-workspace .tk-qr-preview > .tk-qr-preview-stage { grid-column: 1; min-height: 0; padding: 12px; border: 1px solid var( --tk-border ); background: var( --tk-surface ) !important; background-image: none; }
	.tk-qr-workspace .tk-qr-preview > .tk-qr-theme-slot { grid-column: 2; }
	.tk-qr-workspace .tk-qr-preview > .tk-qr-actions { grid-column: 1 / -1; margin-top: 2px; }
	.tk-qr-workspace .tk-qr-preview canvas { max-width: 100%; max-height: none; }

	.tk-qr-workspace .tk-qr-theme-slot .tk-label { display: none; }
	.tk-qr-workspace .tk-qr-theme-slot .tk-qr-theme-block { margin: 0; }
	.tk-qr-workspace .tk-qr-theme-slot #qr-themes { display: flex; max-height: 252px; flex-direction: column; gap: 7px; overflow-y: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
	.tk-qr-workspace .tk-qr-theme-slot #qr-themes::-webkit-scrollbar { display: none; }
	.tk-qr-workspace .tk-qr-theme-slot #qr-themes button { width: 56px; flex: 0 0 auto; padding: 7px 4px 6px; font-size: 8.5px; }

	/* One wide action and three square ones, labels kept for screen readers. */
	.tk-qr-workspace .tk-qr-actions { grid-template-columns: minmax( 0, 1fr ) 44px 44px 44px; margin-top: 2px; gap: 7px; }
	.tk-qr-workspace .tk-qr-actions #qr-dl-png,
	.tk-qr-workspace .tk-qr-actions #qr-copy { grid-column: auto; }
	.tk-qr-workspace .tk-qr-actions #qr-design-toggle { order: 3; }
	.tk-qr-workspace .tk-qr-actions #qr-dl-svg,
	.tk-qr-workspace .tk-qr-actions #qr-copy,
	.tk-qr-workspace .tk-qr-actions #qr-design-toggle { display: grid; padding: 0; place-items: center; }
	.tk-qr-workspace .tk-qr-actions .tk-btn svg { width: 19px; height: 19px; }
	.tk-qr-workspace .tk-qr-actions #qr-dl-svg span,
	.tk-qr-workspace .tk-qr-actions #qr-copy span,
	.tk-qr-workspace .tk-qr-actions #qr-design-toggle span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset( 50% ); }

	/* Folded, the studio is one thin row that the palette button opens. */
	.tk-qr-workspace .tk-qr-design > summary { margin-bottom: 0; align-items: center; }
	.tk-qr-workspace .tk-qr-design > summary::after { width: 8px; height: 8px; border-right: 2px solid var( --tk-text-dim ); border-bottom: 2px solid var( --tk-text-dim ); content: ''; transform: rotate( 45deg ) translate( -2px, -2px ); }
	.tk-qr-workspace .tk-qr-design[open] > summary { margin-bottom: 13px; }
	.tk-qr-workspace .tk-qr-design[open] > summary::after { transform: rotate( -135deg ); }

	/* Two columns for the short paired controls keeps the panel half as tall. */
	.tk-qr-workspace .tk-qr-design .tk-qr-pairs { grid-template-columns: 1fr 1fr; gap: 10px; }
	.tk-qr-workspace .tk-qr-design .tk-qr-pairs > * { min-width: 0; }
	.tk-qr-workspace .tk-qr-design .tk-qr-pairs > :has( #qr-logo ) { grid-column: 1 / -1; }
	.tk-qr-workspace .tk-qr-design .tk-qr-pairs .tk-input { min-width: 0; }
}

@media ( max-width: 400px ) {
	.tk-qr-workspace .tk-qr-design .tk-qr-pairs > :has( #qr-accent ),
	.tk-qr-workspace .tk-qr-design .tk-qr-pairs > :has( #qr-fg ),
	.tk-qr-workspace .tk-qr-design .tk-qr-pairs > :has( #qr-bg ) { grid-column: 1 / -1; }
}

/* ---- tool page headings ---------------------------------------------------
 * Every tool page carries .tk-tool-heading, but each family grew its own icon
 * box over time: 43, 50, 56, 57, 58 pixels, and a 29 pixel title. One size for
 * all of them, and a smaller one, so the tool itself starts higher up the page.
 *
 * The icon selector picks the single direct child that holds the glyph, so it
 * works whatever that family called it: tk-compact-tool-icon, tk-pdf-utility-icon,
 * tk-calc-page-icon, tk-inf-icon, tk-yt-icon, tk-intel-page-icon, tk-bg-page-icon
 * or a bare span. Checked against every tool page: exactly one match on each.
 *
 * Qualified with .tk-body because the title rule it replaces is !important, and
 * because Tailwind writes its own utilities into the page after this file. */

.tk-body .tk-tool-heading h1 { font-size: clamp( 18px, 1.8vw, 21px ) !important; letter-spacing: -.028em !important; }
.tk-body .tk-tool-heading > :has( > svg ) { width: 34px; height: 34px; border-radius: 10px; }
.tk-body .tk-tool-heading > :has( > svg ) > svg { width: 18px; height: 18px; }

@media ( max-width: 700px ) {
	.tk-body .tk-tool-heading h1 { font-size: 18px !important; }
	.tk-body .tk-tool-heading > :has( > svg ) { width: 30px; height: 30px; border-radius: 9px; }
	.tk-body .tk-tool-heading > :has( > svg ) > svg { width: 16px; height: 16px; }
}

/* ---- tool headings: the icon centres on its title --------------------------
 * Each family pinned its icon to a different edge: the bottom on QR Code
 * Generator and Convert Case, the top on phones for the image, IP and
 * background remover tools. Domain Lookup stacked the icon above its title and
 * the SEO analyzer turned the row into a column on phones. With the smaller
 * heading all of that reads as an icon sitting above or below its title.
 *
 * Where the title has a line above it (the YouTube and India finder kicker) or
 * below it (a tagline), its wrapper is opened up with display: contents so the
 * icon shares the title's own grid row and stays centred on the title however
 * the other lines wrap. Document Writer and Google Review QR never carried
 * .tk-tool-heading, so they get the shared icon and title size here as well. */

.tk-body .tk-tool-heading:not( .tk-sa-heading ) { align-items: center; }
.tk-body .tk-tool-heading h1 { margin: 0 !important; }
.tk-body .tk-domain-intro.tk-tool-heading { display: flex; gap: 10px; }
.tk-body .tk-pdf-utility-head.tk-tool-heading > .tk-pdf-utility-icon { width: 34px; height: 34px; border-radius: 10px; }

.tk-body :is( .tk-yt-heading, .tk-inf-heading, .tk-photo-editor-heading, .tk-gr-heading, .tk-doc-title ) > div { display: contents; }

/* a kicker above the title and a tagline below it */
.tk-body :is( .tk-yt-heading, .tk-inf-heading ).tk-tool-heading { row-gap: 0; }
.tk-body :is( .tk-yt-heading, .tk-inf-heading ).tk-tool-heading > div > p { grid-area: 1 / 2; }
.tk-body :is( .tk-yt-heading, .tk-inf-heading ).tk-tool-heading > div > h1 { grid-area: 2 / 2; }
.tk-body :is( .tk-yt-heading, .tk-inf-heading ).tk-tool-heading > div > span { grid-area: 3 / 2; }
.tk-body :is( .tk-yt-heading, .tk-inf-heading ).tk-tool-heading > :is( .tk-yt-icon, .tk-inf-icon ) { grid-area: 2 / 1; }
.tk-body :is( .tk-yt-heading, .tk-inf-heading ).tk-tool-heading > .tk-tool-breadcrumb { grid-area: 1 / 3 / 4; }

/* a tagline below the title */
.tk-body .tk-photo-editor-heading.tk-tool-heading { display: grid; grid-template-columns: auto minmax( 0, 1fr ) auto; row-gap: 2px; }
.tk-body .tk-photo-editor-heading.tk-tool-heading > span { grid-area: 1 / 1; }
.tk-body .tk-photo-editor-heading.tk-tool-heading > div > h1 { grid-area: 1 / 2; }
.tk-body .tk-photo-editor-heading.tk-tool-heading > div > p { grid-area: 2 / 2 / 3 / -1; }
.tk-body .tk-photo-editor-heading.tk-tool-heading > .tk-tool-breadcrumb { grid-area: 1 / 3; }

.tk-body .tk-gr-heading { row-gap: 0; }
.tk-body .tk-gr-heading > .tk-gr-mark { grid-area: 1 / 1; width: 34px; height: 34px; border-radius: 10px; }
.tk-body .tk-gr-heading > .tk-gr-mark b { font-size: 19px; }
.tk-body .tk-gr-heading h1 { grid-area: 1 / 2; font-size: clamp( 18px, 1.8vw, 21px ); letter-spacing: -.028em; line-height: 1.06; }
.tk-body .tk-gr-heading > div > span { grid-area: 2 / 2; }
.tk-body .tk-gr-heading > .tk-tool-breadcrumb { grid-area: 1 / 3 / 3; }

.tk-body .tk-doc-title { display: grid; grid-template-columns: auto minmax( 0, 1fr ); align-items: center; column-gap: 11px; row-gap: 2px; }
.tk-body .tk-doc-title > .tk-compact-tool-icon { grid-area: 1 / 1; width: 34px; height: 34px; border-radius: 10px; }
.tk-body .tk-doc-title > .tk-compact-tool-icon > svg { width: 18px; height: 18px; }
.tk-body .tk-doc-title h1 { grid-area: 1 / 2; font-size: clamp( 18px, 1.8vw, 21px ); letter-spacing: -.028em; line-height: 1.06; }
.tk-body .tk-doc-title > div > p { grid-area: 2 / 2; }

@media ( max-width: 900px ) {
	.tk-body .tk-gr-heading { grid-template-columns: auto minmax( 0, 1fr ); }
	.tk-body .tk-gr-heading > .tk-tool-breadcrumb { grid-area: 3 / 1 / 4 / -1; margin-top: 10px; }
}

@media ( max-width: 760px ) {
	.tk-body .tk-yt-heading.tk-tool-heading > .tk-tool-breadcrumb { grid-area: 4 / 1 / 5 / -1; margin-top: 10px; }
}

@media ( max-width: 700px ) {
	.tk-body .tk-pdf-utility-head.tk-tool-heading > .tk-pdf-utility-icon,
	.tk-body .tk-gr-heading > .tk-gr-mark,
	.tk-body .tk-doc-title > .tk-compact-tool-icon { width: 30px; height: 30px; border-radius: 9px; }
	.tk-body .tk-doc-title > .tk-compact-tool-icon > svg { width: 16px; height: 16px; }
	.tk-body .tk-gr-heading > .tk-gr-mark b { font-size: 17px; }
	.tk-body .tk-gr-heading h1,
	.tk-body .tk-doc-title h1 { font-size: 18px; }
}

@media ( max-width: 640px ) {
	.tk-body .tk-seo-page-head.tk-tool-heading { flex-direction: row; justify-content: flex-start; }
}

@media ( max-width: 620px ) {
	.tk-body .tk-inf-heading.tk-tool-heading > .tk-tool-breadcrumb { grid-area: 4 / 1 / 5 / -1; margin-top: 10px; }
}
