/* ConvertHub Tools - works with any theme; uses theme variables when present. */
.cht-wrap, .cht-grid {
	--cht-ink: var(--ch-ink, #14172b);
	--cht-muted: var(--ch-muted, #5b6178);
	--cht-line: var(--ch-line, #dde1ee);
	--cht-paper: var(--ch-paper, #f6f7fb);
	--cht-surface: var(--ch-surface, #ffffff);
	--cht-accent: var(--ch-accent, #3b5bff);
	--cht-bad: #c4281c;
	color: var(--cht-ink);
}

/* icon pair */
.cht-ico { display: inline-flex; flex: none; }
.cht-ico i {
	font-style: normal; font-weight: 700; font-size: 10px; line-height: 1; letter-spacing: .02em;
	color: #fff; background: var(--c); padding: 5px 5px; min-width: 30px; text-align: center;
}
.cht-ico i:first-child { border-radius: 8px 0 0 8px; }
.cht-ico i:last-child { border-radius: 0 8px 8px 0; filter: brightness(.88); }

/* chips */
.cht-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.cht-chip {
	display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px 8px 8px;
	background: var(--cht-surface); border: 1px solid var(--cht-line); border-radius: 999px;
	color: var(--cht-ink); text-decoration: none; font-weight: 600; font-size: 15px;
	transition: border-color .15s, box-shadow .15s;
}
.cht-chip:hover { border-color: var(--cht-accent); box-shadow: 0 0 0 3px rgba(59, 91, 255, .12); }
.cht-chip:focus-visible { outline: 3px solid var(--cht-accent); outline-offset: 2px; }
.cht-chip[hidden], .cht-group[hidden] { display: none; }
.cht-group { margin: 0 0 32px; }
.cht-group h2 { font-size: 1.05rem; margin: 0 0 12px; color: var(--cht-muted); font-weight: 650; }
.cht-none { color: var(--cht-muted); }

/* tool box */
.cht-box {
	background: var(--cht-surface); border: 1px solid var(--cht-line); border-radius: 16px;
	padding: 24px; display: grid; gap: 16px;
}
.cht-loading { color: var(--cht-muted); margin: 0; }
.cht-drop {
	display: grid; gap: 4px; justify-items: center; text-align: center; cursor: pointer;
	padding: 36px 16px; border: 2px dashed var(--cht-line); border-radius: 14px; background: var(--cht-paper);
	transition: border-color .15s, background .15s;
}
.cht-drop strong { font-size: 1.1rem; }
.cht-drop span { color: var(--cht-muted); font-size: .95rem; }
.cht-drop:hover, .cht-drop.is-over, .cht-drop:focus-within { border-color: var(--cht-accent); background: #eef1ff; }
.cht-files { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cht-files:empty { display: none; }
.cht-files li {
	display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 14px;
	border: 1px solid var(--cht-line); border-radius: 10px; background: var(--cht-surface);
}
.cht-fn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.cht-fs { color: var(--cht-muted); font-size: .85rem; }
.cht-act { display: flex; gap: 4px; }
.cht-act button {
	width: 32px; height: 32px; border: 1px solid var(--cht-line); background: var(--cht-surface);
	border-radius: 8px; cursor: pointer; color: var(--cht-ink); font-size: 12px;
}
.cht-act button:hover:not(:disabled) { border-color: var(--cht-accent); }
.cht-act button:disabled { opacity: .35; cursor: default; }

.cht-field { display: grid; gap: 6px; font-weight: 600; }
.cht-box textarea, .cht-box select, .cht-box input[type="text"] {
	width: 100%; font: inherit; font-weight: 400; color: var(--cht-ink); background: var(--cht-surface);
	border: 1px solid var(--cht-line); border-radius: 10px; padding: 10px 12px; box-sizing: border-box;
}
.cht-box textarea { resize: vertical; min-height: 120px; }
.cht-box input[type="color"] { width: 48px; height: 36px; padding: 2px; border: 1px solid var(--cht-line); border-radius: 8px; background: var(--cht-surface); }
.cht-opts { display: flex; flex-wrap: wrap; gap: 14px 20px; }
.cht-opts label { display: grid; gap: 4px; font-weight: 600; font-size: .9rem; }
.cht-opts select { width: auto; min-width: 150px; }
.cht-hint { margin: 0; color: var(--cht-muted); font-size: .92rem; }

/* buttons */
.cht-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
	font: inherit; font-weight: 650; padding: 12px 22px; border-radius: 10px; text-decoration: none;
	border: 1px solid var(--cht-line); background: var(--cht-surface); color: var(--cht-ink);
}
.cht-btn:hover { border-color: var(--cht-accent); }
.cht-btn:focus-visible { outline: 3px solid var(--cht-accent); outline-offset: 2px; }
.cht-btn-main { background: var(--cht-accent); border-color: var(--cht-accent); color: #fff; justify-self: start; }
.cht-btn-main:hover { filter: brightness(.92); border-color: var(--cht-accent); }
.cht-btn-main:disabled { opacity: .6; cursor: progress; }
.cht-btn-sm { padding: 7px 14px; font-size: .9rem; }
.cht-dl { background: #0e9f6e; border-color: #0e9f6e; color: #fff; margin: 4px 8px 4px 0; }
.cht-dl:hover { border-color: #0e9f6e; filter: brightness(.92); }

.cht-status { margin: 0; min-height: 1.4em; color: var(--cht-muted); }
.cht-status.cht-err { color: var(--cht-bad); font-weight: 600; }
.cht-result { display: block; }
.cht-result:empty { display: none; }
.cht-preview { display: block; max-width: 100%; height: auto; margin-top: 12px; border: 1px solid var(--cht-line); border-radius: 10px; }
.cht-qr { max-width: 280px; }
.cht-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin: 12px 0; }
.cht-thumb { margin: 0; }
.cht-thumb img { width: 100%; height: auto; border: 1px solid var(--cht-line); border-radius: 8px; display: block; }
.cht-thumb figcaption { font-size: .85rem; margin-top: 6px; }
.cht-textout { display: grid; gap: 10px; margin-top: 10px; }
.cht-row { display: flex; flex-wrap: wrap; gap: 8px; }
.cht-scanres { display: grid; gap: 10px; margin-top: 10px; }
.cht-scanrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--cht-line); border-radius: 10px; }
.cht-scanrow code { word-break: break-all; background: var(--cht-paper); padding: 4px 8px; border-radius: 6px; }

/* about / related */
.cht-ad { margin: 24px 0; text-align: center; overflow: hidden; }
.cht-about { margin-top: 36px; max-width: 70ch; }
.cht-about h2 { font-size: 1.3rem; margin: 0 0 8px; }
.cht-about h3, .cht-related h3 { font-size: 1.05rem; margin: 20px 0 8px; }
.cht-about p, .cht-about li { line-height: 1.65; }
.cht-privacy { padding: 12px 14px; border-left: 4px solid #0e9f6e; background: #ecfaf4; border-radius: 0 8px 8px 0; }
.cht-related { margin-top: 28px; }

@media (max-width: 600px) {
	.cht-box { padding: 16px; }
	.cht-btn-main { justify-self: stretch; }
	.cht-opts select { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .cht-chip, .cht-drop { transition: none; } }
