/* Keyword clustering tool styles, shared by the uk and en pages. */
:root {
  --accent: #1f9d55;
  --accent-hover: #17753f;
  --bg: #ffffff;
  --bg-subtle: #f6f7f5;
  --text: #16181d;
  --muted: #5c6068;
  --border: #e4e6e1;
  --radius: 12px;
}
* { box-sizing: border-box; }
body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  margin: 0;
  padding: 2rem 1rem 5rem;
  line-height: 1.6;
}
.wrap { max-width: 900px; margin: 0 auto; }
.back { display: inline-block; margin-bottom: 1.25rem; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--accent); }
h1 { font-size: 1.9rem; letter-spacing: -0.02em; margin: 0 0 0.4rem; }
p.lead { color: var(--muted); margin: 0 0 1.5rem; }
label { font-weight: 600; display: block; margin-bottom: 0.4rem; }
textarea {
  width: 100%; min-height: 220px; resize: vertical; font: 0.92rem/1.5 ui-monospace, Consolas, monospace;
  padding: 0.75rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-subtle);
}
.hint { font-size: 0.85rem; color: var(--muted); margin-top: 0.4rem; }
.controls { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: flex-end; margin: 1.25rem 0; }
.control { display: flex; flex-direction: column; gap: 0.3rem; }
.control small { color: var(--muted); font-weight: 400; }
input[type="range"] { width: 180px; }
select, input[type="number"] {
  font: inherit; padding: 0.45rem 0.6rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg);
}
.row { display: flex; align-items: center; gap: 0.45rem; }
.row label { margin: 0; font-weight: 400; }
button {
  cursor: pointer; font: inherit; font-weight: 600; padding: 0.7rem 1.5rem;
  border: none; border-radius: 999px; background: var(--accent); color: #fff;
}
button:hover { background: var(--accent-hover); }
button:disabled { opacity: 0.5; cursor: default; }
button.secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
button.secondary:hover { border-color: var(--accent); color: var(--accent); background: transparent; }
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.count { font-size: 0.9rem; color: var(--muted); }
.count.over { color: #c0392b; font-weight: 600; }
#progress { margin: 1.25rem 0; display: none; }
#progress.on { display: block; }
.bar { height: 8px; background: var(--bg-subtle); border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.bar > span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.15s ease; }
#progress .plabel { font-size: 0.85rem; color: var(--muted); margin-top: 0.4rem; }
.summary { display: flex; flex-wrap: wrap; gap: 1.5rem; margin: 1.5rem 0 1rem; }
.stat { }
.stat b { display: block; font-size: 1.5rem; color: var(--accent); line-height: 1.1; }
.stat span { font-size: 0.85rem; color: var(--muted); }
.cluster {
  border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 0.75rem; overflow: hidden;
}
.cluster > summary {
  cursor: pointer; padding: 0.8rem 1rem; display: flex; align-items: center; gap: 0.75rem;
  list-style: none; background: var(--bg-subtle);
}
.cluster > summary::-webkit-details-marker { display: none; }
.cluster .cname { font-weight: 700; flex: 1; }
.cluster .cmeta { font-size: 0.85rem; color: var(--muted); white-space: nowrap; }
.cluster ul { margin: 0; padding: 0.75rem 1rem 1rem 2rem; columns: 2; }
.cluster li { break-inside: avoid; }
.cluster li .vol { color: var(--muted); font-size: 0.85em; }
@media (max-width: 640px) {
  .cluster ul { columns: 1; }
  .cluster > summary { flex-wrap: wrap; row-gap: 0.4rem; }
  .cluster .cname { flex-basis: 100%; }
}
.nojs, .error { background: #fdecea; color: #922; padding: 0.75rem 1rem; border-radius: 8px; }
.tool-about{margin-top:2.5rem;padding-top:1.5rem;border-top:1px solid var(--border);max-width:72ch;color:var(--text)}.tool-about h2{font-size:1.3rem;margin:1.75rem 0 .6rem}.tool-about h2:first-child{margin-top:0}.tool-about h3{font-size:1.05rem;margin:1.25rem 0 .4rem}.tool-about p,.tool-about li{line-height:1.6}.tool-about p{margin:0 0 .8rem}.tool-about ul,.tool-about ol{margin:0 0 .9rem;padding-left:1.4rem}.tool-about li{margin:.25rem 0}.tool-about .tool-author{margin-top:1.25rem;font-size:.88rem;color:var(--muted)}
.tool-about code{font-family:ui-monospace,Consolas,monospace;font-size:.9em;background:var(--bg-subtle);border:1px solid var(--border);border-radius:5px;padding:.05em .35em}
    
input[type="text"], input[type="search"] {
  font: inherit; padding: 0.45rem 0.7rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg);
}
.inrow { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-top: 0.5rem; }
.filebtn { display: inline-block; margin: 0; font-weight: 600; font-size: 0.9rem; padding: 0.35rem 0.9rem; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; }
.filebtn:hover { border-color: var(--accent); color: var(--accent); }
.filebtn input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.filebtn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
#mapping { font-size: 0.88rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-top: 0.6rem; }
#mapping[hidden], #rtools[hidden] { display: none; }
#mapping label { display: inline; margin: 0; font-weight: 600; color: var(--text); }
.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0.35rem 1.25rem; margin: 0 0 1rem; }
.opts .row small { color: var(--muted); }
details.more { border: 1px solid var(--border); border-radius: var(--radius); padding: 0.6rem 1rem; margin: 0 0 1.25rem; }
details.more > summary { cursor: pointer; font-weight: 600; }
details.more textarea { min-height: 110px; margin-top: 0.6rem; }
#rtools { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin: 1.5rem 0 0; }
#rtools input { flex: 1; min-width: 200px; }
#shown { font-size: 0.85rem; color: var(--muted); }
.badge { font-size: 0.72rem; font-weight: 600; padding: 0.05rem 0.45rem; border-radius: 999px; background: var(--bg-subtle); border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.badge.main { color: var(--accent); border-color: var(--accent); }
.badge.dup { color: #8a5a00; border-color: #e3c27a; background: #fff8e6; }
.badge.i-c { color: #1d4ed8; border-color: #bfd0f5; background: #eef3fd; }
.badge.i-i { color: #7c3aed; border-color: #dccbf7; background: #f5f0fd; }
.cluster .cp, .cluster .mv { font-size: 0.78rem; font-weight: 600; padding: 0.2rem 0.65rem; background: transparent; color: var(--muted); border: 1px solid var(--border); }
.cluster .cp:hover, .cluster .mv:hover { color: var(--accent); border-color: var(--accent); background: transparent; }
.cluster .mv { padding: 0 0.4rem; line-height: 1.4; opacity: 0.55; }
.cluster li:hover .mv, .cluster .mv:focus-visible { opacity: 1; }
dialog { border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; max-width: min(460px, calc(100vw - 2rem)); width: 100%; }
dialog::backdrop { background: rgba(0, 0, 0, 0.35); }
dialog input { width: 100%; margin: 0.4rem 0 0.25rem; }
dialog .err { color: #c0392b; font-size: 0.85rem; min-height: 1.2em; }
dialog .actions { justify-content: flex-end; margin-top: 0.5rem; }
.badge.lg { color: #0f766e; border-color: #a7dcd5; background: #effaf8; }
.synbar { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-top: 0.6rem; }
.synbar button { font-size: 0.85rem; padding: 0.35rem 0.9rem; }
#synlist { margin-top: 0.6rem; max-height: 340px; overflow-y: auto; }
#synlist .hint { margin: 0 0 0.4rem; }
.sug { display: flex; gap: 0.5rem; align-items: flex-start; font-weight: 400; margin: 0; padding: 0.35rem 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.sug input { margin-top: 0.3rem; }
.sug .vol { color: var(--muted); font-size: 0.85em; }
.sug small { display: block; color: var(--muted); font-size: 0.8rem; }
.sug.weak { opacity: 0.6; }
