/* ==========================================================================
   Sitemap.xml Generator & Validator — tool page only (/tools/sitemap-generator/)
   Uses the design tokens from main.css, so both themes work automatically.
   ========================================================================== */

.sm [hidden] { display: none !important; }
.sm .opt { color: var(--muted); font-weight: 400; }
.sm-mono { font-family: var(--font-mono); font-size: 0.86rem; }
.sm-hint { margin: 0; line-height: 1.55; }
.sm-hint a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.sm .textarea.sm-list { min-height: 230px; white-space: pre; tab-size: 2; line-height: 1.6; }
.sm .textarea.sm-vtext { min-height: 340px; }
.sm .textarea.sm-small { min-height: 90px; white-space: pre; line-height: 1.6; }
.sm .check { align-items: flex-start; line-height: 1.4; }
.sm .check input { flex: none; margin-top: 0.05rem; }
.sm .check input:focus-visible { outline: 2px solid var(--lilac); outline-offset: 2px; }
.sm code { font: 0.82em var(--font-mono); overflow-wrap: anywhere; }

.sm-modes { flex-wrap: wrap; align-self: flex-start; max-width: 100%; border-radius: 18px; }
.sm-pane, .ws-output > div[data-mode-out] { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }
.sm-section { display: flex; flex-direction: column; gap: 1rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.sm-checks { display: flex; flex-direction: column; gap: 0.55rem; }
.sm-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
@media (max-width: 420px) { .sm-two { grid-template-columns: 1fr; } }
.sm-sub { display: flex; flex-direction: column; align-items: flex-start; gap: 0.6rem; }
.sm-sub .field-label { line-height: 1.45; }

/* Help */
.sm-details { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.sm-details summary { padding: 0.6rem 0.85rem; color: var(--text-2); font-size: 0.86rem; font-weight: 600; cursor: pointer; }
.sm-details summary:hover { color: var(--text); }
.sm-details summary:focus-visible { outline: 2px solid var(--lilac); outline-offset: 2px; border-radius: 12px; }
.sm-details[open] summary { border-bottom: 1px solid var(--border); }
.sm-details-body { padding: 0.75rem 0.9rem; color: var(--text-2); font-size: 0.86rem; line-height: 1.55; }
.sm-details-body p { margin: 0 0 0.6rem; }
.sm-details-body p:last-child { margin-bottom: 0; }
.sm-details-body ul { display: grid; gap: 0.45rem; margin: 0 0 0.7rem; padding-left: 1.1rem; }
.sm-details-body strong { color: var(--text); }

/* Rules */
.sm-rules { display: flex; flex-direction: column; gap: 0.6rem; align-self: stretch; margin: 0; padding: 0; list-style: none; }
.sm-rules:empty { display: none; }
.sm-rule {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 0.9fr) auto; align-items: end; gap: 0.5rem;
  padding: 0.7rem; border: 1px solid var(--border-2); border-radius: 12px; background: var(--surface);
}
.sm-rule .field-label { font-size: 0.78rem; }
.sm-rule-x { justify-content: center; width: 40px; height: 40px; padding: 0; margin-bottom: 2px; }
.sm-rule-x .icon { width: 16px; height: 16px; }
@media (max-width: 1100px) and (min-width: 961px), (max-width: 560px) {
  .sm-rule { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  .sm-rule-pat { grid-column: 1 / -1; }
}

/* Output */
.sm-result { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.sm-checklist:empty { display: none; }
.sm-checklist .check-item > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.sm-xml { max-height: 460px; }
.sm-robots { display: flex; flex-direction: column; gap: 0.6rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.sm-robots-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
.sm-sub-title { margin: 0; font: 600 1rem/1.3 var(--font-display); }
.sm-robots-code { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Validator table */
.sm-table-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.sm-table-tools .field-label { margin: 0; }
.sm .select.sm-filter { width: auto; min-width: 0; max-width: 100%; }
.sm-table-wrap { max-height: 520px; overflow: auto; border: 1px solid var(--border); border-radius: 12px; }
.sm-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.sm-table th, .sm-table td { padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.sm-table thead th { position: sticky; top: 0; z-index: 1; background: var(--option-bg); color: var(--muted); font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
.sm-table td { color: var(--text-2); white-space: nowrap; }
.sm-table td.sm-url, .sm-table td.sm-probs { white-space: normal; }
.sm-table td:first-child { color: var(--muted); }
.sm-table .sm-url { min-width: 200px; max-width: 360px; color: var(--text); font-family: var(--font-mono); overflow-wrap: anywhere; }
.sm-table tr.is-bad td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.sm-table tr.is-warn td:first-child { box-shadow: inset 3px 0 0 var(--warn-text); }
.sm-probs { min-width: 220px; }
.sm-prob { display: block; margin-bottom: 0.3rem; line-height: 1.4; }
.sm-prob:last-child { margin-bottom: 0; }
.sm-prob.is-bad { color: var(--danger-text); }
.sm-prob.is-warn { color: var(--warn-text); }
.sm-ok { color: var(--success); font-weight: 600; }
.sm-img { color: var(--muted); font-family: var(--font-body); font-size: 0.75rem; white-space: nowrap; }
.sm-none { color: var(--muted); text-align: center !important; }
.sm-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; color: var(--muted); font-size: 0.82rem; }
.sm-pager:empty { display: none; }
.sm-pager .icon-btn:disabled { opacity: 0.45; cursor: not-allowed; }
