/**
 * Centro de ayuda — shared look (Estado / Anuncios / KB / Descargas)
 * Mockup: mockup/centrodeayuda/Centro de Ayuda.dc.html
 */

.hx-help {
  --svc-accent: #1f5fa8;
  --svc-ink: #111a24;
  --svc-ink-2: #2c3d52;
  --svc-muted: #5d6c80;
  --svc-muted-2: #8d9aab;
  --svc-line: #f0f3f7;
  --svc-border: #e3e8ee;
  --svc-surface: #ffffff;
  --svc-page-hint: #5d6c80;
  --svc-radius: 16px;
  --svc-radius-sm: 14px;
  --svc-shadow: 0 1px 2px rgba(16, 26, 40, 0.05);
  --svc-shadow-hover: 0 2px 4px rgba(16, 26, 40, 0.06), 0 12px 34px -18px rgba(16, 26, 40, 0.24);
  margin: 8px 0 32px;
  color: var(--svc-ink);
}

html.dark .hx-help {
  --svc-ink: #e8edf4;
  --svc-ink-2: #c5ced8;
  --svc-muted: #9aa8b8;
  --svc-muted-2: #7a8799;
  --svc-line: #2a3140;
  --svc-border: #3a4454;
  --svc-surface: #1c212b;
  --svc-page-hint: #9aa8b8;
  --svc-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  --svc-shadow-hover: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.hx-help__intro {
  margin: 0 0 22px;
  font-size: 14px;
  color: var(--svc-page-hint);
  max-width: 640px;
  line-height: 1.55;
}

.hx-help__crumbs {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--svc-muted-2);
}

.hx-help__crumbs a {
  color: var(--svc-accent) !important;
  text-decoration: none !important;
}

/* Hero status (serverstatus) */
.hx-help-hero {
  background: #0d1826;
  border-radius: 18px;
  padding: 32px 34px;
  margin-bottom: 16px;
  color: #fff;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: center;
}

html.dark .hx-help-hero {
  background: #0a1018;
}

.hx-help-hero__main {
  display: flex;
  gap: 18px;
  align-items: center;
  min-width: 0;
}

.hx-help-hero__badge {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 52px;
  font-size: 22px;
}

.hx-help-hero__badge.is-ok {
  background: rgba(42, 117, 73, 0.22);
  color: #5fce93;
}

.hx-help-hero__badge.is-warn {
  background: rgba(168, 104, 26, 0.22);
  color: #f0b35a;
}

.hx-help-hero__badge.is-bad {
  background: rgba(168, 50, 50, 0.22);
  color: #f07171;
}

.hx-help-hero__title {
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.028em;
  line-height: 1.25;
}

.hx-help-hero__sub {
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 6px;
  line-height: 1.45;
}

.hx-help-hero__stats {
  display: flex;
  gap: 26px;
}

.hx-help-hero__stat {
  text-align: right;
}

.hx-help-hero__stat-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.11em;
  text-transform: uppercase;
  font-weight: 600;
}

.hx-help-hero__stat-value {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-top: 6px;
}

.hx-help-hero__stat-value a {
  color: inherit !important;
  text-decoration: none !important;
}

.hx-help-hero__stat-value.is-ok { color: #5fce93; }
.hx-help-hero__stat-value.is-warn { color: #f0b35a; }
.hx-help-hero__stat-value.is-bad { color: #f07171; }
.hx-help-hero__stat-value.is-muted { color: rgba(255, 255, 255, 0.75); }

/* Panels / cards */
.hx-help-panel {
  background: var(--svc-surface);
  border-radius: var(--svc-radius);
  padding: 26px 28px;
  box-shadow: var(--svc-shadow);
  margin-bottom: 16px;
}

.hx-help-panel__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.hx-help-panel__title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.hx-help-panel__sub {
  font-size: 12.5px;
  color: var(--svc-muted-2);
  margin-top: 3px;
}

.hx-help-search-card {
  background: var(--svc-surface);
  border-radius: var(--svc-radius);
  padding: 30px 32px;
  box-shadow: var(--svc-shadow);
  margin-bottom: 16px;
}

.hx-help-search-card__title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.hx-help-search-card__sub {
  font-size: 13.5px;
  color: var(--svc-muted);
  margin-top: 5px;
}

.hx-help-search {
  position: relative;
  margin-top: 16px;
  max-width: 640px;
}

.hx-help-search input {
  width: 100%;
  box-sizing: border-box;
  border: 0;
  border-radius: 10px;
  background: #f7f9fb;
  box-shadow: inset 0 0 0 1px var(--svc-border);
  padding: 12px 14px 12px 44px;
  font-size: 14px;
  font-family: inherit;
  color: var(--svc-ink);
  outline: none;
}

html.dark .hx-help-search input {
  background: rgba(255, 255, 255, 0.04);
}

.hx-help-search input:focus {
  box-shadow: inset 0 0 0 1.5px var(--svc-accent);
}

.hx-help-search__icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #a3aebd;
  pointer-events: none;
}

.hx-help-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.hx-help-tag {
  background: #f4f6f9;
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 12.5px;
  color: #4b5c72;
  text-decoration: none !important;
  display: inline-block;
}

html.dark .hx-help-tag {
  background: rgba(255, 255, 255, 0.06);
  color: var(--svc-ink-2);
}

.hx-help-tag:hover {
  background: #e8ecf1;
  color: var(--svc-ink) !important;
}

html.dark .hx-help-tag:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Filters */
.hx-help-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.hx-help-filters {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.hx-help-filter {
  background: #f7f9fb;
  color: var(--svc-ink-2);
  border: 0;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 12.5px;
  cursor: pointer;
  font-family: inherit;
  box-shadow: inset 0 0 0 1px var(--svc-border);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none !important;
}

html.dark .hx-help-filter {
  background: rgba(255, 255, 255, 0.04);
}

.hx-help-filter span {
  opacity: 0.75;
  font-weight: 600;
}

.hx-help-filter.is-active {
  background: var(--svc-accent);
  color: #fff !important;
  box-shadow: none;
  font-weight: 600;
}

.hx-help-filter.is-active span {
  opacity: 0.9;
}

/* Category grid (KB) */
.hx-help-cats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.hx-help-cat {
  background: var(--svc-surface);
  border-radius: var(--svc-radius-sm);
  padding: 22px;
  box-shadow: var(--svc-shadow);
  display: flex;
  flex-direction: column;
  text-decoration: none !important;
  color: inherit !important;
  transition: box-shadow 0.18s ease;
  min-height: 100%;
}

.hx-help-cat:hover {
  box-shadow: var(--svc-shadow-hover);
}

.hx-help-cat__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.hx-help-cat__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  background: #e8f1fb;
  color: var(--svc-accent);
}

.hx-help-cat__icon.tone-2 { background: #eef6ea; color: #2a7549; }
.hx-help-cat__icon.tone-3 { background: #fdf3e6; color: #a8681a; }
.hx-help-cat__icon.tone-4 { background: #f3eef8; color: #6b4ea3; }
.hx-help-cat__icon.tone-5 { background: #eaf6f6; color: #1f7a7a; }
.hx-help-cat__icon.tone-6 { background: #fdeaea; color: #a83232; }

.hx-help-cat__count {
  font-size: 12px;
  color: #a3aebd;
  font-weight: 600;
}

.hx-help-cat__name {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.012em;
  margin-top: 14px;
  color: var(--svc-ink);
}

.hx-help-cat__desc {
  font-size: 12.5px;
  color: var(--svc-muted-2);
  line-height: 1.55;
  margin-top: 5px;
}

/* Download cards */
.hx-help-dl-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.hx-help-dl {
  background: var(--svc-surface);
  border-radius: var(--svc-radius-sm);
  padding: 22px;
  box-shadow: var(--svc-shadow);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.18s ease;
}

.hx-help-dl:hover {
  box-shadow: var(--svc-shadow-hover);
}

.hx-help-dl__top {
  display: flex;
  gap: 13px;
  min-width: 0;
}

.hx-help-dl__icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 38px;
  font-size: 15px;
  background: #e8f1fb;
  color: var(--svc-accent);
}

.hx-help-dl__icon.tone-2 { background: #eef6ea; color: #2a7549; }
.hx-help-dl__icon.tone-3 { background: #fdf3e6; color: #a8681a; }
.hx-help-dl__icon.tone-4 { background: #f3eef8; color: #6b4ea3; }

.hx-help-dl__title {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.35;
  color: var(--svc-ink);
}

.hx-help-dl__cat {
  font-size: 11.5px;
  color: #a3aebd;
  margin-top: 4px;
}

.hx-help-dl__desc {
  font-size: 13px;
  color: var(--svc-muted);
  line-height: 1.6;
  margin-top: 14px;
  flex: 1;
}

.hx-help-dl__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid var(--svc-line);
  gap: 10px;
}

.hx-help-dl__meta {
  font-size: 12px;
  color: #a3aebd;
}

.hx-help-dl__btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #f7f9fb;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12.5px;
  color: var(--svc-ink-2) !important;
  text-decoration: none !important;
  box-shadow: inset 0 0 0 1px var(--svc-border);
  white-space: nowrap;
}

html.dark .hx-help-dl__btn {
  background: rgba(255, 255, 255, 0.04);
}

.hx-help-dl__btn:hover {
  background: #fff;
  box-shadow: inset 0 0 0 1px #c9d3de;
}

/* Announcement cards */
.hx-help-posts {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hx-help-post {
  background: var(--svc-surface);
  border-radius: var(--svc-radius);
  padding: 28px 30px;
  box-shadow: var(--svc-shadow);
  transition: box-shadow 0.18s ease;
  text-decoration: none !important;
  color: inherit !important;
  display: block;
}

.hx-help-post:hover {
  box-shadow: var(--svc-shadow-hover);
}

.hx-help-post__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--svc-muted-2);
}

.hx-help-chip {
  background: #e8f1fb;
  color: var(--svc-accent);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 999px;
}

.hx-help-chip--warn {
  background: #fdf3e6;
  color: #a8681a;
}

.hx-help-chip--ok {
  background: #e6f3ea;
  color: #2a7549;
}

.hx-help-post__title {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.024em;
  line-height: 1.35;
  color: var(--svc-ink);
}

.hx-help-post__excerpt {
  font-size: 14px;
  color: var(--svc-muted);
  line-height: 1.65;
  margin-top: 10px;
  max-width: 820px;
}

.hx-help-post__more {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--svc-accent);
  font-weight: 500;
}

/* FAQ / popular list */
.hx-help-faq-list {
  background: var(--svc-surface);
  border-radius: var(--svc-radius);
  padding: 8px 30px 18px;
  box-shadow: var(--svc-shadow);
}

.hx-help-faq-item {
  border-top: 1px solid var(--svc-line);
}

.hx-help-faq-item:first-of-type {
  border-top: 0;
}

.hx-help-faq-item a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 18px 0;
  text-decoration: none !important;
  color: var(--svc-ink) !important;
  font-size: 14.5px;
  font-weight: 500;
}

.hx-help-faq-item a:hover {
  color: var(--svc-accent) !important;
}

.hx-help-faq-item__hint {
  font-size: 12.5px;
  color: var(--svc-muted-2);
  font-weight: 400;
  white-space: nowrap;
}

/* Issues / servers */
.hx-help-issue {
  padding: 18px 0;
  border-top: 1px solid var(--svc-line);
}

.hx-help-issue:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.hx-help-issue.is-affected {
  background: #fff8f0;
  margin: 0 -28px;
  padding: 18px 28px;
  border-top: 1px solid #f5e6d0;
}

html.dark .hx-help-issue.is-affected {
  background: rgba(168, 104, 26, 0.12);
  border-top-color: rgba(168, 104, 26, 0.25);
}

.hx-help-issue__title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 6px;
}

.hx-help-issue__meta {
  font-size: 12.5px;
  color: var(--svc-muted);
  margin-bottom: 10px;
}

.hx-help-issue__body {
  font-size: 13.5px;
  color: var(--svc-ink-2);
  line-height: 1.6;
}

.hx-help-server {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 0.7fr) 1fr 1fr;
  gap: 14px;
  align-items: center;
  padding: 16px 0;
  border-top: 1px solid var(--svc-line);
  font-size: 13px;
}

.hx-help-server:first-of-type {
  border-top: 0;
}

.hx-help-server__name {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.012em;
}

.hx-help-server__port {
  text-align: center;
  color: var(--svc-muted);
}

.hx-help-server__port .label-success {
  background: #e6f3ea !important;
  color: #2a7549 !important;
  border: 0;
  border-radius: 999px;
  padding: 3px 8px;
  font-weight: 600;
}

.hx-help-server__port .label-danger {
  background: #fdeaea !important;
  color: #a83232 !important;
  border: 0;
  border-radius: 999px;
  padding: 3px 8px;
  font-weight: 600;
}

.hx-help-empty {
  padding: 28px 8px;
  text-align: center;
  color: var(--svc-muted);
  font-size: 14px;
}

.hx-help-pager {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.hx-help-pager a,
.hx-help-pager span {
  min-width: 34px;
  height: 34px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  text-decoration: none !important;
  color: var(--svc-muted) !important;
  background: var(--svc-surface);
  box-shadow: inset 0 0 0 1px var(--svc-border);
  padding: 0 10px;
}

.hx-help-pager a.active,
.hx-help-pager span.active {
  background: #111a24;
  color: #fff !important;
  box-shadow: none;
  font-weight: 600;
}

.hx-help-pager a.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.hx-help-note {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 10px;
  background: #e8f1fb;
  color: var(--svc-ink-2);
  font-size: 13px;
}

html.dark .hx-help-note {
  background: rgba(31, 95, 168, 0.18);
}

/* Article / FAQ detail */
.hx-help-article {
  background: var(--svc-surface);
  border-radius: var(--svc-radius);
  padding: 32px 34px 28px;
  box-shadow: var(--svc-shadow);
}

.hx-help-article__head {
  margin-bottom: 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--svc-line);
}

.hx-help-article__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--svc-muted-2);
  margin-bottom: 12px;
}

.hx-help-article__meta a {
  color: var(--svc-accent) !important;
  text-decoration: none !important;
}

.hx-help-article__votes {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hx-help-article__title {
  margin: 0;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.028em;
  line-height: 1.3;
  color: var(--svc-ink);
}

.hx-help-article__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.hx-help-prose {
  font-size: 15px;
  line-height: 1.7;
  color: var(--svc-ink-2);
}

.hx-help-prose h1,
.hx-help-prose h2,
.hx-help-prose h3,
.hx-help-prose h4 {
  color: var(--svc-ink);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 1.4em 0 0.55em;
  line-height: 1.3;
}

.hx-help-prose h1 { font-size: 1.45em; }
.hx-help-prose h2 { font-size: 1.28em; }
.hx-help-prose h3 { font-size: 1.12em; }

.hx-help-prose p {
  margin: 0 0 1em;
}

.hx-help-prose ul,
.hx-help-prose ol {
  margin: 0 0 1em;
  padding-left: 1.35em;
}

.hx-help-prose li {
  margin: 0.35em 0;
}

.hx-help-prose a {
  color: var(--svc-accent) !important;
}

.hx-help-prose img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 12px 0;
}

.hx-help-prose pre,
.hx-help-prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92em;
}

.hx-help-prose pre {
  background: #f4f6f9;
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  box-shadow: inset 0 0 0 1px var(--svc-border);
}

html.dark .hx-help-prose pre {
  background: rgba(255, 255, 255, 0.04);
}

.hx-help-prose code {
  background: #f4f6f9;
  border-radius: 5px;
  padding: 0.1em 0.4em;
}

html.dark .hx-help-prose code {
  background: rgba(255, 255, 255, 0.06);
}

.hx-help-prose blockquote {
  margin: 1em 0;
  padding: 12px 16px;
  border-left: 3px solid var(--svc-accent);
  background: #f7f9fb;
  border-radius: 0 10px 10px 0;
  color: var(--svc-muted);
}

html.dark .hx-help-prose blockquote {
  background: rgba(255, 255, 255, 0.04);
}

.hx-help-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  font-size: 14px;
}

.hx-help-prose th,
.hx-help-prose td {
  border: 1px solid var(--svc-border);
  padding: 8px 10px;
  text-align: left;
}

.hx-help-prose th {
  background: #f7f9fb;
  font-weight: 600;
}

html.dark .hx-help-prose th {
  background: rgba(255, 255, 255, 0.04);
}

.hx-help-vote {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--svc-line);
}

.hx-help-vote__form {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.hx-help-vote__label {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--svc-ink);
}

.hx-help-vote__btns {
  display: flex;
  gap: 8px;
}

.hx-help-vote__done {
  font-size: 13.5px;
  color: var(--svc-muted);
}

.hx-help-article__nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.hx-help-article__share {
  display: flex;
  align-items: center;
  gap: 10px;
}

@media print {
  .hx-help-article__actions,
  .hx-help-vote,
  .hx-help-article__nav,
  .hx-right-rail,
  .hx-rightbar-edge,
  .left-sidebar,
  .hx-top-header {
    display: none !important;
  }
  .hx-help-article {
    box-shadow: none;
    padding: 0;
  }
}

@media (max-width: 700px) {
  .hx-help-article {
    padding: 22px 18px;
  }
  .hx-help-article__title {
    font-size: 22px;
  }
}

@media (max-width: 1100px) {
  .hx-help-cats { grid-template-columns: repeat(2, 1fr); }
  .hx-help-dl-grid { grid-template-columns: repeat(2, 1fr); }
  .hx-help-hero { grid-template-columns: 1fr; }
  .hx-help-hero__stats { justify-content: flex-start; }
  .hx-help-server {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 700px) {
  .hx-help-cats,
  .hx-help-dl-grid { grid-template-columns: 1fr; }
  .hx-help-search { max-width: none; }
}

/* Legal (términos / privacidad) — public accordion, same help tokens */
.hx-legal {
  max-width: none;
}

.hx-legal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}

.hx-legal-rail {
  position: sticky;
  top: calc(var(--shell-topbar-h, 64px) + 16px);
  display: grid;
  gap: 16px;
}

.hx-legal-panel {
  padding: 20px 22px;
  margin-bottom: 0;
}

.hx-legal-fact {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid var(--svc-line);
  font-size: 13px;
}

.hx-legal-fact:first-of-type {
  border-top: 0;
}

.hx-legal-fact__label {
  color: var(--svc-muted-2);
  font-size: 12px;
}

.hx-legal-fact__value {
  font-weight: 600;
  font-size: 12.5px;
  text-align: right;
}

.hx-legal-fact__link {
  font-weight: 600;
  font-size: 12.5px;
  color: var(--svc-accent);
  text-decoration: none;
}

.hx-legal-fact__link:hover {
  text-decoration: underline;
}

.hx-legal-panel__actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.hx-legal-toc {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 12px 0 0;
  padding: 0;
  border: 0;
}

.hx-legal-toc a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--svc-ink) !important;
  text-decoration: none !important;
  transition: background 0.14s ease, color 0.14s ease;
}

.hx-legal-toc a:hover,
.hx-legal-toc a:focus-visible {
  background: rgba(31, 95, 168, 0.06);
  color: var(--svc-accent) !important;
}

.hx-legal-toc a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--hx-focus, rgba(33, 58, 84, 0.22));
}

.hx-legal-toc__count {
  font-size: 11px;
  font-weight: 600;
  color: var(--svc-muted-2);
  background: var(--svc-line);
  padding: 1px 7px;
  border-radius: 999px;
}

.hx-legal-toc a:hover .hx-legal-toc__count {
  background: rgba(31, 95, 168, 0.1);
  color: var(--svc-accent);
}

.hx-legal-group {
  margin: 0 0 28px;
  scroll-margin-top: calc(var(--shell-topbar-h, 64px) + 16px);
}

.hx-legal-group__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 600;
  color: var(--svc-ink);
  letter-spacing: -0.01em;
}

.hx-legal-group__count {
  font-size: 11px;
  font-weight: 600;
  color: var(--svc-muted-2);
  background: var(--svc-line);
  padding: 2px 8px;
  border-radius: 999px;
}

/* Accordion: cada ítem es su propia tarjeta (separadas, no unidas) */
.hx-legal-acc {
  display: grid;
  gap: 10px;
}

.hx-legal-item {
  background: var(--svc-surface);
  border: 1px solid var(--svc-border);
  border-radius: var(--svc-radius-sm);
  box-shadow: var(--svc-shadow);
  scroll-margin-top: calc(var(--shell-topbar-h, 64px) + 16px);
  transition: box-shadow 160ms ease, border-color 160ms ease;
}

.hx-legal-item:hover {
  box-shadow: var(--svc-shadow-hover);
  border-color: #d3dce6;
}

.hx-legal-item[open] {
  border-color: rgba(31, 95, 168, 0.35);
}

.hx-legal-item summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  color: var(--svc-ink);
}

.hx-legal-item summary::-webkit-details-marker {
  display: none;
}

.hx-legal-item summary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--hx-focus, rgba(33, 58, 84, 0.22));
  border-radius: var(--svc-radius-sm);
}

.hx-legal-item__icon {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(31, 95, 168, 0.08);
  color: var(--svc-accent);
  font-size: 16px;
  transition: background 160ms ease, color 160ms ease;
}

.hx-legal-item[open] .hx-legal-item__icon {
  background: var(--svc-accent);
  color: #fff;
}

.hx-legal-item__title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

.hx-legal-item__chevron {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--svc-border);
  position: relative;
  transition: border-color 160ms ease, background 160ms ease;
}

.hx-legal-item__chevron::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--svc-muted-2);
  border-bottom: 1.5px solid var(--svc-muted-2);
  transform: translate(-50%, -65%) rotate(45deg);
  transition: transform 160ms ease;
}

.hx-legal-item:hover .hx-legal-item__chevron {
  border-color: var(--svc-accent);
}

.hx-legal-item[open] .hx-legal-item__chevron {
  background: rgba(31, 95, 168, 0.08);
  border-color: rgba(31, 95, 168, 0.35);
}

.hx-legal-item[open] .hx-legal-item__chevron::before {
  transform: translate(-50%, -35%) rotate(225deg);
  border-color: var(--svc-accent);
}

.hx-legal-item[open] summary {
  border-bottom: 1px solid var(--svc-line);
}

.hx-legal__intro {
  margin: 0 0 22px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--svc-page-hint);
  white-space: nowrap;
}

.hx-legal-item__body {
  padding: 20px 24px 24px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--svc-ink-2);
}

/* Reset prose dentro de legal — evita márgenes distintos título vs párrafo */
.hx-legal-item__body.hx-help-prose h1,
.hx-legal-item__body.hx-help-prose h2,
.hx-legal-item__body.hx-help-prose h3,
.hx-legal-item__body.hx-help-prose h4,
.hx-legal-item__body.hx-help-prose p,
.hx-legal-item__body.hx-help-prose ul,
.hx-legal-item__body.hx-help-prose ol {
  margin-left: 0;
  padding-left: 0;
  text-align: left;
}

.hx-legal-item__body.hx-help-prose > p {
  margin: 0 0 1em;
}

.hx-legal-item__body.hx-help-prose > p:last-child {
  margin-bottom: 0;
}

.hx-legal-item__body.hx-help-prose > ul,
.hx-legal-item__body.hx-help-prose > ol {
  margin: 0 0 1em;
  padding-left: 0;
  list-style: none;
}

.hx-legal-item__body.hx-help-prose > ul > li,
.hx-legal-clause ul > li {
  position: relative;
  padding-left: 1.2em;
}

.hx-legal-item__body.hx-help-prose > ul > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.68em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--svc-accent, #1f5fa8);
  opacity: 0.88;
  transform: translateY(-50%);
}

.hx-legal-item__body.hx-help-prose .hx-legal-clause ul,
.hx-legal-item__body.hx-help-prose .hx-legal-clause ol {
  margin: 0 0 0.75em;
  padding-left: 0;
  list-style: none;
}

.hx-legal-clause ul > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.68em;
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: var(--clause-accent, #1f5fa8);
  opacity: 0.92;
  transform: translateY(-50%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
}

html.dark .hx-legal-clause ul > li::before {
  box-shadow: none;
}

/* Cláusulas: banda full-width, título con borde, todo al mismo margen */
.hx-legal-clause {
  --clause-accent: #1f5fa8;
  margin: 0 0 12px;
  padding: 14px 16px 16px;
  border-left: 3px solid var(--clause-accent);
  border-radius: 0 10px 10px 0;
  background: rgba(31, 95, 168, 0.045);
}

.hx-legal-item__body.hx-help-prose .hx-legal-clause h4 {
  margin: 0 0 10px;
  padding: 0 0 8px;
  border-bottom: 2px solid var(--clause-accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.35;
  color: var(--clause-accent);
}

.hx-legal-item__body.hx-help-prose .hx-legal-clause p {
  margin: 0 0 0.75em;
  padding: 0;
}

.hx-legal-clause p {
  margin: 0 0 0.75em;
  padding: 0;
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--svc-ink-2);
}

.hx-legal-clause p:last-child {
  margin-bottom: 0;
}

.hx-legal-clause ul,
.hx-legal-clause ol {
  margin: 0 0 0.75em;
  padding-left: 0;
  list-style: none;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--svc-ink-2);
}

.hx-legal-clause ul:last-child,
.hx-legal-clause ol:last-child {
  margin-bottom: 0;
}

.hx-legal-clause li {
  margin: 0.25em 0;
}

.hx-legal-clause ul:has(> li:nth-child(6)) {
  columns: 2;
  column-gap: 28px;
}

.hx-legal-clause ul:has(> li:nth-child(6)) li {
  break-inside: avoid;
}

/* Tono por tipo */
.hx-legal-clause--blue  { --clause-accent: #1f5fa8; background: rgba(31, 95, 168, 0.045); }
.hx-legal-clause--green { --clause-accent: #0e8a5f; background: rgba(14, 138, 95, 0.05); }
.hx-legal-clause--amber { --clause-accent: #b45309; background: rgba(180, 83, 9, 0.05); }
.hx-legal-clause--red   { --clause-accent: #b91c1c; background: rgba(185, 28, 28, 0.045); }
.hx-legal-clause--purple { --clause-accent: #6d28d9; background: rgba(109, 40, 217, 0.045); }

/* Secciones numeradas — cards unicolor navy + número + icono SLI */
.hx-legal-clause--step {
  --clause-accent: #1f5fa8;
  background: rgba(31, 95, 168, 0.045);
}

.hx-legal-item__body.hx-help-prose .hx-legal-clause--step h4 {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 12px;
  padding: 0;
  border-bottom: 0;
  text-transform: none;
  letter-spacing: normal;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
}

.hx-legal-step__badge {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--clause-accent);
  color: #fff;
  margin-top: 1px;
}

.hx-legal-step__icon {
  font-size: 15px;
  line-height: 1;
  color: #fff;
}

.hx-legal-step__label {
  flex: 1;
  min-width: 0;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--svc-ink);
  padding-top: 4px;
}

html.dark .hx-legal-clause--step {
  background: rgba(96, 150, 214, 0.07);
}

html.dark .hx-legal-step__icon {
  color: #fff;
}

html.dark .hx-legal-step__label {
  color: var(--svc-ink);
}

/* Avisos de responsabilidad / advertencia (ámbar) */
.hx-legal-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 12px;
  padding: 14px 16px;
  border-left: 3px solid var(--notice-accent, #b45309);
  border-radius: 0 10px 10px 0;
  background: rgba(180, 83, 9, 0.08);
}

.hx-legal-notice--warn {
  --notice-accent: #b45309;
}

.hx-legal-notice--info {
  --notice-accent: #1f5fa8;
  background: rgba(31, 95, 168, 0.06);
}

.hx-legal-notice__icon {
  flex: 0 0 20px;
  width: 20px;
  font-size: 18px;
  line-height: 1;
  color: var(--notice-accent);
  margin-top: 3px;
}

.hx-legal-notice p {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--svc-ink-2);
}

html.dark .hx-legal-notice--warn {
  --notice-accent: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
}

html.dark .hx-legal-notice--info {
  --notice-accent: #60a5fa;
  background: rgba(96, 165, 250, 0.1);
}

@media (max-width: 1100px) {
  .hx-legal-layout {
    grid-template-columns: 1fr;
  }
  .hx-legal-rail {
    position: static;
    order: -1;
  }
  .hx-legal__intro {
    white-space: normal;
  }
  .hx-legal-item__body {
    padding: 16px 18px 20px;
  }
  .hx-legal-clause ul:has(> li:nth-child(6)) {
    columns: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hx-legal-item__chevron::before,
  .hx-legal-item__icon {
    transition: none;
  }
}

html.dark .hx-legal-item:hover {
  border-color: #33465e;
}

html.dark .hx-legal-item[open] {
  border-color: rgba(96, 150, 214, 0.45);
}

html.dark .hx-legal-item__icon {
  background: rgba(96, 150, 214, 0.14);
}

html.dark .hx-legal-item[open] .hx-legal-item__icon {
  background: var(--svc-accent);
  color: #fff;
}

html.dark .hx-legal-item__chevron {
  border-color: #33465e;
}

html.dark .hx-legal-item[open] .hx-legal-item__chevron {
  background: rgba(96, 150, 214, 0.14);
  border-color: rgba(96, 150, 214, 0.45);
}

html.dark .hx-legal-toc a:hover .hx-legal-toc__count {
  background: rgba(96, 150, 214, 0.15);
}

html.dark .hx-legal-clause--blue  { --clause-accent: #7aa7d9; background: rgba(96, 150, 214, 0.07); }
html.dark .hx-legal-clause--green { --clause-accent: #4ade80; background: rgba(74, 222, 128, 0.06); }
html.dark .hx-legal-clause--amber { --clause-accent: #fbbf24; background: rgba(251, 191, 36, 0.06); }
html.dark .hx-legal-clause--red   { --clause-accent: #f87171; background: rgba(248, 113, 113, 0.06); }
html.dark .hx-legal-clause--purple { --clause-accent: #a78bfa; background: rgba(167, 139, 250, 0.06); }

@media print {
  .hx-legal-rail,
  .hx-help-article__nav {
    display: none !important;
  }
  .hx-legal-layout {
    grid-template-columns: 1fr;
  }
  .hx-legal-item {
    border: 0;
    box-shadow: none;
    break-inside: avoid;
  }
  .hx-legal-item summary {
    padding: 8px 0;
  }
  .hx-legal-item__icon,
  .hx-legal-item__chevron {
    display: none;
  }
  .hx-legal-item__body {
    padding: 0 0 16px;
  }
}
