/* ==========================================================================
   zyntec-v2 — additional styles (extends shared.css and page.css)
   ========================================================================== */

/* --- Nav dropdown --- */
.nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.nav-dropdown-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 600;
  padding: 10px 2px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.nav-dropdown-toggle::after {
  content: "▾";
  font-size: 0.7rem;
  opacity: 0.6;
}
.nav-dropdown:hover .nav-dropdown-toggle,
.nav-dropdown-toggle:focus {
  color: var(--accent);
}
.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: -16px;
  margin-top: 4px;
  min-width: 320px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: rgba(0,0,0,0.06) 0px 16px 40px, rgba(0,0,0,0.04) 0px 2px 6px;
  padding: 8px;
  display: none;
  z-index: 110;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown-toggle:focus + .nav-dropdown-menu {
  display: block;
}
.nav-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s;
}
.nav-dropdown-menu a:hover {
  background: var(--bg-alt);
  text-decoration: none;
}
.nav-cat-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}

/* --- Breadcrumbs --- */
.breadcrumbs {
  font-size: 0.88rem;
  color: var(--text-muted);
  padding: 8px 0;
}
.breadcrumbs-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.breadcrumbs-list li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.breadcrumbs-list a {
  color: var(--text-secondary);
  text-decoration: none;
}
.breadcrumbs-list a:hover { color: var(--accent); }
.breadcrumb-sep { color: var(--text-muted); }

/* --- Section title left-aligned variant --- */
.section-title-left {
  text-align: left;
  margin-bottom: 24px;
  font-size: 2rem;
}

/* --- Categories grid (homepage) --- */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 16px;
}
.category-card {
  display: block;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  text-decoration: none;
  color: inherit;
}
.category-card:hover {
  transform: translateY(-2px);
  box-shadow: rgba(0,0,0,0.05) 0px 10px 30px;
  text-decoration: none;
}
.category-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  color: #fff;
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 16px;
}
.category-icon-lg {
  width: 64px;
  height: 64px;
  font-size: 1.6rem;
  margin-bottom: 20px;
}
.category-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.category-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}
.category-count {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}
@media (max-width: 900px) {
  .categories-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .categories-grid { grid-template-columns: 1fr; }
}

/* --- Category block (all-services) --- */
.cat-block-head {
  margin-bottom: 28px;
}
.cat-block-link {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}
.cat-block-link:hover { text-decoration: none; }
.cat-block-link h2 {
  font-size: 1.6rem;
  font-weight: 700;
}
.cat-block-desc {
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 0.98rem;
  max-width: 720px;
  line-height: 1.5;
}

/* --- FAQ --- */
.faq { margin-top: 8px; }
.faq-answer {
  padding: 0 24px 22px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* --- Related block --- */
.related-block { margin-top: 16px; }
.related-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 20px;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.related-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
}
.related-card:hover {
  transform: translateY(-2px);
  box-shadow: rgba(0,0,0,0.05) 0px 8px 24px;
  text-decoration: none;
}
.related-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: rgba(94,106,210,0.12);
  color: var(--accent);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 4px;
}
.related-card-name {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
}
.related-card-tagline {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
@media (max-width: 900px) { .related-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px) { .related-grid { grid-template-columns: 1fr; } }

/* --- Related articles --- */
.related-articles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

/* --- Related grid (many) — используется на посадочных сервисов --- */
.related-grid-many {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 900px) {
  .related-grid-many {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 540px) {
  .related-grid-many {
    grid-template-columns: 1fr;
  }
}
.related-more {
  text-align: center;
  margin-top: 32px;
}
.related-article {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, border-color 0.2s;
}
.related-article:hover {
  transform: translateX(4px);
  border-color: var(--accent);
  text-decoration: none;
}
.related-article-title {
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.4;
}
.related-article-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* --- Article page --- */
.article-page { padding: 24px 0 60px; }
.article-header {
  margin-bottom: 36px;
}
.article-header h1 {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 8px 0 12px;
}
.article-lead {
  font-size: 1.18rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.article-tags {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}
.article-tag {
  background: var(--bg-alt);
  color: var(--text-secondary);
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
}

.article-body {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text);
}
.article-body h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 40px 0 16px;
  letter-spacing: -0.015em;
  line-height: 1.2;
}
.article-body h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 28px 0 12px;
  line-height: 1.3;
}
.article-body p { margin: 16px 0; }
.article-body ul, .article-body ol {
  margin: 16px 0;
  padding-left: 28px;
}
.article-body li { margin: 6px 0; }
.article-body code {
  background: var(--bg-alt);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.article-body pre {
  background: var(--bg-alt);
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.5;
  margin: 20px 0;
}
.article-body pre code {
  background: none;
  padding: 0;
}
.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 18px;
  margin: 20px 0;
  color: var(--text-secondary);
  font-style: italic;
}
.article-body table {
  border-collapse: collapse;
  width: 100%;
  margin: 20px 0;
  font-size: 0.95rem;
}
.article-body th, .article-body td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
}
.article-body th {
  background: var(--bg-alt);
  font-weight: 600;
}

.related-inline {
  margin-top: 48px;
  padding: 24px;
  background: var(--bg-alt);
  border-radius: var(--radius-md);
}
.related-inline h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.related-inline ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.related-inline li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.related-inline li:last-child { border-bottom: none; }
.related-inline a {
  font-weight: 600;
  font-size: 0.98rem;
}
.related-inline-tagline {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* --- Intent list (search intent chips) --- */
.intent-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.intent-list li {
  background: var(--bg-alt);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* --- Tool stub (заглушка UI сервиса) --- */
.tool-stub {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 32px;
  max-width: 720px;
  margin: 0 auto;
}
.tool-stub-head {
  margin-bottom: 24px;
}
.tool-stub-badge {
  display: inline-block;
  background: rgba(94,106,210,0.12);
  color: var(--accent);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tool-stub h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.015em;
}
.tool-stub-head p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
}
.tool-stub-placeholder {
  padding: 32px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  text-align: center;
  color: var(--text-muted);
}
.tool-stub-placeholder p {
  margin: 8px 0;
  font-size: 0.92rem;
}
.tool-stub-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: ui-monospace, monospace;
}
.dropzone {
  padding: 24px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.dropzone:hover {
  background: var(--bg-alt);
  border-color: var(--accent);
}

/* --- Skip link (a11y) --- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 8px 14px;
  z-index: 9999;
  border-radius: 0 0 4px 0;
  font-size: 0.9rem;
  font-weight: 600;
}
.skip-link:focus {
  left: 0;
}

/* --- Footer meta --- */
.footer-meta {
  display: inline-flex;
  gap: 8px;
  margin-left: 16px;
}
.footer-meta a {
  color: var(--text-muted);
}

/* --- Dark theme tweaks --- */
[data-theme="dark"] .tool-stub-placeholder {
  border-color: rgba(255,255,255,0.1);
}
[data-theme="dark"] .nav-dropdown-menu {
  box-shadow: rgba(0,0,0,0.4) 0px 16px 40px;
}
[data-theme="dark"] .article-body code {
  background: rgba(255,255,255,0.05);
}
[data-theme="dark"] .article-body pre {
  background: rgba(255,255,255,0.03);
}
[data-theme="dark"] .article-body th {
  background: rgba(255,255,255,0.03);
}

/* ==========================================================================
   Tool forms & results
   ========================================================================== */

.tool {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 32px;
  max-width: 760px;
  margin: 0 auto;
}
.tool-head {
  margin-bottom: 24px;
}
.tool-badge {
  display: inline-block;
  background: rgba(94,106,210,0.12);
  color: var(--accent);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tool-head h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.015em;
}
.tool-head p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
}

.tool-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.tool-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tool-row-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.tool-row-inline > .tool-row {
  flex: 1 1 160px;
  min-width: 140px;
}
.tool-row label,
.tool-fieldset legend {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}
.tool-row .tool-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.tool-input,
.tool-select,
.tool-textarea {
  font: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  min-height: 44px;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tool-textarea {
  min-height: 180px;
  resize: vertical;
  line-height: 1.5;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.9rem;
}
.tool-input:focus,
.tool-select:focus,
.tool-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(94,106,210,0.18);
}
.tool-fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tool-fieldset legend {
  padding: 0 6px;
}
.tool-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
  min-height: 28px;
}
.tool-check input[type="checkbox"],
.tool-check input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}
.tool-file {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tool-file input[type="file"] {
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
}
.tool-color {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}
.tool-color input[type="color"] {
  width: 44px;
  height: 36px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  cursor: pointer;
}
.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
}
.tool-actions .btn-primary,
.tool-actions .btn-secondary {
  flex: 0 0 auto;
}
.tool-error {
  background: rgba(235,87,87,0.08);
  border: 1px solid rgba(235,87,87,0.3);
  color: #c14242;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.9rem;
  line-height: 1.5;
}
[data-theme="dark"] .tool-error {
  color: #ff7a7a;
  background: rgba(235,87,87,0.12);
  border-color: rgba(235,87,87,0.35);
}
.tool-success {
  background: rgba(62,207,142,0.1);
  border: 1px solid rgba(62,207,142,0.3);
  color: #1f7a4a;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.9rem;
  line-height: 1.5;
}
[data-theme="dark"] .tool-success {
  color: #6ee7b0;
  background: rgba(62,207,142,0.12);
  border-color: rgba(62,207,142,0.35);
}

.tool-result {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.tool-result h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
}
.tool-result-meta {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.tool-preview {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 120px;
  overflow: auto;
}
.tool-preview img {
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
}
.tool-preview img.tool-preview-vector {
  image-rendering: auto;
}
.tool-meta-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 16px;
  font-size: 0.92rem;
}
.tool-meta-list dt {
  font-weight: 600;
  color: var(--text-secondary);
}
.tool-meta-list dd {
  margin: 0;
  color: var(--text);
  word-break: break-word;
}
.tool-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tool-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.tool-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  min-width: 480px;
}
.tool-table th,
.tool-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.tool-table th {
  background: var(--bg-alt);
  font-weight: 600;
  position: sticky;
  top: 0;
}
.tool-table tr:last-child td {
  border-bottom: none;
}
.tool-table tr:hover td {
  background: var(--bg-alt);
}
.tool-table td.numeric,
.tool-table th.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.tool-table tfoot td {
  font-weight: 700;
  background: var(--bg-alt);
  border-top: 2px solid var(--border);
}

.tool-empty {
  color: var(--text-muted);
  font-size: 0.92rem;
  padding: 12px 0;
}
.tool-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}
.tool-stat {
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.tool-stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.tool-stat-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 600px) {
  .tool { padding: 20px; }
  .tool-row-inline { flex-direction: column; gap: 18px; }
}

/* ==========================================================================
   Tool UI (forms, results, tables) — used by templates/tools/*.html
   ========================================================================== */

.tool-ui {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 32px;
  max-width: 820px;
  margin: 0 auto;
}

.tool-ui-head {
  margin-bottom: 24px;
}
.tool-ui-head h2 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: 6px;
}
.tool-ui-head p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* --- Form layout --- */
.tool-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.tool-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.tool-form-row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 600px) {
  .tool-form-row,
  .tool-form-row-3 { grid-template-columns: 1fr; }
}

.tool-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tool-field label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tool-field .hint {
  font-weight: 500;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.tool-field input[type="text"],
.tool-field input[type="number"],
.tool-field select,
.tool-field textarea {
  font: inherit;
  font-size: 0.95rem;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
  min-height: 44px;
  line-height: 1.4;
}
.tool-field input[type="range"] {
  width: 100%;
  height: 32px;
  background: transparent;
  accent-color: var(--accent);
  padding: 0;
  border: 0;
  min-height: 32px;
  margin: 0;
}
.tool-field input[type="color"] {
  width: 100%;
  height: 44px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  cursor: pointer;
}
.tool-field textarea {
  min-height: 140px;
  resize: vertical;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  line-height: 1.5;
}
.tool-field input:focus,
.tool-field select:focus,
.tool-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(94,106,210,0.15);
}
.tool-field-radio {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 4px;
}
.tool-field-radio label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  font-size: 0.92rem;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  background: var(--bg);
  min-height: 40px;
  transition: border-color 0.15s, background 0.15s;
}
.tool-field-radio input[type="radio"] {
  margin: 0;
  accent-color: var(--accent);
}
.tool-field-radio label:has(input:checked) {
  border-color: var(--accent);
  background: rgba(94,106,210,0.08);
}

.tool-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 4px;
}
.tool-form-actions .btn-secondary {
  background: transparent;
  cursor: pointer;
}

/* --- Errors block --- */
.tool-errors {
  background: rgba(235,87,87,0.08);
  border: 1px solid rgba(235,87,87,0.3);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 20px;
  color: #c03535;
  font-size: 0.92rem;
}
[data-theme="dark"] .tool-errors {
  background: rgba(235,87,87,0.12);
  color: #ff8585;
}
.tool-errors ul {
  list-style: disc;
  margin: 6px 0 0 18px;
  padding: 0;
}
.tool-errors strong { color: inherit; }

/* --- Result block --- */
.tool-result {
  margin-top: 28px;
  padding: 24px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  background: rgba(94,106,210,0.04);
}
.tool-result h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--accent);
}
.tool-result-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.result-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.result-card.result-card-emph {
  border-color: var(--accent);
  background: rgba(94,106,210,0.08);
}
.result-card-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.result-card-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.result-card-value.result-negative { color: #c03535; }
.result-card-value.result-positive { color: #16a34a; }
[data-theme="dark"] .result-card-value.result-negative { color: #ff8585; }
[data-theme="dark"] .result-card-value.result-positive { color: #4ade80; }
.result-card-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* --- Tool result table --- */
.tool-result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin-top: 8px;
}
.tool-result-table th,
.tool-result-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.tool-result-table th {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: var(--bg);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.tool-result-table td.numeric,
.tool-result-table th.numeric { text-align: right; font-variant-numeric: tabular-nums; }
.tool-result-table tr:last-child td { border-bottom: none; }

/* --- Reference table (with search) --- */
.ref-search {
  margin-bottom: 16px;
}
.ref-search input {
  font: inherit;
  font-size: 0.95rem;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  width: 100%;
  min-height: 44px;
}
.ref-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(94,106,210,0.15);
}
.ref-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* --- Forbidden words list --- */
.forbidden-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.forbidden-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}
.forbidden-marker {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.forbidden-marker.high { background: #c03535; }
.forbidden-marker.medium { background: #f59e0b; }
.forbidden-marker.low { background: #6b7280; }
.forbidden-word {
  font-weight: 700;
  color: var(--text);
}
.forbidden-context {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
  font-family: ui-monospace, monospace;
}
.forbidden-suggestion {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: right;
}
.forbidden-suggestion code {
  background: var(--bg-alt);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--text);
}
.forbidden-empty {
  padding: 20px;
  text-align: center;
  color: var(--text-secondary);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

/* --- Char counter limits --- */
.limit-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  margin-bottom: 8px;
}
.limit-row.limit-over {
  border-color: #c03535;
  background: rgba(235,87,87,0.05);
}
.limit-row.limit-near {
  border-color: #f59e0b;
}
.limit-name { font-weight: 600; font-size: 0.95rem; }
.limit-hint { font-size: 0.78rem; color: var(--text-muted); }
.limit-progress {
  height: 4px;
  background: var(--bg-alt);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 6px;
  grid-column: 1 / -1;
}
.limit-progress-bar {
  height: 100%;
  background: var(--accent);
  transition: width 0.2s, background 0.2s;
}
.limit-row.limit-over .limit-progress-bar { background: #c03535; }
.limit-row.limit-near .limit-progress-bar { background: #f59e0b; }
.limit-counter {
  font-weight: 700;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.limit-row.limit-over .limit-counter { color: #c03535; }
.limit-row.limit-near .limit-counter { color: #f59e0b; }

/* --- Keyword density rows --- */
.kw-row {
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  margin-bottom: 8px;
}
.kw-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.kw-row-keyword {
  font-weight: 700;
  font-size: 1rem;
}
.kw-row-count {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.kw-row-density {
  font-size: 0.95rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.kw-row-density.density-good { color: #16a34a; }
.kw-row-density.density-warn { color: #f59e0b; }
.kw-row-density.density-bad { color: #c03535; }
[data-theme="dark"] .kw-row-density.density-good { color: #4ade80; }
[data-theme="dark"] .kw-row-density.density-warn { color: #fbbf24; }
[data-theme="dark"] .kw-row-density.density-bad { color: #ff8585; }

/* --- Transliteration output --- */
.translit-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.translit-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.translit-value {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 1rem;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  word-break: break-all;
}
.lorem-output-block {
  margin-top: 16px;
}
.lorem-output-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.lorem-copy-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 12px;
  cursor: pointer;
}
.lorem-copy-button .ui-icon {
  width: 18px;
  height: 18px;
}
.lorem-output-block .translit-value {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: normal;
}
.lorem-copy-status {
  min-height: 20px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.4;
}

/* --- Generic info block under form --- */
.tool-info {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 12px;
  line-height: 1.5;
}

/* --- Decision banner (for returns calculator) --- */
.decision-banner {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin: 16px 0;
  font-weight: 700;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 12px;
}
.decision-return {
  background: rgba(94,106,210,0.08);
  color: var(--accent);
  border: 1px solid var(--accent);
}
.decision-utilize {
  background: rgba(245,158,11,0.08);
  color: #b45309;
  border: 1px solid #f59e0b;
}
[data-theme="dark"] .decision-utilize { color: #fbbf24; }

/* ==========================================================================
   Photo tool additions: dropzone-large, preset-grid, field helpers
   ========================================================================== */

.dropzone-large {
  position: relative;
  padding: 40px 24px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  text-align: center;
  color: var(--text-secondary);
  background: var(--bg-alt);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.dropzone-large:hover,
.dropzone-large.dragover {
  background: var(--bg);
  border-color: var(--accent);
}
.dropzone-large > p { margin: 4px 0; font-size: 0.95rem; }
.dropzone-large .dz-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 6px;
}
.dropzone-large input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
[data-theme="dark"] .dropzone-large {
  background: rgba(255,255,255,0.02);
}
[data-theme="dark"] .dropzone-large:hover,
[data-theme="dark"] .dropzone-large.dragover {
  background: rgba(94,106,210,0.06);
}

/* Preset grid: 4-column (or responsive) selector of clickable radios */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 4px;
}
.preset-grid > label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  min-height: 56px;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  position: relative;
}
.preset-grid > label small {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 400;
}
.preset-grid > label:hover {
  border-color: var(--accent);
}
.preset-grid > label:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.preset-grid > label:has(input:checked) small {
  color: rgba(255,255,255,0.85);
}
.preset-grid > label input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}
.preset-grid > label:has(> input[type="color"]) {
  padding: 6px;
}
.preset-grid > label > input[type="color"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}
.preset-grid > label > .swatch {
  display: inline-block;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid var(--border);
}
@media (max-width: 600px) {
  .preset-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Tool field modifiers (full row, check inline) */
.tool-field-full { grid-column: 1 / -1; }
.tool-field-check {
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px !important;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
  min-height: 36px;
}
.tool-field-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* File preview chip (after dropzone) */
.tool-file-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 0.88rem;
}
.tool-file-chip img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}
.tool-file-chip .file-name { font-weight: 600; }
.tool-file-chip .file-size { color: var(--text-muted); font-size: 0.8rem; margin-top: 2px; }

/* Result image preview (uses tool-preview but with photo-friendly rendering) */
.tool-preview.tool-preview-photo {
  background: #fff;
  padding: 12px;
  min-height: auto;
  max-height: 420px;
  border-style: solid;
  border-color: var(--border);
}
.tool-preview.tool-preview-photo img {
  max-width: 100%;
  max-height: 380px;
  width: auto;
  height: auto;
  image-rendering: auto;
}
[data-theme="dark"] .tool-preview.tool-preview-photo {
  background: #fff;
}

/* Result actions (button row inside tool-result) */
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
}

/* Service page hero spacing for tools that need more room */
.section-tight { padding: 40px 0; }

/* ==========================================================================
   Web tools: code blocks, path segments, SSL/dns/who-is/ua result rows
   ========================================================================== */

.tool-code-block {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.88rem;
  line-height: 1.5;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  width: 100%;
  resize: vertical;
  min-height: 120px;
  word-break: break-all;
  white-space: pre-wrap;
  cursor: text;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tool-code-block:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(94,106,210,0.15);
}

.path-segment {
  display: inline-block;
  padding: 3px 10px;
  background: var(--bg-alt);
  border-radius: 4px;
  margin-right: 6px;
  margin-bottom: 4px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.9rem;
  color: var(--text);
}

.result-card.result-card-warn {
  border-color: #f59e0b;
  background: rgba(245,158,11,0.08);
}
[data-theme="dark"] .result-card.result-card-warn {
  background: rgba(245,158,11,0.12);
}

.tool-result-table th[scope="row"],
.tool-result-table tbody th {
  width: 36%;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg);
  font-size: 0.88rem;
  white-space: nowrap;
}
@media (max-width: 600px) {
  .tool-result-table tbody th { width: auto; }
}

/* ============== Hub pages ============== */
.hub-badge {
  display: inline-block;
  padding: 4px 12px;
  margin-bottom: 16px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hub-intro {
  max-width: 760px;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
}

.hub-intro p {
  margin: 0;
}

.hub-group-head {
  margin-bottom: 24px;
}

.hub-group-desc {
  margin: -8px 0 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.cta-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 8px;
}

@media (max-width: 600px) {
  .cta-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
