/* /tools/ — хэрэгслүүдийн нүүр. site.css-ийн токен дээр. Хайлт + ангилал + зурагтай жижиг карт. */

.tools-page main { padding-block: clamp(32px, 5vw, 56px) clamp(48px, 7vw, 88px); }

.th { display: grid; gap: 12px; margin-bottom: 28px; }
.th .h2 { font-size: clamp(32px, 4.2vw, 46px); }
.th .lead { font-size: 16px; }

/* Хайлт */
.tsearch { position: relative; max-width: 560px; margin-top: 10px; }
.tsearch svg { position: absolute; left: 16px; top: 50%; translate: 0 -50%; width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.tsearch input {
  width: 100%; height: 52px; padding: 0 52px 0 46px; border-radius: 999px;
  border: 1px solid #CFCFC9; background: var(--card); color: var(--ink);
  font: 500 16px/1 var(--f-body); box-shadow: 0 1px 2px rgba(27, 27, 27, .04);
}
.tsearch input::placeholder { color: #9A9A94; font-weight: 400; }
.tsearch input:focus { outline: none; border-color: var(--charcoal); box-shadow: 0 0 0 4px var(--accent-soft); }
.tsearch kbd {
  position: absolute; right: 14px; top: 50%; translate: 0 -50%; font: 600 12px/1 var(--f-mono); color: var(--muted);
  border: 1px solid var(--line); border-radius: 6px; padding: 4px 7px; background: var(--shell);
}
.tsearch input:not(:placeholder-shown) ~ kbd { display: none; }

/* Ангилал */
.tcats { display: flex; flex-wrap: wrap; gap: 8px; }
.tcats button {
  height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card);
  font: 500 14px/1 var(--f-body); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
}
.tcats button small { font-size: 12px; color: var(--muted); font-weight: 500; }
.tcats button:hover { border-color: #CFCFC9; }
.tcats button[aria-pressed="true"] { background: var(--charcoal); border-color: var(--charcoal); color: #fff; }
.tcats button[aria-pressed="true"] small { color: var(--accent); }

/* Тор — 11 карт нэг дор (ангиллыг шүүлтүүрээр) */
.tgrid { margin-top: 30px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1100px) { .tgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 820px) { .tgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }

/* Карт */
.tcard {
  position: relative; display: grid; grid-template-rows: auto 1fr; text-decoration: none; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.tcard:hover { border-color: var(--ink); transform: translateY(-2px); box-shadow: 0 10px 28px rgba(27, 27, 27, .08); }
.tart { display: grid; place-items: center; aspect-ratio: 16 / 9; background: var(--shell); border-bottom: 1px solid var(--line); }
.tart svg { width: 74%; height: auto; }
.tcard:hover .tart { background: var(--accent-soft); }
.tbody { display: grid; gap: 4px; align-content: start; padding: 14px 16px 16px; }
.tbody b { font-size: 16px; font-weight: 600; line-height: 1.3; }
.tbody span { font-size: 14px; line-height: 1.45; color: var(--muted); }
.tnew {
  position: absolute; top: 10px; right: 10px; font: 600 11px/1 var(--f-body); padding: 5px 8px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
}
@media (max-width: 520px) {
  .tbody { padding: 10px 12px 12px; }
  .tbody b { font-size: 14.5px; }
  .tbody span { font-size: 12.5px; }
}

/* Зургийн өнгө (inline SVG) */
.tart .p { fill: #fff; stroke: #CFCFC9; stroke-width: 1.5; }
.tart .l { stroke: #DADAD4; stroke-width: 3; stroke-linecap: round; }
.tart .k { fill: var(--charcoal); }
.tart .ks { stroke: var(--charcoal); stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.tart .a { fill: var(--accent); }
.tart .as { stroke: #5DBF5D; stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.tart .t { font: 700 11px var(--f-body); fill: var(--accent-ink); }
.tart .tw { font: 700 10px var(--f-body); fill: #fff; }

.tempty { margin-top: 28px; padding: 28px; text-align: center; color: var(--muted); border: 1px dashed #CFCFC9; border-radius: 18px; }
.tempty b { color: var(--ink); }

.tnote {
  margin-top: 40px; display: flex; flex-wrap: wrap; gap: 10px 22px; padding: 16px 20px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--line); font-size: 14px; color: var(--muted);
}
.tnote span { display: inline-flex; align-items: center; gap: 8px; }
.tnote svg { width: 18px; height: 18px; color: #3E9A3E; flex: none; }

.tcard[hidden] { display: none; }
@media (max-width: 640px) { .tsearch kbd { display: none; } .tsearch input { padding-right: 18px; } }

/* Нүүр хуудасны #tools — /tools/-ийн картууд + «Бүх хэрэгсэл» товч */
.tmore { margin-top: 22px; display: flex; justify-content: center; }
