/* Dashboard IPM Motos — estilos propios (mobile-first). Paleta: docs/referencia/marca-ipm.md */
:root {
  --c-bg: #f4f5f6;
  --c-surface: #ffffff;
  --c-ink: #060a0d;
  --c-muted: #4d5560;
  --c-line: #b9bec4;
  --c-orange: #fc8a06;
  --c-orange-2: #fd6205;
  --c-accent-text: #df3201;
  --c-ok: #1d6b3a;
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-ink);
  font: 16px/1.5 var(--font);
}

a { color: var(--c-accent-text); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--c-ink);
  color: #fff;
}
.topbar__brand { font-weight: 700; letter-spacing: .02em; }
.topbar__brand span { color: var(--c-orange); }
.topbar__user { margin-left: auto; color: var(--c-line); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar a { color: var(--c-orange); }

.page { max-width: 1100px; margin: 0 auto; padding: 16px; }
.page h1 { font-size: 22px; line-height: 1.25; margin: 4px 0 16px; overflow-wrap: anywhere; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: 600 15px var(--font);
  cursor: pointer;
}
.btn--primary { background: linear-gradient(90deg, var(--c-orange), var(--c-orange-2)); color: var(--c-ink); }
.btn--ghost { background: transparent; border-color: var(--c-line); color: inherit; }
.btn--small { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--c-orange);
  outline-offset: 2px;
}

.card { background: var(--c-surface); border-radius: var(--radius); padding: 16px; box-shadow: 0 1px 2px rgb(6 10 13 / .08); }

.notice { padding: 10px 12px; border-radius: 8px; font-size: 15px; }
.notice--error { background: #fde8e2; color: #8a1c00; }
.notice--ok { background: #e3f3e8; color: var(--c-ok); }
.notice[hidden] { display: none; }

/* Formularios */
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.field > span, .field legend { font-weight: 600; font-size: 14px; }
.field small { color: var(--c-muted); font-size: 13px; }
input, textarea, select {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--c-line);
  border-radius: 8px;
  background: #fff;
  color: var(--c-ink);
  font: 16px/1.4 var(--font);
}
textarea { min-height: 96px; resize: vertical; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }

/* Login */
.login { max-width: 400px; margin: 10vh auto 0; }
.login h1 { text-align: center; }

/* Catálogo */
.search { margin-bottom: 12px; }
.count { color: var(--c-muted); font-size: 14px; margin: 0 0 8px; }
.products { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.product-row a {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  padding: 12px 14px;
  background: var(--c-surface);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 1px 2px rgb(6 10 13 / .08);
}
.product-row a:hover { box-shadow: 0 0 0 2px var(--c-orange); }
.product-row__name { font-weight: 600; grid-column: 1 / -1; }
.product-row__slug { color: var(--c-muted); font-size: 13px; overflow-wrap: anywhere; }
.product-row__meta { display: flex; flex-wrap: wrap; gap: 4px 14px; grid-column: 1 / -1; font-size: 14px; }
.muted { color: var(--c-muted); }

/* Ficha */
.layout { display: grid; gap: 16px; }
.section-title { font-size: 17px; margin: 0 0 12px; }
.grid-2 { display: grid; gap: 0 12px; }
.rows { display: grid; gap: 8px; margin-bottom: 8px; }
.row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; align-items: center; }
.row--badge { grid-template-columns: 1fr 120px auto; }
.row .btn { min-height: 44px; padding: 0 12px; }
.savebar {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  margin: 16px -16px -16px;
  background: var(--c-surface);
  border-top: 1px solid var(--c-line);
}
.savebar .notice { flex: 1 1 200px; }

.ro dt { font-weight: 600; font-size: 14px; margin-top: 10px; }
.ro dd { margin: 2px 0 0; overflow-wrap: anywhere; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 6px 6px; border-bottom: 1px solid #e3e5e8; vertical-align: top; }
td { overflow-wrap: anywhere; }

@media (min-width: 720px) {
  .page { padding: 24px; }
  .page h1 { font-size: 26px; }
  .product-row a { grid-template-columns: 1fr auto; }
  .product-row__name { grid-column: 1; }
  .product-row__meta { grid-column: 2; grid-row: 1 / span 2; flex-direction: column; align-items: flex-end; justify-content: center; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1024px) {
  .layout { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Ficha: categorías, guía y variantes (SPEC-ADMIN-003) */
.categories { display: grid; gap: 12px; margin-bottom: 8px; }
.categories fieldset { border: 1px solid #e3e5e8; border-radius: 8px; padding: 8px 12px 10px; }
.categories legend { font-weight: 600; font-size: 14px; padding: 0 4px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 15px; }
.check input { width: 20px; height: 20px; min-height: 0; flex: none; accent-color: var(--c-orange-2); }
.check--parent { font-style: italic; }
.check--unknown { color: #8a1c00; }
.variants-help { font-size: 14px; margin: 0 0 8px; }
.variants { display: grid; gap: 10px; margin-bottom: 8px; }
.variant { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 10px; border: 1px solid #e3e5e8; border-radius: 8px; }
.variant__sku { grid-column: 1 / -1; }
.variant__status { grid-column: 1 / -1; font-size: 13px; }
.variant__status--ok { color: var(--c-ok); }
.variant__status--none { color: #8a1c00; }
.variant .btn { grid-column: 1 / -1; justify-self: start; }
.options-preview { font-size: 14px; color: var(--c-muted); margin: 10px 0 0; }

@media (min-width: 720px) {
  .categories { grid-template-columns: 1fr 1fr; }
  .variant { grid-template-columns: 1.4fr 1fr 1fr auto; align-items: center; }
  .variant__sku { grid-column: auto; }
  .variant .btn { grid-column: auto; }
}

/* Ficha: fotos (SPEC-ADMIN-004; desde SPEC-ADMIN-006 solo el resumen y utilidades) */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.subsection { font-size: 15px; margin: 16px 0 8px; }
.photos-help { font-size: 14px; margin: 0 0 8px; }

/* Ficha: envío (SPEC-ENVIOS-002) */
.shipping-help { font-size: 14px; margin: 0 0 8px; }
.shipping-source { font-size: 14px; font-weight: 600; margin: 0 0 10px; }
.grid-4 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (min-width: 720px) {
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Catálogo: marca y filtro «Sin envío» (SPEC-ENVIOS-002) */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin: -4px 0 8px; }
.tag-noship { display: inline-block; padding: 1px 8px; border-radius: 999px; background: #fde8e2; color: #8a1c00; font-size: 13px; font-weight: 600; }

/* Fotos de la ficha (SPEC-ADMIN-006): resumen en la ficha, miniatura en la lista y página fotos.html */
.photos-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 8px; }
.photos-summary__thumb { width: 80px; height: 80px; flex: none; overflow: hidden; border: 1px solid var(--c-line); border-radius: 8px; background: #fff; }
.photos-summary__thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.photos-summary__count { font-weight: 600; }

.product-row a { grid-template-columns: 48px minmax(0, 1fr); }
.product-row__thumb { grid-column: 1; grid-row: 1 / span 3; align-self: start; width: 48px; height: 48px; overflow: hidden; border: 1px solid #e3e5e8; border-radius: 6px; background: #fff; }
.product-row__thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.product-row__name, .product-row__slug, .product-row__meta { grid-column: 2; }
@media (min-width: 720px) {
  .product-row a { grid-template-columns: 48px minmax(0, 1fr) auto; }
  .product-row__thumb { grid-row: 1 / span 2; }
  .product-row__meta { grid-column: 3; grid-row: 1 / span 2; }
}

.photos-page { padding-bottom: 210px; }
.photos-page .btn--small { min-height: 44px; }
.ph-section.card { padding: 12px; }
.ph-links { display: flex; flex-wrap: wrap; gap: 0 18px; margin: -10px 0 10px; font-size: 15px; }
.ph-links a { display: inline-flex; align-items: center; min-height: 44px; }
.ph-section { margin-bottom: 16px; }
.ph-section--drop { box-shadow: 0 0 0 3px var(--c-orange-2); background: #fff7ee; }
.ph-help { font-size: 14px; margin: 0 0 10px; }
.ph-add { display: grid; gap: 6px; margin-bottom: 12px; }
.ph-add__btn { width: 100%; min-height: 52px; font-size: 16px; }
.ph-add__hint { margin: 0; font-size: 13px; }
@media (hover: none) { .ph-only-pc { display: none; } }
.ph-rejects { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.ph-rejects:empty { display: none; }
.ph-rejects li { padding: 10px 12px; border-radius: 8px; background: #fde8e2; color: #8a1c00; font-size: 14px; }

/* Cuadrícula de fotos (galería y fotos de efectos) */
.ph-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ph-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 8px;
  border: 1px solid #e3e5e8;
  border-radius: var(--radius);
  background: var(--c-surface);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.ph-tile--new { border-color: var(--c-orange); }
.ph-tile--error { border-color: #b3261e; }
.ph-tile__img { position: relative; aspect-ratio: 1; overflow: hidden; border: 1px solid #eceef0; border-radius: 6px; background: #fff; cursor: grab; }
.ph-tile--extra .ph-tile__img { cursor: default; }
.ph-tile__img img, .ph-spin__item img, .ph-slot__img img, .ph-choice img, .ph-color__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
}
.ph-tile__n { position: absolute; top: 6px; left: 6px; display: grid; place-items: center; min-width: 28px; height: 28px; padding: 0 7px; border-radius: 999px; background: var(--c-ink); color: #fff; font-size: 14px; font-weight: 700; }
.ph-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.ph-tags:empty { display: none; }
.ph-tag { padding: 2px 8px; border-radius: 999px; background: #fff1e0; color: #7a3300; font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.ph-tag--main { background: var(--c-ink); color: #fff; }
.ph-tag--new { background: var(--c-orange); color: var(--c-ink); font-weight: 600; }
.ph-tag--muted { background: var(--c-bg); color: var(--c-muted); }
.ph-status { display: grid; gap: 4px; font-size: 13px; }
.ph-status:empty { display: none; }
.ph-status progress { width: 100%; height: 8px; overflow: hidden; border: 0; border-radius: 4px; background: #e3e5e8; -webkit-appearance: none; appearance: none; }
.ph-status progress::-webkit-progress-bar { border-radius: 4px; background: #e3e5e8; }
.ph-status progress::-webkit-progress-value { border-radius: 4px; background: var(--c-orange-2); }
.ph-status progress::-moz-progress-bar { border-radius: 4px; background: var(--c-orange-2); }
.ph-status__ok { color: var(--c-ok); font-weight: 600; }
.ph-status__error { color: #8a1c00; }
.ph-tile__row { display: grid; grid-template-columns: 44px 44px minmax(0, 1fr); gap: 4px; }
.ph-tile__row .btn, .ph-tile__first { padding: 0 6px; }
.ph-tile__first { width: 100%; }
.ph-menu__toggle { width: 100%; list-style: none; }
.ph-menu__toggle::-webkit-details-marker { display: none; }
.ph-menu__toggle::after { content: "▾"; margin-left: 6px; }
.ph-menu[open] .ph-menu__toggle::after { content: "▴"; }
.ph-menu__list { display: grid; gap: 2px; margin-top: 4px; padding: 4px; border: 1px solid var(--c-line); border-radius: 8px; background: #fff; }
.ph-menu__item { min-height: 44px; padding: 6px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--c-ink); font: 14px/1.3 var(--font); text-align: left; cursor: pointer; }
.ph-menu__item:hover:not(:disabled) { background: #fff1e0; }
.ph-menu__item:disabled { color: var(--c-muted); cursor: default; }
.ph-menu__item:focus-visible, .ph-links a:focus-visible, .ph-choice:focus-visible { outline: 3px solid var(--c-orange); outline-offset: 2px; }

/* Arrastre: la foto agarrada queda tenue, una copia sigue al puntero y una barra naranja marca el destino. */
.ph-dragging { opacity: .35; }
.ph-is-dragging, .ph-is-dragging * { cursor: grabbing !important; }
.ph-ghost { position: fixed; top: 0; left: 0; z-index: 50; object-fit: contain; border: 2px solid var(--c-orange-2); border-radius: 8px; background: #fff; box-shadow: 0 8px 24px rgb(6 10 13 / .3); pointer-events: none; }
.ph-drop-before::before, .ph-drop-after::after { content: ""; position: absolute; top: 4px; bottom: 4px; width: 5px; border-radius: 3px; background: var(--c-orange-2); }
.ph-drop-before::before { left: -8px; }
.ph-drop-after::after { right: -8px; }

/* Efectos */
.ph-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ph-slot { display: grid; align-content: start; gap: 6px; padding: 8px; border: 1px solid #e3e5e8; border-radius: var(--radius); }
.ph-slot__title { margin: 0; font-size: 14px; }
.ph-slot__img { display: grid; place-items: center; aspect-ratio: 1; overflow: hidden; border: 1px solid #eceef0; border-radius: 6px; background: #fff; }
.ph-slot__empty { color: var(--c-muted); font-size: 14px; }
.ph-slot__name { margin: 0; color: var(--c-muted); font-size: 13px; }
.ph-count { font-size: 14px; font-weight: 400; }
.ph-spin { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.ph-spin__item { position: relative; display: grid; gap: 6px; min-width: 0; padding: 8px; border: 1px solid #e3e5e8; border-radius: var(--radius); background: var(--c-surface); cursor: grab; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.ph-spin__item img { aspect-ratio: 1; height: auto; border: 1px solid #eceef0; border-radius: 6px; background: #fff; }
.ph-spin__name { font-size: 13px; font-weight: 600; }
.ph-spin__relief { color: var(--c-muted); font-size: 12px; }
.ph-spin__relief--ok { color: var(--c-ok); }
.ph-note { margin: 0 0 8px; color: var(--c-muted); font-size: 14px; }
.ph-note--error { color: #8a1c00; font-weight: 600; }

/* Foto de cada color */
.ph-color { min-width: 0; margin: 0 0 10px; padding: 8px 10px 10px; border: 1px solid #e3e5e8; border-radius: 8px; }
.ph-color legend { padding: 0 4px; font-size: 14px; font-weight: 600; }
.ph-color__strip { display: flex; gap: 8px; overflow-x: auto; padding: 5px 4px 8px; }
.ph-color__opt { position: relative; flex: none; cursor: pointer; }
.ph-color__opt input { position: absolute; width: 1px; height: 1px; min-height: 0; opacity: 0; }
.ph-color__thumb, .ph-color__none { position: relative; display: grid; place-items: center; width: 72px; height: 72px; overflow: hidden; border: 2px solid var(--c-line); border-radius: 8px; background: #fff; font-size: 13px; }
.ph-color__n { position: absolute; top: 3px; left: 3px; min-width: 20px; padding: 0 5px; border-radius: 999px; background: var(--c-ink); color: #fff; font-size: 12px; font-weight: 700; text-align: center; }
.ph-color__opt input:checked + * { border-color: var(--c-orange-2); box-shadow: 0 0 0 2px var(--c-orange-2); }
.ph-color__opt input:focus-visible + * { outline: 3px solid var(--c-orange); outline-offset: 2px; }

/* Aviso «Deshacer» y barra de guardado, fijos abajo */
.ph-dock { position: fixed; right: 0; bottom: 0; left: 0; z-index: 20; display: grid; gap: 8px; pointer-events: none; }
.ph-dock > * { pointer-events: auto; }
.ph-toast { display: flex; align-items: center; gap: 10px; width: min(640px, calc(100% - 24px)); margin: 0 auto; padding: 10px 12px; border-radius: var(--radius); background: var(--c-ink); color: #fff; box-shadow: 0 6px 20px rgb(6 10 13 / .3); }
.ph-toast p { flex: 1; margin: 0; font-size: 14px; }
.ph-toast .btn { flex: none; border-color: var(--c-orange); color: var(--c-orange); }
.ph-savebar { display: grid; gap: 8px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--c-line); background: var(--c-surface); box-shadow: 0 -2px 10px rgb(6 10 13 / .08); }
.ph-savebar--dirty { border-top: 3px solid var(--c-orange-2); }
.ph-savebar__text { margin: 0; font-size: 15px; font-weight: 600; }
.ph-savebar__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ph-savebar__actions .btn { padding: 0 10px; }
.ph-live { margin: 0; color: var(--c-muted); font-size: 14px; }
.ph-live:empty { display: none; }

.ph-dialog { width: min(640px, calc(100% - 24px)); max-height: calc(100dvh - 32px); padding: 0; overflow: hidden; border: 0; border-radius: var(--radius); box-shadow: 0 10px 40px rgb(6 10 13 / .35); }
.ph-dialog form { display: flex; flex-direction: column; max-height: calc(100dvh - 32px); padding: 16px 16px 0; }
.ph-dialog::backdrop { background: rgb(6 10 13 / .55); }
.ph-choices { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); grid-auto-rows: max-content; gap: 8px; margin: 4px -4px 0; padding: 4px; }
.ph-choice { display: grid; gap: 4px; min-height: 44px; padding: 4px; border: 2px solid var(--c-line); border-radius: 8px; background: #fff; color: var(--c-ink); font: 13px var(--font); cursor: pointer; }
.ph-choice img { aspect-ratio: 1; height: auto; }
.ph-choice:hover { border-color: var(--c-orange-2); }
.ph-dialog__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin: 0 -16px; padding: 12px 16px; border-top: 1px solid var(--c-line); background: var(--c-surface); }

@media (min-width: 720px) {
  .photos-page { padding-bottom: 130px; }
  .ph-section.card { padding: 16px; }
  .ph-grid { gap: 10px; }
  .ph-savebar { grid-template-columns: 1fr auto; align-items: center; padding-inline: max(24px, calc((100% - 1100px) / 2 + 24px)); }
  .ph-savebar__actions { display: flex; }
  .ph-savebar__actions .btn { padding: 0 18px; }
  .ph-live { grid-column: 1 / -1; }
}

/* Objetivos táctiles ≥ 44 px en la barra superior de todas las páginas (SPEC-ADMIN-006, CA-11) */
.topbar a { display: inline-flex; align-items: center; min-height: 44px; }
.topbar .btn--small { min-height: 44px; }

/* Fotos: al llevar algo a la vista (foco con Tab, scrollIntoView) no queda bajo la barra superior ni la de guardado. */
html:has(body.photos-page) { scroll-padding: 76px 0 230px; }
@media (min-width: 720px) { html:has(body.photos-page) { scroll-padding-bottom: 150px; } }

/* Contenido del sitio (SPEC-ADMIN-007). Usa la barra de guardado y los márgenes de .photos-page. */
.topbar a { white-space: nowrap; }
.topbar a[aria-current="page"] { color: #fff; text-decoration: none; }
.ct-intro { margin: -8px 0 4px; font-size: 15px; }
.ct-sections { display: grid; gap: 12px; }
.ct-section.card { padding: 0; }
.ct-section > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; min-height: 56px; padding: 14px 16px; cursor: pointer; list-style: none; }
.ct-section > summary::-webkit-details-marker { display: none; }
.ct-section > summary::before { content: "▸"; color: var(--c-accent-text); transition: transform .15s; }
.ct-section[open] > summary::before { transform: rotate(90deg); }
.ct-section > summary:focus-visible { outline: 3px solid var(--c-orange); outline-offset: -3px; border-radius: var(--radius); }
.ct-section__title { font-size: 17px; font-weight: 700; }
.ct-section__count { color: var(--c-muted); font-size: 14px; }
.ct-section--dirty > summary { box-shadow: inset 4px 0 0 var(--c-orange-2); border-radius: var(--radius); }
.ct-section__body { padding: 0 16px 8px; border-top: 1px solid var(--c-line); }
.ct-section__body .subsection { margin: 18px 0 8px; }
.ct-field { padding: 10px 0 12px 10px; margin-left: -10px; border-left: 3px solid transparent; }
.ct-field--changed { border-left-color: var(--c-line); }
.ct-field--dirty { border-left-color: var(--c-orange-2); }
.ct-field--error { border-left-color: #b42318; }
.ct-field--error input, .ct-field--error textarea { border-color: #b42318; }
.ct-label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 2px; }
.ct-tag { display: inline-block; margin-left: 4px; color: var(--c-accent-text); font-size: 13px; font-weight: 600; }
.ct-tag:empty { display: none; }
.ct-help { margin: 0 0 6px; color: var(--c-muted); font-size: 14px; }
.ct-field textarea { min-height: 0; }
.ct-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; margin-top: 4px; }
.ct-count { color: var(--c-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.ct-count--over { color: #b42318; font-weight: 700; }
.ct-msg { margin: 4px 0 0; color: var(--c-muted); font-size: 14px; }
.ct-msg--error { color: #8a1c00; font-weight: 600; }
.ct-msg:empty { display: none; }
.ct-orig { margin: 4px 0 0; color: var(--c-muted); font-size: 13px; overflow-wrap: anywhere; }
@media (min-width: 720px) {
  .ct-section > summary { padding-inline: 20px; }
  .ct-section__body { padding: 0 20px 12px; }
}
@media (prefers-reduced-motion: reduce) { .ct-section > summary::before { transition: none; } }

/* Cuenta (SPEC-ADMIN-005) */
.account { max-width: 520px; }
.account__help { margin: 0 0 14px; font-size: 15px; }
.account__submit { width: 100%; }
@media (min-width: 720px) { .account__submit { width: auto; } }
.publish { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: -4px 0 14px; padding: 10px 12px; border-radius: 8px; background: #e3f3e8; color: var(--c-ok); font-size: 15px; }
.publish--pending { background: #fff1df; color: var(--c-ink); box-shadow: inset 4px 0 0 var(--c-orange-2); }
.publish__text { flex: 1 1 240px; margin: 0; }
.publish code { padding: 1px 6px; border-radius: 4px; background: rgb(6 10 13 / .08); font-size: 14px; }
.publish .btn { min-height: 44px; }

/* Barra superior en celular (SPEC-ADMIN-005): con «Cuenta» no cabía a 390 px. Se acortan los rótulos
   («Contenido», «IPM Motos»), se oculta el correo y, si aun así no cabe, pasa a dos filas sin desbordar. */
.topbar { flex-wrap: wrap; row-gap: 0; }
.topbar__brand { white-space: nowrap; }
.topbar__brand .topbar__more { color: inherit; }
@media (max-width: 599px) {
  .topbar { gap: 4px 12px; }
  .topbar__more, .topbar__user { display: none; }
  .topbar #logout { margin-left: auto; }
}
