/* La Familia admin. One stylesheet, one rule per component; the site's warm
   black, amber, DM Sans and Instrument Serif. Sections follow the page from
   the outside in: tokens, base, shell, page header, building blocks, views.
   Forms are one column; editors split their fields into tabs, never into a
   side column. */

@font-face { font-family: 'DM Sans'; src: url('/fonts/dm-sans/dm-sans-v15-latin-regular.woff2') format('woff2'); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url('/fonts/dm-sans/dm-sans-v15-latin-600.woff2') format('woff2'); font-style: normal; font-weight: 600; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url('/fonts/dm-sans/dm-sans-v15-latin-700.woff2') format('woff2'); font-style: normal; font-weight: 700; font-display: swap; }
@font-face { font-family: 'Instrument Serif'; src: url('/fonts/instrument-serif/instrument-serif-v4-latin-regular.woff2') format('woff2'); font-style: normal; font-weight: 400; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;
  --bg: #0b0b0b; --surface: #121212; --raised: #1a1a1a; --line: #383633; --line-strong: #625c53;
  --ink: #f1eee8; --muted: #b5b0a7; --accent: #fca311; --accent-hover: #ffbd4a; --danger: #ffaaa1;
  --radius: 8px; --radius-sm: 4px;
  --pad: 1.5rem; --gap: 1.5rem; --field-gap: 1.25rem; --stack: .75rem; --control: 44px;
  --page-max: 1360px; --form-max: 46rem;
  /* What a sticky bar sits under: nothing, or the tab bar (#708). */
  --shell-top: 0px;
  --serif: 'Instrument Serif', Georgia, serif; --sans: 'DM Sans', system-ui, sans-serif;
  font-family: var(--sans); line-height: 1.55; color: var(--ink); background: var(--bg);
}
@media (max-width: 640px) { :root { --pad: 1rem; --gap: 1rem; } }

/* ---------- Base ---------- */
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); display: grid; grid-template-columns: 236px minmax(0, 1fr); align-items: start; }
h1, h2 { font-family: var(--serif); font-weight: 400; line-height: 1.08; letter-spacing: -.02em; overflow-wrap: anywhere; }
h2 { font-size: 1.6rem; margin: 0 0 1rem; }
h3, h4 { margin: 0; font-size: .95rem; font-weight: 600; }
p { max-width: 80ch; margin: 0 0 .75rem; }
.empty-state, .empty-search, .result-count, .table-count, .notice-item p { max-width: none; }
a { color: var(--accent); text-underline-offset: .2em; }
code { overflow-wrap: anywhere; }
small, .muted, .field-hint { color: var(--muted); font-size: .85rem; }
/* A result printed as text (Importar el histórico, Vaciar todo) wraps inside its card: long JSON lines break anywhere (#838). */
pre.muted { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; }
[hidden] { display: none !important; }
:where(button, a, input, textarea, select, summary, .table, [role="tabpanel"]):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1:focus, [role="tabpanel"]:focus { outline: none; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }

/* ---------- Shell: sidebar, mobile menu, main (#313) ---------- */
.skip-link { position: fixed; top: .5rem; left: 1rem; z-index: 30; padding: .75rem 1rem; background: var(--accent); color: var(--bg); opacity: 0; pointer-events: none; }
.skip-link:focus { opacity: 1; pointer-events: auto; }
.icon { flex: 0 0 auto; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100dvh; border-right: 1px solid var(--line); background: linear-gradient(180deg, #141311, var(--surface) 30%); }
.sidebar-head { padding: 1.25rem 1.4rem .75rem; }
.brand { display: block; color: var(--ink); text-decoration: none; }
.brand img { display: block; width: 172px; max-width: 100%; height: auto; }
.brand-tag { display: inline-block; margin: .6rem 0 0; padding: .2rem .55rem; border: 1px solid #fca31140; border-radius: 999px; background: #fca31114; color: var(--accent); font-size: .62rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
.sidebar nav, #mobile-menu nav { display: flex; flex-direction: column; gap: .15rem; }
.sidebar nav { flex: 1; padding: .25rem .85rem 1rem; overflow-y: auto; scrollbar-width: thin; }
/* Groups fold away; the current page's group is always open. */
.nav-group { margin: .6rem 0 0; }
.nav-group:first-child { margin-top: .25rem; }
/* Publicación stands alone above the groups (#443): it publishes what every group saves. */
nav > a.nav-publication { margin-top: .25rem; }
.nav-group > summary { display: flex; align-items: center; gap: .5rem; min-height: 32px; margin: 0 0 .2rem; padding: .3rem .75rem; border-radius: var(--radius-sm); color: var(--muted); font-size: .64rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; cursor: pointer; list-style: none; user-select: none; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after { content: ''; margin-left: auto; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform .15s; opacity: .7; }
.nav-group:not([open]) > summary::after { transform: rotate(-45deg); }
.nav-group > summary:hover { color: var(--ink); background: var(--raised); }
nav a[data-view] { position: relative; display: flex; align-items: center; gap: .7rem; min-height: 36px; padding: .4rem .75rem .4rem .85rem; border-radius: var(--radius-sm); color: var(--muted); font-size: .9rem; font-weight: 500; text-decoration: none; line-height: 1.3; }
nav a[data-view] .icon { opacity: .8; }
nav a[data-view] .nav-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
nav a[data-view]:hover { color: var(--ink); background: var(--raised); }
nav a[data-view]:hover .icon { opacity: 1; }
nav a[data-view]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
nav a[data-view][aria-current="page"] { color: var(--accent); background: #fca31114; font-weight: 600; }
nav a[data-view][aria-current="page"] .icon { opacity: 1; }
nav a[data-view][aria-current="page"]::before { content: ''; position: absolute; inset: 7px auto 7px 0; width: 2px; border-radius: 2px; background: var(--accent); }
.nav-badge { min-width: 1.4rem; padding: .05rem .4rem; border-radius: 999px; background: var(--accent); color: var(--bg); font-size: .68rem; font-weight: 700; text-align: center; line-height: 1.4; }
/* The foot: the web, the account, the version. */
.sidebar-foot { padding: .5rem .85rem .85rem; border-top: 1px solid var(--line); }
.site-link { display: flex; align-items: center; gap: .7rem; min-height: 36px; padding: .4rem .85rem; border-radius: var(--radius-sm); color: var(--muted); font-size: .85rem; text-decoration: none; }
.site-link:hover { color: var(--ink); background: var(--raised); }
.account-link { display: flex; align-items: center; gap: .7rem; min-height: 50px; margin: .25rem 0 0; padding: .45rem .6rem .45rem .5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--ink); text-decoration: none; }
.account-link:hover { border-color: var(--line-strong); background: var(--raised); }
.account-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.account-link[aria-current="page"] { border-color: #fca31160; background: #fca3110f; }
.account-link .icon { color: var(--muted); width: 16px; height: 16px; }
.account-avatar { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), #b86a00); color: var(--bg); font-size: .78rem; font-weight: 700; letter-spacing: .04em; }
.account-text { display: grid; flex: 1; min-width: 0; }
.account-name { font-size: .85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-roles { color: var(--muted); font-size: .72rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-version { margin: .6rem .85rem 0; color: var(--muted); font-size: .68rem; letter-spacing: .04em; font-variant-numeric: tabular-nums; opacity: .8; }
.menu-toggle, #mobile-menu:not([open]) { display: none; }
#mobile-menu { inset: 0; width: 100%; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; color: var(--ink); background: var(--bg); }
#mobile-menu[open] { display: flex; flex-direction: column; }
#mobile-menu::backdrop { background: var(--bg); }
.mobile-menu-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem; border-bottom: 1px solid var(--line); }
.mobile-menu-header > span { font-size: .85rem; color: var(--muted); }
.mobile-menu-content { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: env(safe-area-inset-bottom); }
#mobile-menu nav { padding: .5rem 1rem 1rem; }
#mobile-menu nav a[data-view] { min-height: 48px; padding: .8rem 1rem; background: var(--surface); border: 1px solid var(--line); }
#mobile-menu nav a[data-view][aria-current="page"] { background: #fca3111c; border-color: var(--accent); }
#mobile-menu nav a[data-view][aria-current="page"]::before { display: none; }
#mobile-menu .nav-group > summary { min-height: 44px; }
#mobile-menu .sidebar-foot { padding: .75rem 1rem 1.5rem; }
#mobile-menu .site-link { min-height: 48px; border: 1px solid var(--line); background: var(--surface); }
body.menu-open { overflow: hidden; }
main { width: 100%; max-width: var(--page-max); min-width: 0; margin: 0; padding: 2.5rem clamp(1rem, 3vw, 3rem) 7rem; }
/* The page's rhythm: whatever a view stacks in main or in a card, never less
   than one step apart. Margins collapse, so a block that asks for more keeps it. */
main > :not(.page-header) + * { margin-top: var(--gap); }
.card > * + *, .tab-panel > * + *, .form-section > * + * { margin-top: var(--stack); }
main > .result-count + *, main > .section-title + *, main > h2 + *, main > h3 + * { margin-top: .5rem; }
main > .section-title, main > h2:not(:first-child) { margin-bottom: 0; }
main > .section-title:not(:first-child) { margin-top: 2.25rem; }
/* Signed out (#312): no sidebar at all; the sign-in screen is the page. */
body.signed-out { grid-template-columns: minmax(0, 1fr); }
body.signed-out .sidebar { display: none; }
body.signed-out main { max-width: none; padding: 0; }
@media (max-width: 900px) {
  body { display: block; }
  .sidebar { position: relative; height: auto; border-right: 0; border-bottom: 1px solid var(--line); background: var(--surface); }
  .sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1rem; }
  .brand img { width: 140px; }
  .brand-tag { margin-top: .4rem; font-size: .58rem; }
  .sidebar > nav, .sidebar > .sidebar-foot { display: none; }
  .menu-toggle { display: inline-flex; min-height: 40px; }
  main { padding-top: 1.5rem; }
}

/* ---------- Page header: breadcrumbs, title, description, actions ---------- */
.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem 2rem; flex-wrap: wrap; margin: 0 0 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.page-heading { flex: 1 1 28rem; min-width: 0; }
.page-heading h1 { margin: 0; font-size: clamp(2rem, 3vw, 2.75rem); max-width: 36ch; text-wrap: balance; }
.page-description { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .6rem 0 0; color: var(--muted); font-size: .95rem; max-width: 72ch; }
.page-description + .page-description { margin-top: .4rem; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .75rem; }
/* A header action is a header action, whatever size it was made at. */
.page-actions button.small, .page-actions .button.small { min-height: var(--control); padding: .65rem 1rem; font-size: .9rem; }
.page-actions:empty { display: none; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .35rem; margin: 0 0 .5rem; padding: 0; list-style: none; color: var(--muted); font-size: .85rem; }
.breadcrumbs li { display: flex; align-items: center; gap: .35rem; min-width: 0; }
.breadcrumbs li[aria-current] { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; min-width: min(100%, 10ch); }
.breadcrumbs ol { flex-wrap: nowrap; }
/* The row never overflows (#694): the first crumb keeps its width, the ones between shorten with an ellipsis before the current one does. */
.breadcrumbs li:not([aria-current]) { flex: 0 8 auto; }
.breadcrumbs li:first-child:not([aria-current]) { flex: none; }
.breadcrumbs li + li:not([aria-current])::before { content: '›'; color: var(--line-strong); }
.breadcrumbs li:first-child[aria-current]::before { content: none; }
.breadcrumbs li[aria-current] { color: var(--muted); }
.breadcrumbs li[aria-current]::before { content: '›'; margin-right: .35rem; color: var(--line-strong); }
button.crumb, a.crumb { display: block; max-width: calc(100% + .7rem); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 28px; padding: 0 .35rem; margin: 0 -.35rem; border-color: transparent; background: transparent; color: var(--accent); font-size: .85rem; text-decoration: none; }
button.crumb:hover, a.crumb:hover { border-color: transparent; color: var(--accent-hover); text-decoration: underline; text-underline-offset: .2em; }
@media (max-width: 640px) {
  .page-header { margin-bottom: 1.5rem; padding-bottom: 1.25rem; }
  .page-actions { width: 100%; justify-content: stretch; gap: .5rem; }
  .page-actions > * { flex: 1 1 auto; }
  .page-heading h1 { font-size: 1.9rem; }
}

/* ---------- Buttons: secondary by default, primary, danger, small, toggle ---------- */
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 44px; padding: .65rem 1rem; font: inherit; font-size: .9rem; font-weight: 600; line-height: 1.3; text-align: center; text-decoration: none; cursor: pointer; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--raised); color: var(--ink); }
button:hover, .button:hover { border-color: var(--accent); }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }
button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.danger { color: var(--danger); }
button.danger:hover { border-color: var(--danger); }
button.small, .button.small { min-height: 36px; padding: .4rem .8rem; font-size: .8rem; }
button[aria-pressed] { background: transparent; }
button[aria-pressed="true"] { background: var(--raised); border-color: var(--accent); color: var(--accent); }
button:disabled { opacity: .45; cursor: not-allowed; }
button:disabled:hover { border-color: var(--line); }
button[aria-busy="true"] { cursor: progress; opacity: .7; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: 1rem 0 0; }
.toolbar > .history-link, .toolbar > .avisarme { display: inline-flex; align-items: center; }
.toolbar > label { flex: 1 1 12rem; margin: 0; }
.toolbar > select { flex: 1 1 14rem; width: auto; margin: 0; }
.toolbar:empty { display: none; }

/* ---------- Fields: one per row; label, control, hint + counter row, error ---------- */
label, .field { display: block; margin: 0 0 var(--field-gap); font-size: .9rem; font-weight: 600; }
.field-label { display: block; }
input, select, textarea { display: block; width: 100%; min-width: 0; min-height: 44px; margin: .4rem 0 0; padding: .7rem .8rem; font: inherit; font-size: .95rem; font-weight: 400; line-height: 1.5; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--bg); color: var(--ink); scroll-margin-block: 8rem 2rem; }
input::placeholder, textarea::placeholder { color: #a8a49d; }
input:disabled, select:disabled, textarea:disabled { opacity: .6; cursor: not-allowed; }
/* Selects draw their own arrow, with room for it, instead of the browser's cramped one. */
select { appearance: none; padding-right: 2.75rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%23b5b0a7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; }
select:hover { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%23f1eee8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
input[type="date"], input[type="datetime-local"] { width: auto; min-width: min(100%, 16rem); }
textarea { min-height: 8rem; resize: vertical; }
textarea.prose { min-height: 20rem; }
[aria-invalid="true"] { border: 2px solid var(--danger); }
label:has(> input[type="checkbox"]), label:has(> input[type="radio"]) { display: flex; align-items: center; gap: .6rem; }
/* A checkbox's hint goes under its words, not beside them. */
label:has(> input[type="checkbox"]), label:has(> input[type="radio"]) { flex-wrap: wrap; }
:is(label:has(> input[type="checkbox"]), label:has(> input[type="radio"])) > .field-meta { flex-basis: 100%; margin-top: 0; padding-left: calc(18px + .6rem); }
input[type="checkbox"], input[type="radio"] { flex: 0 0 18px; width: 18px; min-height: 18px; height: 18px; margin: 0; order: -1; accent-color: var(--accent); }
td input[type="checkbox"], td input[type="radio"] { order: 0; }
.choice-field { margin: .5rem 0 0 1.85rem; }
.field-meta { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem 1rem; margin-top: .35rem; }
.field-meta .field-hint { flex: 1 1 14rem; }
.field-meta:empty { display: none; }
.field-hint, .field-error { display: block; margin: 0; font-weight: 400; }
.field-meta .field-counter { margin-left: auto; white-space: nowrap; }
@media (max-width: 640px) { .field-meta .field-counter { flex-basis: 100%; text-align: right; } }
.field-counter { color: var(--muted); font-size: .75rem; font-weight: 400; }
.field-counter.near-limit { color: #ffd083; }
.field-counter.over-limit { color: var(--danger); }
.field-error { margin-top: .35rem; color: var(--danger); font-size: .85rem; }
.optional-tag { margin-left: .5rem; padding: .05rem .4rem; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); font-size: .7rem; font-weight: 400; vertical-align: .1em; }
.fixed-identifier { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .75rem; margin: 0 0 var(--field-gap); }
.fixed-identifier .fixed-label { flex-basis: 100%; font-size: .9rem; font-weight: 600; }
.fixed-identifier code { padding: .3rem .5rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); font-size: .85rem; }
.fixed-identifier a { font-size: .85rem; }
.fixed-identifier .field-hint { flex-basis: 100%; }
.field-group { min-width: 0; }
/* A form in a card keeps a form's measure; an editor's tabs keep theirs (56rem, below). */
.card > :is(label, .field):not(:has(> input[type="checkbox"], > input[type="radio"])), .card > :is(.field-pair, fieldset, .choice-group), .card > .form-section > :is(label, .field, .field-pair) { max-width: var(--form-max); }
.group-title { margin: 0 0 .75rem; padding-top: .25rem; color: var(--muted); font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
/* Lists inside a form: each item is a card, its controls sit above the card. */
.list-item { margin: 0 0 var(--field-gap); }
.list-item-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin: 0 0 .5rem; }
.list-item-head h3, .list-item-head h4 { font-size: .9rem; }
.list-item-head .toolbar { margin: 0; }
.list-item-card { padding: 1.25rem 1.25rem 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.list-item-card > :last-child, .list-item-card .object-field > .field-group:last-child > label { margin-bottom: 1.25rem; }
.list-item-head h3 { font: 400 1.25rem/1.2 var(--serif); }
.array-items + button { margin-bottom: var(--field-gap); }
/* The rich editor: the site's palette over Toast UI's dark theme. Its
   Markdown source stays in the DOM (for counters and validation), unseen. */
.rich-source { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.rich-editor { margin-top: .4rem; border-radius: var(--radius-sm); overflow: hidden; }
.rich-editor .toastui-editor-defaultUI { border-color: var(--line-strong); border-radius: var(--radius-sm); font-family: var(--sans); }
.rich-editor .toastui-editor-defaultUI .toastui-editor-toolbar, .rich-editor .toastui-editor-defaultUI-toolbar { background: var(--raised); border-bottom-color: var(--line); }
.rich-editor .toastui-editor-defaultUI-toolbar { padding: 0 .5rem; }
.rich-editor .toastui-editor-toolbar-group { background: transparent; }
.rich-editor .toastui-editor-defaultUI-toolbar button { border-color: transparent; border-radius: var(--radius-sm); min-height: 0; }
/* `background-color`, never the shorthand: the shorthand wiped the sprite
   image of a native icon on hover and when active, so the icon faded into
   the button (#532). The theme's own hover rule outranks ours on the colour,
   so it is named with the theme class too; a custom button's glyph turns
   accent on hover, the way the rest of the admin's controls do. */
.rich-editor .toastui-editor-dark .toastui-editor-defaultUI-toolbar button:not(:disabled):hover { border-color: var(--line-strong); background-color: var(--bg); }
.rich-editor .toastui-editor-dark .toastui-editor-defaultUI-toolbar button.active { border-color: var(--accent); background-color: #fca31122; }
.rich-editor .toastui-editor-defaultUI-toolbar button.rich-heading:hover, .rich-editor .toastui-editor-defaultUI-toolbar button.rich-align:hover { color: var(--accent); }
.rich-editor .rich-heading { width: auto; min-width: 32px; padding: 0 .4rem; background-image: none; color: var(--ink); font: 600 .75rem/1 var(--sans); }
.rich-editor .toastui-editor-main, .rich-editor .toastui-editor-ww-container, .rich-editor .toastui-editor-defaultUI .ProseMirror { background: var(--bg); color: var(--ink); }
.rich-editor .toastui-editor-defaultUI .ProseMirror { padding: 1rem 1.1rem; font: 400 1rem/1.65 var(--sans); }
.rich-editor .toastui-editor-contents { font-family: var(--sans); font-size: 1rem; color: var(--ink); }
.rich-editor .toastui-editor-contents p { margin: 0 0 .85em; max-width: none; color: var(--ink); }
.rich-editor .toastui-editor-contents h1, .rich-editor .toastui-editor-contents h2, .rich-editor .toastui-editor-contents h3, .rich-editor .toastui-editor-contents h4 { margin: 1.2em 0 .5em; padding: 0; border: 0; font-family: var(--serif); font-weight: 400; letter-spacing: -.01em; color: var(--ink); }
.rich-editor .toastui-editor-contents h2 { font-size: 1.7rem; }
.rich-editor .toastui-editor-contents h3 { font-size: 1.35rem; }
.rich-editor .toastui-editor-contents a { color: var(--accent); }
.rich-editor .toastui-editor-contents blockquote { border-left: 2px solid var(--accent); color: var(--muted); }
.rich-editor .toastui-editor-contents ul > li::before { background-color: var(--muted); }
.rich-editor .toastui-editor-contents hr { border-top: 1px solid var(--line-strong); }
.rich-editor .toastui-editor-contents img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.rich-editor .toastui-editor-contents code, .rich-editor .toastui-editor-contents pre { background: var(--raised); color: var(--ink); }
.rich-editor .toastui-editor-defaultUI .toastui-editor-ww-mode .placeholder { color: #a8a49d; }
.rich-editor .toastui-editor-popup { background: var(--surface); border-color: var(--line-strong); color: var(--ink); font-family: var(--sans); }
.rich-editor .toastui-editor-popup input { min-height: 40px; }
.rich-editor .toastui-editor-popup-body label { color: var(--muted); }
.rich-editor .toastui-editor-popup button { min-height: 36px; }
.rich-editor .toastui-editor-popup-add-image .toastui-editor-tabs .tab-item { color: var(--muted); }
.rich-editor .toastui-editor-popup-add-image .toastui-editor-tabs .tab-item.active { color: var(--ink); border-bottom-color: var(--accent); }
.rich-editor .toastui-editor-defaultUI .toastui-editor-ok-button { background: var(--accent); color: var(--bg); }
.rich-editor .toastui-editor-defaultUI .toastui-editor-close-button { background: var(--raised); color: var(--ink); }
.rich-editor .toastui-editor-tooltip { font-family: var(--sans); }
.rich-editor .toastui-editor-defaultUI .ProseMirror:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.rich-editor [aria-invalid] ~ .rich-editor { outline: 2px solid var(--danger); }
.rich-field:has(.rich-source[aria-invalid="true"]) .rich-editor { outline: 2px solid var(--danger); outline-offset: 0; }

/* ---------- Cards: the dashboard's figures and the pages where the reader acts ---------- */
.card { position: relative; min-width: 0; margin: 0 0 var(--gap); padding: calc(var(--pad) + .25rem) var(--pad) var(--pad); border: 1px solid #2c2a26; border-radius: 14px; background: linear-gradient(180deg, #17161380, #12121200), var(--surface); box-shadow: inset 0 1px 0 #ffffff0c, 0 1px 2px #0008; }
.card-accent::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; border-radius: 14px 0 0 14px; background: linear-gradient(180deg, var(--accent), #fca31133); }
.card-head { margin: 0 0 1.25rem; }
.card-head + * { margin-top: 0; }
/* A card's action sits at the corner beside its title (#365). */
.card-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem 1rem; }
.card-title { min-width: 0; }
.card-title > h2 { margin: 0; font-size: 1.5rem; }
.card-action { flex-shrink: 0; align-self: center; font-size: .85rem; white-space: nowrap; }
.card-head-row:has(.card-eyebrow) .card-action { align-self: flex-end; margin-bottom: .2rem; }
.card-eyebrow { margin: 0 0 .35rem; color: var(--accent); font-size: .68rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
.card > h2, .card-head > h2 { margin: 0; font-size: 1.5rem; }
.card > h2 { margin-bottom: 1.25rem; }
.card > p { color: var(--muted); font-size: .9rem; }
.card > button, .card > .toolbar, .card > .field-hint { margin-bottom: 0; }
.card > :last-child { margin-bottom: 0; }
.card > .toolbar { margin-top: 1.25rem; }
.card-stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); }
.card-stack > .card, .card-stack > section, .ticket-grid > div > .card + .card { margin: 0; }
.card + .card { margin-top: 0; }
.panel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.panel-grid > .card { margin: 0; }
.panel-grid > .panel-wide { grid-column: 1 / -1; }
.disclosure { margin: 1rem 0 0; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.disclosure summary { cursor: pointer; font-weight: 600; }
.disclosure[open] summary { margin-bottom: 1rem; }
/* Facts inside a card: term on the left, value on the right. */
.facts { display: grid; gap: .45rem; margin: 0 0 1rem; }
.facts > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1rem; padding: .5rem 0; border-bottom: 1px solid #ffffff0a; font-size: .9rem; }
.facts > div:last-child { border-bottom: 0; }
.facts dt { margin: 0; color: var(--muted); }
.facts dd { margin: 0; font-variant-numeric: tabular-nums; }
@media (max-width: 1100px) { .panel-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .card { padding: 1.1rem 1rem 1rem; border-radius: 12px; } .card-head { margin-bottom: 1rem; } .card-title > h2, .card > h2, .card-head > h2 { font-size: 1.35rem; } }
/* Resumen and Analítica (#365) are one column: each card takes the row. */
main[data-view="summary"] > .card, main[data-view="analytics"] > .card { margin-bottom: var(--gap); }

/* ---------- Tabs ---------- */
.tabs { min-width: 0; }
/* The editor beside its live pane (#501): two columns when there is room, the pane first on a phone. */
.editor-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); align-items: start; }
@media (min-width: 1180px) { .editor-split { grid-template-columns: minmax(0, 1fr) minmax(360px, 640px); } .live-pane { position: sticky; top: calc(var(--shell-top) + 1rem); } }
.live-pane { display: flex; flex-direction: column; gap: .6rem; padding: 1rem; border: 1px solid #2c2a26; border-radius: 14px; background: var(--surface); min-width: 0; }
.live-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; }
.live-bar strong { font: 400 1.1rem/1.2 var(--serif); color: var(--ink); }
.live-frame { display: block; width: 100%; max-width: 640px; height: 70vh; min-height: 420px; border: 1px solid #2c2a26; border-radius: 10px; background: #0b0b0b; margin: 0 auto; }
.live-frame-narrow { max-width: 390px; }
.live-status, .live-note { margin: 0; font-size: .85rem; }
.field-hint-warning { color: #ffc98a; }
/* The editor and the wide reads use the viewport (#510): no 1100 px cap, the pane as the right half, the frame filling its column at the viewport's height. */
main[data-editor="newsletter"], main[data-wide] { max-width: none; }
/* Two halves that always fit: the pane never pushes the page sideways. */
@media (min-width: 1180px) { .editor-split { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.live-frame { max-width: none; height: calc(100dvh - 11rem); }
.editor-split.pane-only { grid-template-columns: minmax(0, 1fr); }
.editor-split.pane-only > .tabs { display: none; }
/* The sidebar as an icon rail (#510). */
.nav-hide-toggle { display: flex; width: 100%; align-items: center; justify-content: center; gap: .5rem; min-height: 34px; margin: 0 0 .4rem; padding: .3rem .6rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: transparent; color: var(--muted); font: inherit; font-size: .8rem; cursor: pointer; }
.nav-hide-toggle:hover { color: var(--ink); background: var(--raised); }
body.nav-hidden { grid-template-columns: minmax(0, 1fr); }
body.nav-hidden .sidebar { display: none; }
/* The way back: a small button pinned to the corner, with the pending count. */
.nav-show { position: fixed; top: .75rem; left: .75rem; z-index: 30; display: inline-flex; align-items: center; gap: .45rem; min-height: 36px; padding: .35rem .75rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; font-size: .8rem; cursor: pointer; box-shadow: 0 6px 20px #0006; }
.nav-show:hover { background: var(--raised); border-color: var(--accent); }
.nav-show-glyph { width: 16px; height: 16px; color: var(--muted); }
.nav-show .nav-badge:not([hidden]) { display: inline-block; }
body.nav-hidden main { margin-inline: auto; padding-top: 3.75rem; }
@media (max-width: 900px) { .nav-hide-toggle, .nav-show { display: none; } body.nav-hidden { grid-template-columns: none; } body.nav-hidden .sidebar { display: flex; } body.nav-hidden main { padding-top: 2.5rem; } }
/* A custom toolbar item sits in Toast UI's wrapper, which already carries the
   7px/5px margin every toolbar button has: the button inside must not add
   its own, or it sits 7px below the native icons (#530). */
.rich-editor .toastui-editor-toolbar-item-wrapper > button { margin: 0; vertical-align: top; }
/* Alignment blocks in the editor (#535): a fence paragraph takes no room and
   shows nothing; the blocks inside are drawn aligned. The alignment itself is
   the cue, as in a word processor. Decorations from alignViewPlugin; the text
   underneath is unchanged. */
.rich-editor .toastui-editor-contents p.align-fence { height: 0; margin: 0; padding: 0; border: 0; overflow: hidden; color: transparent; font-size: 1px; line-height: 0; user-select: none; caret-color: transparent; }
.rich-editor .toastui-editor-contents .align-in.align-center { text-align: center; }
.rich-editor .toastui-editor-contents .align-in.align-right { text-align: right; }
.rich-editor .toastui-editor-contents .align-in.align-justify { text-align: justify; }
.rich-editor .toastui-editor-contents .align-in.align-left { text-align: left; }
.rich-editor .rich-align { background-image: none; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; }
.rich-editor .rich-align svg { display: block; }
/* A bare URL alone in its paragraph (#506) reads as the card it will become, without loading anything. */
.rich-editor .toastui-editor-contents p > a:only-child[href*="youtube.com/"], .rich-editor .toastui-editor-contents p > a:only-child[href*="youtu.be/"], .rich-editor .toastui-editor-contents p > a:only-child[href*="x.com/"][href*="/status/"], .rich-editor .toastui-editor-contents p > a:only-child[href*="twitter.com/"][href*="/status/"], .rich-editor .toastui-editor-contents p > a:only-child[href*="lu.ma/"], .rich-editor .toastui-editor-contents p > a:only-child[href*="lafamilia.so/blog/"], .rich-editor .toastui-editor-contents p > a:only-child[href*="lafamilia.so/eventos/"], .rich-editor .toastui-editor-contents p > a:only-child[href*="lafamilia.so/recompensas/"] { display: block; padding: .6rem .8rem; border: 1px dashed var(--accent); border-radius: var(--radius-sm); color: var(--muted); font-size: .85rem; text-decoration: none; }
.rich-editor .toastui-editor-contents p > a:only-child[href*="youtube.com/"]::before, .rich-editor .toastui-editor-contents p > a:only-child[href*="youtu.be/"]::before { content: "▶ Vídeo de YouTube al publicar · "; color: var(--accent); }
.rich-editor .toastui-editor-contents p > a:only-child[href*="x.com/"][href*="/status/"]::before, .rich-editor .toastui-editor-contents p > a:only-child[href*="twitter.com/"][href*="/status/"]::before { content: "Publicación de X como tarjeta al publicar · "; color: var(--accent); }
.rich-editor .toastui-editor-contents p > a:only-child[href*="lu.ma/"]::before { content: "Evento de Luma como tarjeta al publicar · "; color: var(--accent); }
.rich-editor .toastui-editor-contents p > a:only-child[href*="lafamilia.so/blog/"]::before, .rich-editor .toastui-editor-contents p > a:only-child[href*="lafamilia.so/eventos/"]::before, .rich-editor .toastui-editor-contents p > a:only-child[href*="lafamilia.so/recompensas/"]::before { content: "Tarjeta de esta web al publicar · "; color: var(--accent); }
.tab-list { display: flex; gap: .25rem; margin: 0 0 var(--gap); padding: 0 0 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tab-list::-webkit-scrollbar { display: none; }
.tab-list [role="tab"] { flex: 0 0 auto; min-height: 44px; margin-bottom: -1px; padding: .6rem 1rem; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--muted); }
.tab-list [role="tab"]:hover { color: var(--ink); border-color: var(--line-strong); }
.tab-list [role="tab"][aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.tabs { position: relative; }
/* An inactive panel is out of sight and out of the tab order but keeps its
   width, so editors inside measure their toolbars correctly. */
.tab-panel-inactive { position: absolute; top: 0; left: 0; width: 100%; height: 0; overflow: hidden; visibility: hidden; pointer-events: none; }
.tab-panel > .form-panel:last-child { margin-bottom: 0; }
main[data-editor]:not([data-editor="newsletter"]) .tabs > .tab-panel { max-width: 56rem; }

/* ---------- Editors: sticky save bar, then the tabs ---------- */
.editor-actions { position: sticky; top: var(--shell-top); z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: 0 0 var(--gap); padding: .75rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 8px 20px #0006; }
.editor-actions .danger { margin-left: auto; }
.save-state { margin: 0 .5rem; color: var(--muted); font-size: .8rem; }
/* Without a save bar the status is a line of the header, under the title. */
.page-heading > .save-state { margin: .5rem 0 0; font-size: .85rem; }
.save-state[data-dirty="true"] { color: #ffbd4a; }
.save-state[data-dirty="true"]::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: .45rem; border-radius: 50%; background: currentColor; vertical-align: .08em; }
/* Phones: the sticky bar stays one compact row; the status shows only when there is something unsaved. */
@media (max-width: 640px) {
  .editor-actions { gap: .4rem; padding: .5rem; }
  .editor-actions button { min-height: 38px; padding: .4rem .7rem; font-size: .8rem; }
  .save-state { margin: 0 .25rem; font-size: .75rem; }
  .save-state:not([data-dirty="true"]) { display: none; }
}

/* ---------- Lists: filter bar, count, pagination, empty state ---------- */
.filter-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem 1rem; margin: 0; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.card .filter-bar { padding: 0; border: 0; background: none; }
.filter-bar > label, .filter-bar > .field { flex: 1 1 12rem; max-width: 20rem; margin: 0; }
.filter-bar > label:has(> input[type="search"], > input[type="text"], > input:not([type])) { flex: 2 1 16rem; max-width: 28rem; }
.filter-bar > select { flex: 1 1 12rem; max-width: 20rem; width: auto; margin: 0; }
.filter-bar > button, .filter-bar > .button { flex: none; }
.filter-bar > label:has(> input[type="checkbox"]) { align-self: center; min-height: var(--control); }
.filter-bar input[type="date"] { width: 100%; min-width: 0; }
.result-count { margin: 0 0 .5rem; color: var(--muted); font-size: .8rem; }
@media (max-width: 640px) {
  .filter-bar { display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem; padding: .9rem; }
  .filter-bar > * { max-width: none !important; min-width: 0; }
  .filter-bar > label:has(> input:not([type="checkbox"]):not([type="radio"])), .filter-bar > .ticket-search, .filter-bar > .segmented, .filter-bar > button, .filter-bar > .button, .filter-bar > .field { grid-column: 1 / -1; }
}
.empty-search { padding: 1.25rem; border: 1px dashed var(--line); border-radius: var(--radius); }
.empty-search > p { margin: 0; }
/* The count above the list already says how many; the table's own would repeat it. */
.link-list .table-count, .result-count + .table-block .table-count, .result-line + .table-block .table-count, .result-line + div > .table-block .table-count { display: none; }
.pagination { justify-content: flex-end; }
.empty-state { grid-column: 1 / -1; width: 100%; margin: 0; padding: 3rem 1.5rem; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 1rem; margin: 0 0 var(--gap); }
.card .stats { gap: .75rem; }
.card .stat { padding: 1rem 1.1rem; box-shadow: none; background: var(--bg); }
.stat { display: flex; flex-direction: column; gap: .5rem; padding: 1.25rem 1.4rem; border: 1px solid #2c2a26; border-radius: 14px; background: linear-gradient(180deg, #17161380, #12121200), var(--surface); box-shadow: inset 0 1px 0 #ffffff0c, 0 1px 2px #0008; color: var(--accent); font-size: .68rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
.stat strong { color: var(--ink); font: 400 2.4rem/1 var(--serif); letter-spacing: -.02em; font-variant-numeric: tabular-nums; text-transform: none; }
/* A tile that filters (#488): the same box, pressed when it is the filter. */
button.stat { cursor: pointer; text-align: left; font-family: inherit; transition: border-color .15s, background-color .15s; }
button.stat:hover { border-color: var(--accent); }
button.stat[aria-pressed="true"] { border-color: var(--accent); background: linear-gradient(180deg, #2a2316, #1a1712), var(--surface); box-shadow: inset 0 0 0 1px var(--accent); }
button.stat:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.stats-reasons .stat strong { font-size: 1.8rem; }
/* A lone tile keeps a tile's width instead of the row's. */
.stats:has(> :only-child) { grid-template-columns: minmax(0, 18rem); }
/* The figure the period before (Analítica, #330): plain, under the number. */
.stat small { font-weight: 400; letter-spacing: 0; text-transform: none; font-variant-numeric: tabular-nums; }
/* The change under the number (#365): the chip, then a small line. */
.stat-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; font-weight: 400; letter-spacing: 0; text-transform: none; }
.stat-foot small { font-size: .75rem; }
@media (max-width: 640px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .stat { justify-content: space-between; gap: .4rem; padding: .8rem .9rem; letter-spacing: .1em; }
  .stat strong { font-size: 1.6rem; }
  .card .stat { padding: .75rem .85rem; }
}

/* ---------- Figures (#365): deltas, bar lists, columns, funnels, stacks, meters, chips ---------- */
/* A delta carries its arrow and sign; the colour only repeats the direction. */
.delta { display: inline-block; padding: .1rem .45rem; border-radius: var(--radius-sm); background: var(--raised); color: var(--muted); font-size: .75rem; font-weight: 600; letter-spacing: 0; text-transform: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.delta[data-dir="good"] { color: #b8dac3; background: #17231c; }
.delta[data-dir="bad"] { color: #ffc0b8; background: #301c1a; }
.bars { display: grid; gap: .45rem; margin: 0 0 1rem; }
.bars > p { margin: 0; }
.bar-row { display: grid; grid-template-columns: minmax(7rem, 15rem) minmax(0, 1fr) auto auto; align-items: center; gap: .35rem .75rem; font-size: .9rem; }
.bar-row:has(.bar-note) { grid-template-columns: minmax(7rem, 15rem) minmax(0, 1fr) auto auto auto; }
.bar-label, .bar-label-wrap { min-width: 0; }
.bar-label { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.bar-label { color: var(--ink); text-decoration: none; }
a.bar-label:hover { color: var(--accent); text-decoration: underline; text-underline-offset: .2em; }
.bar-label-wrap small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .75rem; }
.bar-track { position: relative; display: block; height: 12px; border-radius: 0 4px 4px 0; overflow: hidden; }
.bar-fill, .bar-ghost { position: absolute; inset: 0 auto 0 0; display: block; min-width: 2px; border-radius: 0 4px 4px 0; }
.bar-fill { background: var(--accent); }
.bar-ghost { height: 4px; top: auto; bottom: 0; background: var(--line-strong); }
.bar-track:has(.bar-ghost) .bar-fill { bottom: 6px; }
.bar-value { min-width: 3ch; text-align: right; font-variant-numeric: tabular-nums; }
.bar-note { font-size: .8rem; white-space: nowrap; }
/* Columns per day: the plot, its hairlines with the tick figures, the labels under. */
.columns-figure { margin: 0 0 1rem; }
.columns { position: relative; height: 180px; margin: 0 0 1.6rem; padding-right: 2.5rem; }
.columns-grid { position: absolute; inset: 0; pointer-events: none; }
.columns-grid span { position: absolute; left: 0; right: 0; display: flex; align-items: center; justify-content: flex-end; height: 0; border-top: 1px solid #ffffff12; color: var(--muted); font-size: .68rem; line-height: 0; font-variant-numeric: tabular-nums; }
.columns-cols { position: absolute; inset: 0 2.5rem 0 0; display: flex; align-items: flex-end; gap: 2px; border-bottom: 1px solid var(--line); }
.col-slot { position: relative; flex: 1 1 0; min-width: 0; height: 100%; }
.col-slot:hover .col-fill, .col-slot:focus-visible .col-fill { background: var(--accent-hover); }
.col-fill, .col-ghost { position: absolute; bottom: 0; display: block; border-radius: 4px 4px 0 0; }
.col-fill { left: 15%; right: 15%; max-width: 24px; margin: 0 auto; background: var(--accent); }
.col-ghost { left: 15%; right: 15%; max-width: 24px; margin: 0 auto; background: var(--line-strong); opacity: .6; }
.col-label { position: absolute; top: calc(100% + .4rem); left: 50%; transform: translateX(-50%); color: var(--muted); font-size: .68rem; white-space: nowrap; }
.col-slot:last-child .col-label { left: auto; right: 0; transform: none; }
.col-slot:first-child .col-label { left: 0; transform: none; }
.figure-table { margin: 0; }
.figure-table > summary { cursor: pointer; color: var(--muted); font-size: .85rem; }
.figure-table[open] > summary { margin-bottom: .75rem; }
/* A funnel: the steps as descending bars, the conversion on the gap. */
.funnel { display: grid; gap: .3rem; margin: 0 0 1.25rem; }
.funnel-row { display: grid; grid-template-columns: minmax(6rem, 9rem) minmax(0, 1fr) auto auto; align-items: center; gap: .75rem; font-size: .9rem; }
.funnel-row .bar-track { height: 18px; }
.funnel-conv { display: grid; grid-template-columns: minmax(6rem, 9rem) minmax(0, 1fr); gap: .75rem; }
.funnel-conv span { grid-column: 2; padding: 0 0 0 .25rem; color: var(--muted); font-size: .75rem; }
/* A bar of parts with the status colours and a 2px surface gap between them. */
.stacked { margin: 0 0 .75rem; }
.stacked-bar { display: flex; gap: 2px; height: 14px; border-radius: 4px; overflow: hidden; background: var(--raised); }
.stacked-seg { display: block; min-width: 3px; }
.stacked-seg[data-state="accepted"], .stacked-item[data-state="accepted"] i { background: #6fb98a; }
.stacked-seg[data-state="failed"], .stacked-item[data-state="failed"] i { background: #e07a70; }
.stacked-seg[data-state="unknown"], .stacked-item[data-state="unknown"] i { background: #d9b45a; }
.stacked-seg[data-state="cancelled"], .stacked-item[data-state="cancelled"] i { background: var(--line-strong); }
.stacked-key { display: flex; flex-wrap: wrap; gap: .35rem 1rem; margin-top: .5rem; font-size: .8rem; }
.stacked-item { display: inline-flex; align-items: center; gap: .4rem; }
.stacked-item i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
/* A meter: the fill turns warm past four fifths of the limit. */
.meter { margin: .75rem 0 1rem; }
.meter-track { height: 10px; border-radius: 4px; overflow: hidden; background: var(--raised); }
.meter-fill { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.meter-fill[data-level="warning"] { background: #ffd083; }
.meter-fill[data-level="critical"] { background: var(--danger); }
.meter > p { margin: .5rem 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1rem; }
.chip { display: inline-flex; align-items: center; gap: .5rem; padding: .3rem .65rem; border: 1px solid var(--line); border-radius: 999px; background: var(--raised); color: var(--ink); font-size: .8rem; text-decoration: none; }
a.chip:hover { border-color: var(--accent); }
.chip strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.segmented { display: inline-flex; flex-wrap: wrap; max-width: 100%; }
.segmented button { flex: 0 0 auto; min-height: 44px; border-radius: 0; margin-left: -1px; white-space: nowrap; }
main > .segmented { display: flex; gap: 0 .25rem; width: 100%; box-shadow: inset 0 -1px var(--line); }
main > .segmented button, main > .segmented button:first-child, main > .segmented button:last-child { margin: 0; padding: .6rem 1rem; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--muted); }
main > .segmented button:hover { color: var(--ink); border-color: var(--line-strong); }
main > .segmented button[aria-pressed="true"] { color: var(--accent); border-bottom-color: var(--accent); background: transparent; }
.segmented button:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); margin-left: 0; }
.segmented button:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
/* Resumen's sections (#365). */
.last-campaign { margin: 0 0 .75rem; font-size: .95rem; }
.last-campaign a { font-weight: 600; }
.event-block { padding: 1rem 0 .25rem; border-top: 1px solid var(--line); }
.event-block:first-of-type { border-top: 0; }
.event-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: .5rem 1rem; margin: 0 0 .75rem; }
.event-title { min-width: 0; }
.event-title .section-title { margin: 0 0 .15rem; }
.event-head .stat { padding: .5rem .9rem; }
.event-head .stat strong { font-size: 1.6rem; }
.importer { margin: 0 0 1.25rem; }
.card .section-title { margin: 1.25rem 0 .6rem; }
.card .section-title:first-child, .card-head + .section-title { margin-top: 0; }
.facts dd { text-align: right; overflow-wrap: anywhere; }
.facts-stack > div { flex-direction: column; align-items: flex-start; gap: .15rem; }
.facts-stack dd { text-align: left; }
@media (max-width: 640px) {
  /* On a phone the name, the count and the change share a line; the bar sits under them. */
  .bar-row, .bar-row:has(.bar-note) { grid-template-columns: minmax(0, 1fr) auto auto; gap: .25rem .6rem; }
  .bar-row .bar-track { order: 1; grid-column: 1 / -1; height: 8px; }
  .bar-row .bar-note { order: 2; grid-column: 1 / -1; }
  .bars { gap: .6rem; }
  .funnel-row { grid-template-columns: minmax(0, 1fr) auto auto; gap: .25rem .6rem; }
  .funnel-row .bar-track { order: 1; grid-column: 1 / -1; height: 12px; }
  .funnel-conv { grid-template-columns: minmax(0, 1fr); }
  .funnel-conv span { grid-column: 1; }
  .columns { height: 140px; padding-right: 2rem; }
  .columns-cols { right: 2rem; gap: 1px; }
  .col-fill, .col-ghost { left: 10%; right: 10%; }
  .col-label { font-size: .6rem; }
  .facts > div { flex-direction: column; align-items: flex-start; }
  .facts dd { text-align: left; }
}

/* ---------- Tables (become labelled cards on phones) ---------- */
/* A table is a box of fixed height (#365): a long list scrolls inside it, the
   header stays, and the page never grows with the rows. */
/* #857: no overscroll-behavior here: a table with nothing to scroll lets the wheel through, and one that reaches its end hands it to the page. */
.table { max-height: 32rem; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); }
/* A table that is part of the page (#1107 §6, Infraestructura): every row shows, no box of its own. */
.table.table-full { max-height: none; }
.table thead th { position: sticky; top: 0; z-index: 1; }
.table-block { margin: 0 0 1rem; }
.table-block > .table { margin: 0; }
.table-count { margin: .5rem 0 0; color: var(--muted); font-size: .8rem; text-align: right; }
table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: .9rem; }
th, td { padding: .8rem 1rem; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
th { background: var(--raised); color: var(--muted); font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; overflow-wrap: normal; }
td { overflow-wrap: break-word; }
td > a:only-child, td > code:only-child { word-break: normal; }
/* The actions column, and only it, sits at the right; its buttons stay one compact row. */
table:has(> tbody > tr > td:last-child > :is(.row-menu, .toolbar > :is(button, .button))) th:last-child, td:last-child:has(> .toolbar > :is(button, .button), > .row-menu) { text-align: right; }
td:last-child:has(> .toolbar > :is(button, .button)) > .toolbar { justify-content: flex-end; gap: .4rem; }
/* The first column names the row: it never shrinks to a word per line. */
td:first-child:not(:has(input)) { min-width: 9rem; }
td button, td .button { min-height: 34px; padding: .35rem .7rem; font-size: .8rem; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td[colspan] { padding: 2rem 1rem; text-align: center; color: var(--muted); }
td .toolbar { justify-content: flex-end; margin: 0; }
td:has(> .badge) { white-space: nowrap; }
@media (max-width: 640px) {
  .table { max-height: 60vh; border: 0; border-radius: 0; }
  .table.table-full { max-height: none; }
  .table table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table table { background: none; }
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .table tr { margin-bottom: .75rem; padding: .25rem 1rem .5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
  /* Each cell is a label column and a value column; whatever the cell holds stacks in the value column. */
  .table td { display: grid; grid-template-columns: minmax(5.5rem, 34%) minmax(0, 1fr); grid-auto-flow: row; column-gap: 1rem; row-gap: 0; align-items: baseline; justify-items: start; min-width: 0; padding: .45rem 0; border: 0; border-top: 1px solid #ffffff0a; text-align: left; }
  .table td:first-child { border-top: 0; }
  .table td, .table td code { overflow-wrap: anywhere; white-space: normal; }
  .table td > * { grid-column: 2; }
  .table td > * + * { margin-top: .2rem; }
  .table td::before { content: attr(data-label); grid-column: 1; grid-row: 1 / span 12; color: var(--muted); font-size: .68rem; font-weight: 600; letter-spacing: .06em; line-height: 1.9; text-transform: uppercase; }
  .table td:empty, .table td:has(> .toolbar:empty) { display: none; }
  .table td[colspan]::before { display: none; }
  .table td[colspan] { display: block; padding: 1.25rem 0; text-align: center; }
  .table tr:has(> td[colspan]) { padding: 0 1rem; }
  /* The actions: under the record, the whole width, left to right. */
  .table td:last-child:has(> .toolbar > :is(button, .button), > .row-menu) { display: block; padding-top: .75rem; }
  .table td:last-child:has(> .toolbar > :is(button, .button), > .row-menu)::before { display: none; }
  .table td:last-child:has(> .toolbar > :is(button, .button)) > .toolbar { flex-wrap: wrap; justify-content: flex-start; }
  .table td:last-child:has(> .toolbar > :is(button, .button)) > .toolbar > :is(button, .button) { flex: 1 1 auto; }
  /* Inside a card a record is a row between rules, not a box in a box. */
  .card .table tr { margin: 0; padding: .5rem 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; }
  .card .table tr:first-child { border-top: 0; }
  .card .table { margin: 0 -.1rem; }
}

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: .2rem .55rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--raised); font-size: .75rem; white-space: nowrap; color: var(--ink); }
.badge[data-status="active"], .badge[data-status="published"], .badge[data-status="sent"], .badge[data-status="accepted"], .badge[data-status="new"] { color: #b8dac3; background: #17231c; border-color: #35513f; }
.badge[data-status="draft"], .badge[data-status="scheduled"], .badge[data-status="sending"], .badge[data-status="pending"], .badge[data-status="changed"] { color: #ffd083; background: #302415; border-color: #69502b; }
.badge[data-status="failed"], .badge[data-status="attention"], .badge[data-status="suppressed"], .badge[data-status="unknown"], .badge[data-status="deleted"] { color: #ffc0b8; background: #301c1a; border-color: #67413c; }
.card-badges { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.card-badges:empty { display: none; }

/* ---------- Content cards ---------- */
.content-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: var(--gap); }
.content-card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.content-card-info { display: flex; flex: 1; flex-direction: column; padding: .9rem 1.1rem 1rem; }
.content-card h2 { margin: 0; font: 600 1rem/1.4 var(--sans); letter-spacing: 0; }
.content-card-copy p { margin: .4rem 0 0; font-size: .8rem; overflow-wrap: anywhere; }
.content-card-actions { justify-content: space-between; margin: auto 0 0; padding-top: .75rem; }
.content-card-actions > button:last-child { margin-left: auto; }
.content-grid + .field-hint { margin-top: 1rem; }
.content-image { position: relative; aspect-ratio: 1200 / 630; overflow: hidden; background: var(--raised); }
.content-image img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.image-placeholder { display: grid; place-items: center; height: 100%; padding: 1rem; color: var(--muted); font-size: .8rem; text-align: center; }
@media (max-width: 640px) {
  .content-grid { gap: .6rem; }
  .content-card { display: grid; grid-template-columns: 88px minmax(0, 1fr); }
  .content-card > .content-image { aspect-ratio: auto; width: 88px; height: 100%; min-height: 88px; }
  .content-card-info { padding: .7rem .85rem; }
  .content-card h2 { font-size: .92rem; }
  .content-card .image-placeholder { padding: .25rem; font-size: .7rem; }
  .content-card-actions { padding-top: .5rem; }
}

/* ---------- Images: upload field and share preview ---------- */
.image-upload { display: grid; gap: .75rem; margin: .75rem 0 var(--field-gap); }
.upload-preview { position: relative; display: grid; place-items: center; width: 100%; max-width: 560px; aspect-ratio: 16 / 10; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); }
.upload-preview img { width: 100%; height: 100%; object-fit: contain; }
.image-dimensions { position: absolute; right: .5rem; bottom: .5rem; padding: .2rem .4rem; border-radius: 3px; background: #0b0b0bde; font-size: .7rem; }
.image-dimensions:empty, .image-upload p:empty { display: none; }
.image-upload > button { width: 100%; max-width: 560px; }
.image-upload p { margin: 0; }
.share-preview { max-width: 560px; }
.share-preview .toolbar { margin-top: .75rem; }
.share-preview .content-image { border: 1px solid var(--line); border-radius: var(--radius-sm); }
.share-preview .toolbar { justify-content: space-between; gap: .5rem 1rem; font-size: .85rem; }

/* ---------- Pickers (Inicio, links) and the announcement preview ---------- */
.picker > p { color: var(--muted); font-size: .85rem; }
.picker .picked-item:last-child { border-bottom: 1px solid var(--line); }
.picked-item { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; align-items: center; gap: .75rem 1rem; padding: .75rem 0; border-top: 1px solid var(--line); }
.picked-item:has(> .picked-copy:first-child) { grid-template-columns: minmax(0, 1fr) auto; }
.picked-item .content-image { border-radius: var(--radius-sm); }
.picked-copy { display: grid; gap: .15rem; min-width: 0; }
.picked-copy small { overflow-wrap: anywhere; }
.picked-title { min-width: 0; font-size: .85rem; font-weight: 600; overflow-wrap: anywhere; }
.picked-item .toolbar { margin: 0; flex-wrap: nowrap; }
.picker-full { margin: 1rem 0 0; padding: .9rem 1rem; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); font-size: .85rem; }
.picker > .toolbar { padding-top: 1rem; border-top: 1px solid var(--line); }
.announcement-preview { margin: 0 0 1rem; padding: 1rem; border-left: 2px solid var(--accent); border-radius: var(--radius-sm); background: var(--bg); overflow-wrap: anywhere; }
.announcement-preview p { margin: .5rem 0; }
@media (max-width: 640px) { .picked-item, .picked-item:has(> .picked-copy:first-child) { grid-template-columns: 72px minmax(0, 1fr); } .picked-item .toolbar { grid-column: 1 / -1; } }

/* ---------- Audiences ---------- */
.audience { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: .25rem .75rem; margin: .5rem 0 1rem; }
.audience label { margin: 0; }
/* A rule between two groups inside one card (the send screen, #324). */
.card > hr { margin: 1rem 0; border: 0; border-top: 1px solid var(--line); }
/* A field and its actions on one row where the width allows (Programar o enviar). */
.send-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.send-row > label { flex: 1 1 18rem; margin: 0; }
.send-row > .toolbar { margin: 0; }
td .card-badges { justify-content: flex-start; }

/* ---------- Newsletter composer ---------- */
.newsletter-banner { display: block; width: 100%; max-width: 600px; height: auto; aspect-ratio: 3 / 1; margin-top: .75rem; object-fit: cover; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.newsletter-banner[hidden] { display: none; }
/* The header and the band of a campaign (#386, #387): the choices as thumbnails, one picked. */
.mail-header { display: block; width: 100%; max-width: 600px; height: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.band-chooser { margin: var(--gap) 0 0; padding: 0; border: 0; min-width: 0; }
.band-chooser legend { padding: 0; margin: 0 0 .25rem; font-family: var(--serif); font-size: 1.5rem; font-weight: 400; }
.band-group { margin: 0 0 1.25rem; }
.band-group .section-title:empty { display: none; }
.band-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: .75rem; }
.band-chooser label.band-choice { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: .4rem .5rem; margin: 0; padding: .5rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); font-weight: 400; cursor: pointer; }
.band-choice:has(input:checked) { border-color: var(--accent); background: var(--raised); }
.band-choice:has(input:disabled) { cursor: not-allowed; opacity: .6; }
.band-choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.band-choice input { order: 0; }
.band-thumb { grid-column: 1 / -1; grid-row: 1; display: block; aspect-ratio: 3 / 1; overflow: hidden; border-radius: 2px; background: var(--surface); }
.band-thumb:empty { display: none; }
.band-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.band-choice small { grid-column: 1 / -1; }
.band-own { margin: 0 0 1.25rem; padding: 1rem; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.band-own[hidden] { display: none; }
.band-own .toolbar { margin: 0 0 .75rem; }

/* ---------- Publicación ---------- */
.pending-list { margin: 0; }
.pending-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .75rem 1rem; padding: .85rem 0; border-top: 1px solid #ffffff0a; }
.pending-item:first-child { border-top: 0; }
.pending-list > .empty-state { padding: 2rem 1.5rem; }
.pending-copy { display: grid; gap: .1rem; min-width: 0; }
.pending-copy strong { overflow-wrap: anywhere; }
.pending-item .toolbar { margin: 0; flex-wrap: nowrap; }
@media (max-width: 640px) { .pending-item { grid-template-columns: auto minmax(0, 1fr); } .pending-item .toolbar { grid-column: 1 / -1; } }

/* ---------- Feedback: notice, loading, dialog ---------- */
/* Above the rich editor: Toast UI's editing surface is z-index 20 and its
   popups and tooltips 30 and 40, so a notice at 10 sat under the text and
   its close button could not be clicked when the editor filled the page. */
/* #567: a column of notices — the live ones (the pulse's) above, the
   person's own answer at the bottom; each one a box of its own. */
#notice { position: fixed; bottom: 1rem; left: 50%; z-index: 50; display: flex; flex-direction: column; gap: .5rem; width: min(800px, calc(100% - 2rem)); margin: 0; transform: translateX(-50%); pointer-events: none; }
#notice:empty { display: none; }
.notice-item { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem; border: 1px solid var(--accent); border-radius: var(--radius); background: #252017; box-shadow: 0 12px 40px #0008; pointer-events: auto; }
.notice-item[data-live] { padding: .7rem 1rem; border-color: var(--line-strong); background: var(--raised); }
.notice-item span { overflow-wrap: anywhere; }
.notice-item button { flex-shrink: 0; }
.notice-item.error { border-color: var(--danger); background: #301917; }
.notice-link { font-weight: 600; white-space: nowrap; }
/* #861: the tasks tray. What the person asked for, while it runs and once it
   is done, at the top right: under the tab bar, and under an editor's bar
   while it is stuck (app.js sets --tray-top then). Above the notices. */
#tasks { position: fixed; top: var(--tray-top, calc(var(--shell-top) + 1rem + env(safe-area-inset-top, 0px))); right: calc(1rem + env(safe-area-inset-right, 0px)); z-index: 51; display: flex; flex-direction: column; gap: .5rem; width: min(380px, calc(100% - 2rem)); pointer-events: none; }
#tasks:empty { display: none; }
.task { display: grid; grid-template-columns: 1.1rem minmax(0, 1fr) auto; column-gap: .65rem; row-gap: .15rem; align-items: baseline; padding: .75rem .9rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--raised); box-shadow: 0 12px 40px #0008; font-size: .875rem; pointer-events: auto; animation: task-in .2s ease-out; transition: opacity .25s, transform .25s; }
.task > :not(.task-icon, .task-title, .task-time) { grid-column: 2 / -1; }
.task-icon { grid-row: 1 / span 2; align-self: start; display: flex; justify-content: center; padding-top: .2rem; color: var(--accent); font-weight: 700; line-height: 1; }
.task-icon .icon { width: 1rem; height: 1rem; }
.task-title { min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.task-time { color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.task p { margin: 0; max-width: none; }
.task-line { color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.task-line:empty, .task-warn:empty { display: none; }
.task-warn { display: flex; gap: .4rem; align-items: baseline; color: var(--accent); font-size: .8rem; }
.task-warn::before { content: ""; flex-shrink: 0; width: 6px; height: 6px; border-radius: 50%; background: currentColor; transform: translateY(-1px); }
.task-bar { height: 2px; margin-top: .3rem; overflow: hidden; border-radius: 2px; background: var(--line); }
.task-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .5s linear; }
.task-actions { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: flex-end; margin-top: .35rem; }
.task-actions .notice-link { margin-right: auto; }
.task[data-state="done"] { border-color: #35513f; background: #17231c; }
.task[data-state="done"] .task-icon { color: #b8dac3; }
.task[data-state="failed"] { border-color: var(--danger); background: #301917; }
.task[data-state="failed"] .task-icon { color: var(--danger); }
.task-leaving { opacity: 0; transform: translateX(12px); }
.task-nudge { animation: task-nudge .45s ease-in-out; }
/* The spinner: the task's, and a running action's button. */
.spinner { display: inline-block; flex-shrink: 0; width: .85em; height: .85em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -.1em; }
button > .spinner { margin-right: .45em; }
@keyframes task-in { from { opacity: 0; transform: translateX(12px); } }
@keyframes task-nudge { 30% { transform: translateX(-6px); } 60% { transform: translateX(4px); } }
@media (max-width: 640px) { #tasks { left: calc(1rem + env(safe-area-inset-left, 0px)); width: auto; } }
@media (prefers-reduced-motion: reduce) { .task, .task-bar i { animation: none; transition: none; } .task-nudge { animation: none; outline: 2px solid var(--accent); } .spinner { animation: none; border-right-color: currentColor; opacity: .6; } }
.loading-state { position: fixed; top: 0; left: 0; z-index: 50; width: 100%; height: 3px; overflow: hidden; background: #fca31133; }
.loading-state::after { content: ''; position: absolute; inset: 0 auto 0 0; width: 40%; background: var(--accent); animation: loading-sweep 1.1s ease-in-out infinite; }
@keyframes loading-sweep { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
/* The skeleton (#311): the header is real, these blocks stand in for the body. */
.skeleton { display: grid; gap: .9rem; max-width: 720px; margin: .5rem 0 0; }
.skeleton span { display: block; height: 1rem; border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--raised) 25%, #242220 50%, var(--raised) 75%); background-size: 200% 100%; animation: skeleton-sheen 1.4s linear infinite; }
.skeleton span:nth-child(1) { width: 55%; height: 2rem; }
.skeleton span:nth-child(2) { width: 100%; }
.skeleton span:nth-child(3) { width: 88%; }
.skeleton span:nth-child(4) { width: 40%; margin-top: 1rem; }
.skeleton span:nth-child(5) { width: 100%; height: 6rem; }
.skeleton span:nth-child(6) { width: 70%; }
@keyframes skeleton-sheen { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton span, .loading-state::after { animation: none; } }
.load-error { max-width: 60ch; margin: .5rem 0 0; padding: 1.25rem 1.5rem; border: 1px solid var(--danger); border-radius: var(--radius); background: #301917; }
.load-error p { margin: 0 0 1rem; }
.load-error .toolbar { margin: 0; }
.review-dialog { max-width: min(560px, calc(100% - 2rem)); padding: 2rem; border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: 0 30px 90px #000a; }
.review-dialog::backdrop { background: #000b; }
.review-dialog p { overflow-wrap: anywhere; }
.review-dialog .toolbar { justify-content: flex-end; }
.review-dialog:has(.danger-action) { border-top-color: var(--danger); }
button.danger-action { background: #5a211c; border-color: var(--danger); color: #fff; }
button.danger-action:hover { background: #74291f; }
@media (max-width: 640px) { .notice-item { align-items: flex-start; font-size: .85rem; } .review-dialog { padding: 1.25rem; } }

/* ---------- The preview window ---------- */
body.preview-window { display: flex; flex-direction: column; align-items: stretch; height: 100dvh; }
.preview-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding: .6rem 1rem; border-bottom: 1px solid var(--line); background: var(--surface); }
.preview-bar-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem 1rem; min-width: 0; }
.preview-bar-title strong { font-size: .95rem; }
#preview-status { color: var(--muted); font-size: .8rem; }
#preview-status[data-state="error"] { color: var(--danger); }
#preview-status[data-state="stale"] { color: #ffd083; }
.preview-bar-actions { display: flex; gap: .5rem; }
.preview-bar-actions button { min-height: 36px; padding: .4rem .8rem; font-size: .8rem; }
.preview-stage { flex: 1; min-height: 0; padding: 1rem; overflow: auto; background: var(--bg); }
#preview-frame { display: block; width: 100%; max-width: 100%; height: 100%; min-height: 500px; margin-inline: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: white; }
/* The approval page: one column, one button (R6). */
body.approval-page { display: block; }
.approval { max-width: 640px; margin: 0 auto; padding: 4rem clamp(1rem, 4vw, 3rem); }
.approval h1 { margin: 0 0 1rem; }
.approval .toolbar { margin: 1.5rem 0; }
#approval-status[data-state="error"] { color: var(--danger, #ff6b6b); }
#approval-status[data-state="fresh"] { color: var(--accent); }
/* Enlaces cortos (#210) */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.field-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
@media (max-width: 640px) { .field-pair { grid-template-columns: minmax(0, 1fr); } }
.link-cell { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; }
.link-cell small { flex-basis: 100%; }
.link-cell code { white-space: nowrap; }
.table td:last-child .toolbar:has(a.button) { margin: 0; gap: .4rem; min-width: 12rem; }
.table td:last-child .toolbar:has(a.button) > * { white-space: nowrap; }
.link-preview { display: grid; gap: .35rem; }
.link-preview code, .link-cell code { padding: .3rem .5rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); font-size: .85rem; }
.link-preview .field-label { margin-top: .5rem; color: var(--muted); font-size: .85rem; }
.link-preview code { overflow-wrap: anywhere; }
/* A field whose label carries a help control (#389): the «?» beside the
   label, its note across the field's own width so it never leaves a phone's
   screen, above the controls under it. */
.field-head { position: relative; display: flex; align-items: center; gap: .5rem; }
.field-head label { display: inline; margin: 0; }
/* One «?» everywhere (#721): 22 px, centred on the text beside it, with a 36 px hit area around it for a finger. */
.help { display: inline-flex; align-items: center; vertical-align: middle; }
.help-toggle { position: relative; flex: none; width: 22px; height: 22px; min-height: 22px; padding: 0; border-radius: 50%; font-size: .72rem; line-height: 1; color: var(--muted); }
.help-toggle::before { content: ""; position: absolute; inset: -7px; }
.help-toggle[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.help-note { position: fixed; z-index: 60; top: 0; left: 0; max-height: min(24rem, 60vh); text-align: left; white-space: normal; font-family: var(--sans); letter-spacing: 0; text-transform: none; line-height: 1.5; color: var(--ink); overflow: auto; padding: .85rem 1rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--raised); box-shadow: 0 12px 32px #000a; font-size: .85rem; font-weight: 400; }
.help-note p { margin: 0 0 .6rem; }
.help-note > :last-child { margin-bottom: 0; }
.help-options { display: grid; gap: .45rem; margin: 0; }
.help-options dt { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; color: var(--accent); }
.help-options dd { margin: 0; color: var(--muted); }
.status-legend { margin: 0 0 var(--gap); }
.status-legend .facts dt { display: flex; align-items: center; }
.import-preview:empty { display: none; }
.session-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; white-space: nowrap; }
.option-use { margin-top: .35rem; }
.option-use:empty, .pair-note:empty { display: none; }
.pair-note { margin: calc(var(--field-gap) * -.5) 0 var(--field-gap); }

/* ---------- Sign-in (#312), the account page (#310), users and the audit log ---------- */
.sign-in { max-width: 420px; }
.sign-in .toolbar { align-items: center; gap: .75rem 1.25rem; }
.sign-in .toolbar a { font-size: .85rem; }
.sign-in-screen { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); min-height: 100dvh; }
.sign-in-visual { position: relative; overflow: hidden; background: #0e0d0b; }
.sign-in-frame { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.sign-in-visual::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, #0b0b0b33, #0b0b0bcc 70%, #0b0b0b); }
.sign-in-visual-copy { position: absolute; inset: auto 0 0 0; z-index: 1; padding: clamp(1.5rem, 4vw, 3.5rem); }
.sign-in-visual-copy img { width: 200px; max-width: 60%; height: auto; margin-bottom: 1.25rem; }
.sign-in-visual-copy .card-eyebrow { margin-bottom: .5rem; }
.sign-in-claim { max-width: 22ch; margin: 0; font-family: var(--serif); font-size: clamp(1.8rem, 3.2vw, 2.6rem); line-height: 1.08; letter-spacing: -.02em; }
.sign-in-panel { display: flex; flex-direction: column; justify-content: center; width: min(100%, 520px); margin: 0 auto; padding: clamp(2rem, 6vw, 5rem) clamp(1.25rem, 5vw, 4rem); }
.sign-in-panel h1 { margin: 0 0 .5rem; font-size: 2.4rem; }
.sign-in-panel > p { color: var(--muted); }
.sign-in-panel .sign-in { max-width: none; margin-top: 1rem; }
@media (max-width: 900px) {
  .sign-in-screen { grid-template-columns: minmax(0, 1fr); min-height: auto; }
  .sign-in-visual { min-height: 220px; }
  .sign-in-visual-copy { padding: 1.25rem 1rem; }
  .sign-in-visual-copy img { width: 150px; margin-bottom: .75rem; }
  .sign-in-claim { font-size: 1.5rem; }
  .sign-in-panel { padding: 1.75rem 1rem 3rem; }
  .sign-in-panel h1 { font-size: 2rem; }
}
.editor-note { margin: 1rem 0 0; padding: .85rem 1rem; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); font-size: .9rem; }
.denied { max-width: 60ch; margin: 2rem 0; padding: 1.5rem; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
.badge[data-status="invited"] { color: #ffd083; background: #302415; border-color: #69502b; }
.badge[data-status="disabled"] { color: #ffc0b8; background: #301c1a; border-color: #67413c; }
.badge[data-status="role-admin"] { color: #f1d9a8; background: #2e2411; border-color: #7a5c22; }
.badge[data-status="role-editor"] { color: #c9d6ea; background: #1a2130; border-color: #3a4a68; }
.badge[data-status="requested"], .badge[data-status="archived"], .badge[data-status="builtin"] { color: var(--muted); }
.badge[data-status="succeeded"], .badge[data-status="ok"] { color: #b8dac3; background: #17231c; border-color: #35513f; }
.role-choices { display: grid; gap: .25rem; margin: 0 0 var(--field-gap); }
.role-choices label { margin: 0; }
/* Grupos (#486): a group's permissions, one card per area; what an account's groups open. */
.permission-list { display: grid; gap: .9rem; }
.permission { display: grid; gap: .3rem; padding-bottom: .9rem; border-bottom: 1px solid var(--line); }
.permission:last-child { padding-bottom: 0; border-bottom: 0; }
.permission label { margin: 0; }
/* #830: the permission's key, quiet and selectable in one click; it wraps under the label at 412. */
.permission-key { width: fit-content; max-width: 100%; padding: .05rem .35rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); color: var(--muted); font-size: .8rem; user-select: all; overflow-wrap: anywhere; }
/* A checkbox's hint sits under its label, aligned with the text. */
.permission > .field-hint, .role-choices > .group-hint { padding-left: calc(18px + .6rem); margin-top: -.15rem; }
.permission .card-badges { padding-left: calc(18px + .6rem); }
.permission > .permission-key { margin-left: calc(18px + .6rem); max-width: calc(100% - 18px - .6rem); margin-top: -.15rem; }
.group-summary { margin: 0; font-weight: 600; }
.groups-summary { margin-top: .5rem; }
.groups-summary .disclosure { margin-top: .5rem; }
.summary-area + .summary-area { margin-top: .75rem; }
.summary-area ul { margin: .25rem 0 0; padding-left: 1.25rem; font-weight: 400; font-size: .9rem; }
.audit-target { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; overflow-wrap: anywhere; }
.audit-target small { display: block; margin-top: .15rem; }
.audit-target { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: .4rem; }
.audit-target small { flex-basis: 100%; }
.audit-who small { display: block; color: var(--muted); }
.review-dialog form label { text-align: left; }

/* ---------- The second factor (#342) ---------- */
.qr-figure { display: grid; gap: .75rem; justify-items: center; margin: 0 0 1rem; }
.qr-figure svg { width: min(220px, 60vw); height: auto; border-radius: var(--radius-sm); }
.qr-figure figcaption { font-size: .85rem; text-align: center; }
.secret { display: inline-block; padding: .3rem .5rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); font-size: .85rem; letter-spacing: .04em; user-select: all; }
.recovery-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .35rem 1rem; margin: 1rem 0; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; list-style-position: inside; user-select: all; }
/* ---------- The consent page (#340) ---------- */
.consent-list { margin: 1rem 0; padding-left: 1.2rem; }
.consent-list li { margin: .4rem 0; }
/* ---------- #395–#403: who made it, Historial, Archivo, Campañas, the image bank ---------- */
.signed-as { margin: .25rem 0 var(--field-gap); }
.history-link { font-size: .85rem; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.history-link:hover, .history-link:focus-visible { color: var(--accent); }
.audit-who a, .audit-who code { display: block; width: fit-content; }
.history-event { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
/* ---------- #1001: Ver cambios, and a change's before and after ---------- */
.diff { display: grid; gap: .5rem; max-width: 72ch; }
.diff h4 { margin: .5rem 0 0; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.diff-fields { display: grid; gap: .35rem; margin: 0; }
.diff-field { display: grid; grid-template-columns: minmax(7rem, 12rem) 1fr; gap: .75rem; align-items: baseline; }
.diff-field dt { font-weight: 600; overflow-wrap: anywhere; }
.diff-field dd { margin: 0; overflow-wrap: anywhere; }
.diff-value { white-space: pre-wrap; }
.diff ins, .history-values ins { background: color-mix(in srgb, #2e7d32 18%, transparent); text-decoration: none; border-radius: 2px; }
.diff del, .history-values del { background: color-mix(in srgb, var(--danger) 16%, transparent); border-radius: 2px; }
.diff-body { display: grid; gap: .4rem; }
.diff-para { margin: 0; padding: .35rem .6rem; border-left: 3px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
.diff-para.añadido { border-left-color: #2e7d32; }
.diff-para.quitado { border-left-color: var(--danger); }
.diff-para.cambiado { border-left-color: var(--accent); }
.diff-skip { margin: 0; font-size: .85rem; }
.diff-details, .history-values { flex-basis: 100%; }
.diff-details summary, .history-values summary { cursor: pointer; font-size: .85rem; color: var(--muted); }
.diff-details[open] > div { margin-top: .5rem; }
.channel-picks { display: flex; flex-wrap: wrap; gap: .35rem 1.25rem; margin: .75rem 0 1rem; }
.channel-picks label { width: auto; margin: 0; }
.batch-rows { display: grid; gap: .75rem; margin: 1rem 0; }
.batch-row { display: grid; grid-template-columns: 7rem minmax(10rem, 1.2fr) minmax(8rem, .8fr) minmax(8rem, 1fr) auto; gap: .75rem; align-items: end; padding: .75rem; border: 1px solid var(--line); border-radius: var(--radius); }
.batch-row label { margin: 0; }
.batch-row > strong { align-self: center; overflow-wrap: anywhere; }
.batch-row > .badge { align-self: center; justify-self: start; }
.promo-batch { margin-top: 1.25rem; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; margin-top: 1rem; }
.media-tile { display: flex; flex-direction: column; gap: .6rem; min-width: 0; padding: .6rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.media-thumb { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: calc(var(--radius) - 2px); background: #0b0b0b; }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-body { display: grid; gap: .2rem; min-width: 0; }
.media-head { display: flex; flex-wrap: wrap; gap: .3rem .5rem; align-items: baseline; justify-content: space-between; min-width: 0; }
/* What the image was uploaded for (#427). */
.media-purpose { font-size: .72rem; line-height: 1; padding: .22rem .5rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.media-purpose.post, .media-purpose.event { border-color: var(--accent); color: var(--accent); }
.media-body small { overflow-wrap: anywhere; }
.media-title { overflow-wrap: anywhere; }
.media-tile .toolbar { margin-top: auto; }
.media-picker { width: min(960px, calc(100% - 2rem)); max-width: none; max-height: calc(100dvh - 2rem); overflow: auto; }
.media-picker .media-grid { max-height: 55dvh; overflow: auto; padding-right: .25rem; }
.image-upload > .toolbar { max-width: 560px; }
.image-upload > .toolbar > button { flex: 1 1 12rem; }
@media (max-width: 760px) {
  .batch-row { grid-template-columns: 1fr; }
  .media-grid { grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); }
}
.promo-batch { margin-bottom: 1.25rem; }
.promo-audiences { margin-bottom: .35rem; }
/* ---------- #413: the share card panel ---------- */
.share-preview .content-image { max-width: 560px; }
.share-proposed { margin-top: .75rem; outline: 1px dashed var(--line-strong); outline-offset: 4px; }

/* ---------- Directorio (#406) ---------- */
/* The state of «Entrar con X»: a danger banner while X refuses the app, a quiet line otherwise. */
.x-banner { margin: 0 0 var(--gap); padding: 1rem 1.25rem; border: 1px solid var(--danger); border-radius: var(--radius); background: #301917; }
.x-banner p { margin: 0; }
.x-banner p + p { margin-top: .5rem; }
.x-banner .toolbar { margin-top: .75rem; }
.card .x-banner { margin: 1rem 0 0; }
.x-line { margin: 0 0 var(--gap); font-size: .9rem; }
.card .x-line { margin: 1rem 0 0; }
/* The states of Fichas as tabs: links, so the address carries the one chosen. */
.estado-tabs { display: flex; gap: .25rem; margin: 0 0 var(--gap); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.estado-tabs a { flex: 0 0 auto; display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; margin-bottom: -1px; padding: .6rem 1rem; border-bottom: 2px solid transparent; color: var(--muted); text-decoration: none; }
.estado-tabs a:hover { color: var(--ink); border-color: var(--line-strong); }
.estado-tabs a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
.estado-tabs .count { padding: .05rem .45rem; border-radius: 999px; background: var(--raised); font-size: .72rem; font-variant-numeric: tabular-nums; }
.filter-bar > label:has(> input[type="checkbox"]) { flex: 0 0 auto; max-width: none; }
.row-link { cursor: pointer; }
.row-link:hover td { background: var(--raised); }
/* The photo, or the initials until the owner signs in with X. */
.ficha-photo { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; object-fit: cover; background: var(--raised); color: var(--muted); font-size: .85rem; font-weight: 700; letter-spacing: .04em; }
td .ficha-photo { width: 36px; height: 36px; border-radius: 8px; font-size: .7rem; }
/* The queue of Pendientes: one card per ficha, the marked one outlined. */
.ficha-queue { display: grid; gap: var(--gap); }
/* The ficha's photo in its own frame (#575): the 4:5 of the public card. */
.ficha-frame { display: grid; place-items: center; width: min(100%, 208px); aspect-ratio: 4 / 5; margin: 0 0 var(--field-gap); overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--raised); color: var(--muted); font-size: 2rem; font-weight: 700; letter-spacing: .04em; }
.ficha-frame img { width: 100%; height: 100%; object-fit: cover; }
.ficha-frame-empty { font-size: .85rem; font-weight: 600; letter-spacing: 0; }
.ficha-field > .ficha-frame { margin-top: .4rem; }
/* The messages the team copies and sends by hand (#574). */
.ficha-message { min-height: 12rem; font-size: .9rem; line-height: 1.55; resize: vertical; }
/* «Dónde vive» (#573): the two optional fields as one group inside the form. */
.vive-group .field-pair > .field { margin-bottom: 0; }
.choice-group > .field-head { display: flex; }
.sello-warning[hidden] { display: none; }
.ficha-card { padding: var(--pad); border: 1px solid #2c2a26; border-radius: 14px; background: var(--surface); }
.ficha-card:focus-visible, .ficha-card[data-marked] { outline: 2px solid var(--accent); outline-offset: 2px; }
.ficha-head { display: flex; align-items: center; gap: 1rem; margin: 0 0 1rem; }
.ficha-head .ficha-photo { flex: 0 0 auto; width: 64px; height: 64px; }
.ficha-who { min-width: 0; }
.ficha-who h3 { margin: 0; font-size: 1.35rem; overflow-wrap: anywhere; }
.ficha-who p { margin: .2rem 0 0; }
.ficha-card .facts { margin: 0 0 .75rem; }
.ficha-meta { margin: 0 0 .5rem; font-size: .85rem; }
.ficha-actions { margin-top: .75rem; }
.ficha-links { margin: 0; padding: 0; list-style: none; }
.ficha-links li { overflow-wrap: anywhere; }
.ficha-rules { margin: 0 0 1rem; padding-left: 1.2rem; }
.ficha-rules li { margin: .4rem 0; }
/* A ficha's history and Actividad: who, what, and each change as before → after. */
.ficha-changes { margin: .25rem 0 0; padding-left: 1.1rem; font-size: .85rem; color: var(--muted); }
.ficha-changes del { color: var(--muted); }
.ficha-changes strong { color: var(--ink); font-weight: 600; }
.ficha-event { padding: .6rem 0; border-top: 1px solid #ffffff0a; }
.ficha-event:first-of-type { border-top: 0; }
.ficha-event p { margin: 0; font-size: .9rem; }
.ficha-estado { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0 0 1rem; }
/* Groups of checkboxes (oficio, abierta/o a) and of radios (the import's state). */
.choice-group { margin: 0 0 var(--field-gap); padding: .75rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.choice-group legend { padding: 0 .35rem; font-size: .9rem; font-weight: 600; }
.choice-group label { margin: .35rem 0; }
.reason-choices { display: grid; gap: .4rem; margin: 0 0 1rem; text-align: left; }
.reason-choices label { margin: 0; }
.reason-dialog label { text-align: left; }
/* Curadores: one row per signature, in order. */
.curator-row { display: grid; grid-template-columns: 2rem repeat(3, minmax(0, 1fr)) auto; align-items: end; gap: .75rem; padding: .5rem 0; border-top: 1px solid #ffffff0a; }
.curator-row:first-of-type { border-top: 0; }
.curator-row > label { margin: 0; }
.curator-row .toolbar { margin: 0; }
.curator-order { padding-bottom: .9rem; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .curator-row { grid-template-columns: minmax(0, 1fr); } .curator-order { padding-bottom: 0; } }
/* ---------- Programas, Emisiones, Locutores (#420) ---------- */
.badge[data-status="live"] { color: #fff; background: #8a1020; border-color: #e4002b; }
.badge[data-status="ended"], .badge[data-status="cancelled"] { color: var(--muted); }
.broadcast-week { margin: 1.5rem 0 .5rem; }
.broadcast-week:first-child { margin-top: 0; }
.broadcast-when { display: grid; gap: .1rem; }
.broadcast-when strong { font-variant-numeric: tabular-nums; }
.broadcast-when small { color: var(--muted); }
.broadcast-missing { color: #ffd083; font-size: .8rem; }
.host-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); background: var(--raised); }
.host-row { display: flex; align-items: center; gap: .75rem; }
.slot-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: .75rem; }
.slot-row label { margin: 0; }
@media (max-width: 640px) { .slot-row { grid-template-columns: 1fr; } }
.utc-note { margin: .25rem 0 0; color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }

/* Colaboraciones (#465): a proposal reads as it was written, line breaks kept. */
.proposal-text { white-space: pre-wrap; margin: 0; }
/* The door list (#462): the name over the address, so a phone row reads at a glance. */
.door-name { display: flex; flex-direction: column; gap: 2px; }
.door-name small { overflow-wrap: anywhere; }
/* An autor's post under review (#471): where it stands, and the team's note when it came back. */
.review-box { margin: 0 0 var(--gap); padding: .85rem 1rem; border: 1px solid var(--line-strong); border-radius: var(--radius); }
.review-box.returned { border-color: var(--danger); background: #301917; }
.review-box p { margin: .35rem 0 0; }
.review-box blockquote { margin: .5rem 0 0; padding-left: .75rem; border-left: 3px solid var(--line-strong); white-space: pre-wrap; }
/* La Familia's incubator (#472): an application's blocks as the API returns them. */
.incubadora-block { padding-top: .5rem; }
.incubadora-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.incubadora-list { margin: 0; padding-left: 1.25rem; display: grid; gap: .75rem; }
.incubadora-error { color: var(--danger); margin: 0 0 .5rem; }

/* ---------- Avisos por correo (#569) ---------- */
/* The grid on Tu cuenta: rules indented under their area, a cell the person changed outlined in the accent. */
.avisos-grid td { vertical-align: middle; }
.avisos-grid .avisos-rule { padding-left: 1.25rem; color: var(--muted); }
.avisos-grid input[type="checkbox"] { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
.avisos-grid input.own { outline: 2px solid var(--accent); outline-offset: 2px; }
.avisos-prefs h3 { margin: var(--gap) 0 .5rem; }
.avisos-grid th:last-child, .avisos-grid td:last-child { text-align: left; }
.avisos-grid .audit-who { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.avisos-prefs input[type="number"] { max-width: 8rem; }
.avisos-quiet { display: grid; grid-template-columns: repeat(2, minmax(0, 12rem)); gap: var(--field-gap); }
.avisos-prefs > .field-hint { display: block; margin: .35rem 0 var(--field-gap); }
/* ---------- Avisos, Notificaciones and the bell (#567) ---------- */
/* The bell sits beside Tu cuenta; its panel opens upward over the page. */
.account-row { position: relative; display: flex; align-items: stretch; gap: .4rem; margin: .25rem 0 0; }
.account-row .account-link { flex: 1; min-width: 0; margin: 0; }
.bell { position: relative; display: grid; place-items: center; flex: 0 0 44px; min-height: 44px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--muted); }
.bell:hover, .bell[aria-expanded="true"] { border-color: var(--line-strong); background: var(--raised); color: var(--ink); }
.bell .icon { width: 18px; height: 18px; }
.bell-count { position: absolute; top: -.45rem; right: -.45rem; min-width: 1.3rem; padding: .05rem .35rem; border-radius: 999px; background: var(--accent); color: var(--bg); font-size: .66rem; font-weight: 700; line-height: 1.4; text-align: center; }
.bell.urgent .bell-count { background: #e4002b; color: #fff; }
.bell.urgent { border-color: #e4002b80; color: #ffc0b8; }
.sidebar:has(.bell-panel:not([hidden])) { z-index: 40; }
.bell-panel { position: absolute; bottom: calc(100% + .5rem); left: 0; z-index: 45; width: min(380px, calc(100vw - 2rem)); max-height: min(70dvh, 560px); overflow-y: auto; padding: 1rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); box-shadow: 0 20px 60px #000c; }
.bell-panel h2 { margin: 0 0 .75rem; font-size: 1.3rem; }
.bell-panel .toolbar { justify-content: space-between; margin: .75rem 0 0; }
.bell-list { display: grid; gap: .15rem; margin: 0; padding: 0; list-style: none; }
.bell-list a, .bell-list .bell-hidden { display: grid; grid-template-columns: auto 1fr; gap: .1rem .5rem; align-items: baseline; padding: .5rem .6rem; border-radius: var(--radius-sm); color: var(--muted); font-size: .85rem; text-decoration: none; }
.bell-list a > :not(.badge), .bell-list .bell-hidden > * { grid-column: 2; }
.bell-list .bell-hidden { font-style: italic; }
.bell-list a > .badge { grid-row: 1 / span 2; align-self: start; }
.bell-list a:hover { background: var(--raised); color: var(--ink); }
.bell-list li.unread a { color: var(--ink); font-weight: 600; }
.bell-list small { color: var(--muted); font-weight: 400; font-size: .75rem; }
/* Severity: urgente red, atención amber; info carries no mark. */
.badge[data-severity="urgente"] { color: #fff; background: #8a1020; border-color: #e4002b; }
.badge[data-severity="atencion"] { color: #ffd083; background: #302415; border-color: #69502b; }
.aviso-list { display: grid; gap: .75rem; }
.aviso { padding: .9rem 1rem; border: 1px solid var(--line); border-left: 3px solid var(--line-strong); border-radius: var(--radius); background: var(--bg); }
.aviso[data-severity="atencion"] { border-left-color: #fca311; }
.aviso[data-severity="urgente"] { border-left-color: #e4002b; }
.aviso-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.aviso-title { font-size: 1rem; }
.aviso-title a { color: var(--ink); }
.aviso-title a:hover { color: var(--accent); }
.aviso-body { margin: .35rem 0 0; }
.aviso-rule, .aviso-meta { margin: .25rem 0 0; color: var(--muted); font-size: .8rem; }
.aviso .toolbar { margin: .75rem 0 0; gap: .4rem; }
.aviso .toolbar button, .note .toolbar button { min-height: 34px; padding: .35rem .75rem; font-size: .8rem; }
.disclosure .aviso-list { margin-top: .5rem; }
.aviso-lines { display: grid; gap: .4rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.aviso-urgent-line { margin: .75rem 0 0; color: #ffc0b8; font-weight: 600; }
.note-list { display: grid; gap: .5rem; }
.note { padding: .75rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.note.unread { border-left: 3px solid var(--accent); }
.note.unread .note-line a { font-weight: 700; }
.note-line { margin: 0; }
.note-evento { color: var(--muted); }
.note-state { margin: .25rem 0 0; color: var(--muted); font-size: .8rem; }
.note .toolbar { margin: .5rem 0 0; }
/* #570: the Informes — the brief as a reading column, each claim's figure beside it, the pack as JSON. */
.informe-brief { max-width: 72ch; }
.informe-brief h2 { margin: 0 0 1rem; }
.informe-brief h3 { margin: 1.5rem 0 .5rem; font-size: .95rem; }
.informe-brief ul { margin: 0; padding-left: 1.2em; }
.informe-brief li { margin: 0 0 .6rem; line-height: 1.5; }
.informe-cifra { display: block; color: var(--muted); font-size: .85em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.informe-datos { max-height: 70vh; overflow: auto; padding: .75rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); font-size: .8rem; white-space: pre; }

/* ---------- Alcance de los avisos (#571) ---------- */
/* Resumen's countdowns: the time left first, large, then what and when. */
.countdown-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.countdown { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .5rem; }
.countdown-left { min-width: 7.5rem; font-variant-numeric: tabular-nums; color: var(--accent); }
/* Tu cuenta's calendar, absence and watches, one block each. */
.avisos-alcance .alcance-block + .alcance-block { margin-top: var(--gap); padding-top: var(--gap); border-top: 1px solid var(--line); }
.avisos-alcance h3 { margin: 0 0 .5rem; }
.avisos-alcance input[readonly] { font-family: var(--mono, monospace); font-size: .85rem; }
.avisos-alcance input[type="date"] { max-width: 12rem; }
/* The thresholds' page: the number fields narrow, each rule reachable by its anchor. */
[id^="regla-"] { scroll-margin-top: 1rem; }
[id^="regla-"] input[type="number"] { max-width: 6rem; }
.avisarme { display: inline-flex; }
.nowrap { white-space: nowrap; }

/* ---------- Publicación: the timeline (#604) ---------- */
.timeline { margin: 0 0 1rem; }
.timeline:empty { display: none; }
.timeline-head { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; margin: 0 0 .5rem; font-size: .9rem; }
.timeline-last { margin-top: .75rem; font-size: .9rem; }
.timeline-last summary { cursor: pointer; color: var(--muted); }
.timeline-last[open] summary { margin-bottom: .5rem; }
.steps { list-style: none; margin: 0; padding: 0; }
.step { position: relative; display: grid; grid-template-columns: 1.5rem minmax(0, 1fr); column-gap: .75rem; padding: .35rem 0; }
.step:not(:last-child)::after { content: ""; position: absolute; left: calc(.75rem - 1px); top: 1.95rem; bottom: -.35rem; width: 2px; background: var(--line); }
.step[data-state="done"]:not(:last-child)::after { background: var(--accent); }
.step-mark { grid-row: span 2; width: 1.5rem; height: 1.5rem; border: 2px solid var(--line-strong); border-radius: 999px; background: var(--bg); color: var(--muted); display: grid; place-items: center; font-size: .7rem; font-weight: 700; font-variant-numeric: tabular-nums; position: relative; z-index: 1; }
.step-title { font-size: .92rem; font-weight: 600; }
.step-detail { font-size: .84rem; color: var(--muted); overflow-wrap: anywhere; }
.step-detail:empty { display: none; }
.step[data-state="waiting"] .step-title { color: var(--muted); font-weight: 400; }
.step[data-state="done"] .step-mark { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.step[data-state="current"] .step-mark { border-color: var(--accent); color: var(--accent); animation: step-pulse 2s ease-in-out infinite; }
.step[data-state="failed"] .step-mark { background: #301c1a; border-color: #67413c; color: #ffc0b8; }
.step[data-state="failed"] .step-detail { color: var(--danger); }
@keyframes step-pulse { 50% { box-shadow: 0 0 0 4px #fca31133; } }
@media (prefers-reduced-motion: reduce) { .step[data-state="current"] .step-mark { animation: none; } }
.nav-progress { padding: 0 .35rem; border: 1px solid var(--accent); border-radius: 999px; color: var(--accent); font-size: .65rem; font-weight: 700; line-height: 1.4; font-variant-numeric: tabular-nums; }

/* ---------- Where an entry is (#613) ---------- */
.badge[data-status^="estado-"] { display: inline-flex; align-items: center; gap: .35rem; }
.badge[data-status^="estado-"]::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; flex: none; }
.badge[data-status="estado-borrador"] { color: #ffd083; background: #302415; border-color: #69502b; }
.badge[data-status="estado-lista"], .badge[data-status="estado-en_staging"] { color: #c9d6ea; background: #1a2130; border-color: #3a4a68; }
.badge[data-status="estado-publicada"], .badge[data-status="estado-publicada_cambios"] { color: #b8dac3; background: #17231c; border-color: #35513f; }
.badge[data-status="estado-se_retira"] { color: #ffc0b8; background: #301c1a; border-color: #67413c; }
.estado-badges { display: inline-flex; flex-wrap: wrap; gap: .35rem; vertical-align: middle; }
.content-card .card-estado { display: flex; margin-top: .6rem; }
/* Changes waiting on a live entry: amber and dashed, like something not yet saved through. */
.badge[data-status="estado-cambios"] { color: #ffd083; background: transparent; border: 1px dashed #c99a4a; }
.estado { display: grid; gap: 1.25rem; }
.estado-head { display: grid; gap: .6rem; justify-items: start; }
.estado-head .badge { font-size: .85rem; }
.estado-sentence { margin: 0; font-size: 1.1rem; max-width: 62ch; }
.estado-note { margin: -.5rem 0 0; color: var(--muted); font-size: .88rem; }
/* The track: four stops joined by a line, the way an entry travels. */
.estado-track { list-style: none; margin: 0; padding: 1.25rem; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.estado-stop { position: relative; display: grid; gap: .3rem; align-content: start; padding-right: .75rem; min-width: 0; }
.estado-stop::after { content: ""; position: absolute; top: .75rem; left: 1.6rem; right: 0; height: 2px; background: var(--line); }
.estado-stop:last-child::after { display: none; }
.estado-dot { width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--bg); display: grid; place-items: center; font-size: .75rem; font-weight: 700; color: var(--muted); position: relative; z-index: 1; font-variant-numeric: tabular-nums; }
.estado-stop strong { font-size: .95rem; }
.estado-stop small { color: var(--muted); font-size: .8rem; line-height: 1.4; overflow-wrap: anywhere; }
.estado-stop[data-state="done"] .estado-dot { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.estado-stop[data-state="done"]::after { background: var(--accent); }
.estado-stop[data-state="current"] .estado-dot { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 4px rgb(252 163 17 / .15); }
.estado-stop[data-state="leaving"] .estado-dot { background: #301c1a; border-color: #ffc0b8; color: #ffc0b8; }
@media (max-width: 640px) {
  .estado-track { grid-template-columns: 1fr; gap: 1rem; padding: 1rem; }
  .estado-stop { grid-template-columns: 1.6rem minmax(0, 1fr); column-gap: .75rem; padding-right: 0; }
  .estado-dot { grid-row: span 3; }
  .estado-stop::after { top: 1.6rem; left: calc(.8rem - 1px); right: auto; width: 2px; height: calc(100% - .6rem); }
}
.estado-grid { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
@media (max-width: 900px) { .estado-grid { grid-template-columns: minmax(0, 1fr); } }
.estado-where, .estado-next { display: grid; gap: .75rem; min-width: 0; }
.estado-where h3, .estado-next h3 { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.estado-copies { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); }
.estado-copies > div { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: .25rem 1rem; padding: .85rem 1rem; border-top: 1px solid var(--line); }
.estado-copies > div:first-child { border-top: 0; }
.estado-copies dt { font-weight: 600; }
.estado-copies dt small { display: block; font-weight: 400; color: var(--muted); font-size: .75rem; overflow-wrap: anywhere; }
.estado-copies dd { margin: 0; color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.estado-copies [data-copy="esta"] dd { color: var(--ink); }
.estado-copies [data-copy="ahead"] dd { color: #ffd083; }
@media (max-width: 520px) { .estado-copies > div { grid-template-columns: minmax(0, 1fr); } }
.estado-next { padding: 1.1rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.estado-next p { margin: 0; color: var(--muted); }
.estado-next .estado-active { color: var(--ink); font-size: .88rem; }
.estado-next small { font-size: .8rem; }
.button.danger { color: var(--danger); }

.lane-bar { display: inline-flex; gap: 3px; align-items: center; margin-left: auto; }
.lane-bar i { width: 14px; height: 4px; border-radius: 2px; background: var(--line); }
.lane-bar i[data-state="done"] { background: var(--accent); }
.lane-bar i[data-state="current"] { background: var(--accent); opacity: .5; }
.lane-bar i[data-state="failed"] { background: #ffc0b8; }
.lane-count { color: var(--muted); font-variant-numeric: tabular-nums; }
/* A done mark is the sprite's check (i-hecho), on the mark's own colour. */
.estado-dot .icon { width: 14px; height: 14px; stroke-width: 3; }
.step-mark .icon { width: 12px; height: 12px; stroke-width: 3; }
/* Publicación in the sidebar (#620): the label never breaks; the pending count sits on the icon's corner, as the bell's does, so «N/12» has room. */
nav a.nav-publication .nav-label { overflow-wrap: normal; white-space: nowrap; }
nav a.nav-publication .nav-progress { flex: none; }
nav a.nav-publication .nav-badge { position: absolute; top: 1px; left: calc(.85rem + 9px); min-width: 1.05rem; padding: 0 .25rem; font-size: .6rem; line-height: 1.05rem; box-shadow: 0 0 0 2px var(--surface); }

/* ---------- Tickets (#648) ---------- */
/* Feedback at the sidebar's foot, a quiet line like «Ver la web». */
.feedback-link { width: 100%; justify-content: flex-start; gap: .7rem; min-height: 36px; padding: .4rem .85rem; border: 0; background: transparent; color: var(--muted); font-size: .85rem; font-weight: 500; }
.feedback-link:hover { color: var(--ink); background: var(--raised); border-color: transparent; }
#mobile-menu .feedback-link { min-height: 48px; margin: .4rem 0 0; border: 1px solid var(--line); background: var(--surface); }
/* A notice's action (Pedir a un admin): a link-looking button. */
button.notice-link { min-height: 0; padding: 0; border: 0; background: none; color: var(--accent); font-size: inherit; text-decoration: underline; text-underline-offset: .2em; }
button.notice-link:hover { color: var(--accent-hover); }
/* The states as chips, the current one marked. */
.ticket-estados { margin-top: 1rem; }
.ticket-estados .chip[aria-current="true"] { border-color: var(--accent); background: #fca3111c; color: var(--accent); font-weight: 600; }
.ticket-filters > label { flex: 1 1 9rem; max-width: 14rem; }
.ticket-search { display: flex; align-items: flex-end; gap: .5rem; flex: 2 1 16rem; }
.ticket-search > label { flex: 1; margin: 0; }
.ticket-search button { min-height: 44px; }
/* The list: one row per ticket, the number and title first, the marks at the end. */
.ticket-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.ticket-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "head marks" "meta marks"; gap: .2rem 1rem; align-items: center; padding: .85rem 1rem; border-top: 1px solid var(--line); }
.ticket-row:first-child { border-top: 0; }
.ticket-row:hover { background: var(--raised); }
.ticket-row-head { grid-area: head; display: flex; align-items: baseline; gap: .6rem; min-width: 0; }
.ticket-numero { flex: none; color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.ticket-row-title { min-width: 0; color: var(--ink); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.ticket-row-title:hover { color: var(--accent); text-decoration: underline; }
.ticket-row-meta { grid-area: meta; margin: 0; color: var(--muted); font-size: .82rem; }
.ticket-row-marks { grid-area: marks; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: .4rem; }
.ticket-row[data-estado="hecho"] .ticket-row-title, .ticket-row[data-estado="descartado"] .ticket-row-title, .ticket-row[data-estado="duplicado"] .ticket-row-title { color: var(--muted); font-weight: 500; }
.ticket-apoyos { padding: .1rem .5rem; border: 1px solid #fca31160; border-radius: 999px; color: var(--accent); font-size: .75rem; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .ticket-row { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "meta" "marks"; }
  .ticket-row-marks { justify-content: flex-start; }
  .ticket-filters > label { max-width: none; }
}
/* A ticket's states and priorities. */
.badge[data-status="ticket-nuevo"] { color: #ffd083; background: #302415; border-color: #69502b; }
.badge[data-status="ticket-aceptado"], .badge[data-status="ticket-en_curso"] { color: #c9d6ea; background: #1a2130; border-color: #3a4a68; }
.badge[data-status="ticket-hecho"] { color: #b8dac3; background: #17231c; border-color: #35513f; }
.badge[data-status="ticket-descartado"], .badge[data-status="ticket-duplicado"], .badge[data-status="prioridad-baja"] { color: var(--muted); }
.badge[data-status="prioridad-alta"] { color: #ffc0b8; background: #301c1a; border-color: #67413c; }
/* A ticket's page: the text and the thread, and beside them its data and controls. */
.ticket-grid { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
@media (max-width: 1100px) { .ticket-grid { grid-template-columns: minmax(0, 1fr); } }
.ticket-grid .card { margin: 0; }
.card > .ticket-cuerpo { color: var(--ink); font-size: 1rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.card > .ticket-cuerpo.muted { color: var(--muted); }
.ticket-thread { list-style: none; margin: 0 0 1rem; padding: 0; }
.ticket-event { position: relative; padding: 0 0 1rem 1.4rem; }
.ticket-event::before { content: ""; position: absolute; left: .3rem; top: .5rem; width: .5rem; height: .5rem; border-radius: 50%; background: var(--line-strong); }
.ticket-event:not(:last-child)::after { content: ""; position: absolute; left: calc(.55rem - 1px); top: 1.2rem; bottom: .1rem; width: 2px; background: var(--line); }
.ticket-event[data-accion="estado"]::before, .ticket-event[data-accion="github_cerrado"]::before { background: var(--accent); }
.ticket-event[data-accion="comentario"]::before, .ticket-event[data-accion="respuesta"]::before { background: #8fa8d0; }
.ticket-event-line { margin: 0; font-size: .92rem; }
.ticket-event-when { display: block; color: var(--muted); font-size: .78rem; }
.ticket-quote { margin: .4rem 0 0; padding: .6rem .85rem; border-left: 2px solid var(--line-strong); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--bg); white-space: pre-wrap; overflow-wrap: anywhere; font-size: .9rem; }
.ticket-manage-label { margin: 0; color: var(--muted); font-size: .85rem; }
.ticket-manage-label + .toolbar { margin: .4rem 0 1.25rem; }
/* The Feedback / Pedir a un admin dialog. */
.ticket-dialog { width: min(560px, calc(100% - 2rem)); }
.ticket-dialog .ticket-tipos label { margin: .35rem 0; }
.ticket-attached-block { margin: 1rem 0 0; padding: .75rem 1rem 0; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.ticket-attached-head { margin: 0 0 .25rem; color: var(--muted); font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.ticket-attached { margin: 0 0 .5rem; }
.ticket-attached > div { font-size: .85rem; }
.ticket-dialog .field-error[role="alert"] { display: block; margin: .75rem 0 0; color: var(--danger); }
.ticket-dialog textarea { min-height: 6rem; }
.ticket-dialog .ticket-attached > div { padding: .3rem 0; }
.ticket-dialog .choice-group { margin-bottom: 1rem; }

/* ---------- Row actions: one «Acciones» menu when a row has more than one ---------- */
.row-menu { display: inline-flex; align-items: center; justify-content: flex-end; gap: .5rem; }
td button.row-menu-toggle { gap: .4rem; padding-right: .55rem; }
.row-menu-toggle .icon { width: 14px; height: 14px; transform: rotate(90deg); transition: transform .15s; }
.row-menu-toggle[aria-expanded="true"] { border-color: var(--accent); background: var(--bg); }
.row-menu-toggle[aria-expanded="true"] .icon { transform: rotate(-90deg); }
/* The list sits in the top layer, placed under its button by the script. */
.row-menu-list { position: fixed; inset: auto; margin: 0; min-width: 13rem; max-width: min(20rem, calc(100vw - 1rem)); max-height: min(70dvh, 28rem); overflow-y: auto; padding: .35rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); box-shadow: 0 18px 48px #000c; color: var(--ink); text-align: left; }
.row-menu-list:popover-open { display: grid; gap: 1px; }
.row-menu-item { position: relative; }
.row-menu-item:not(:has(button, a)), .row-menu-item:has(> [hidden]) { display: none; }
.row-menu-item > .icon { position: absolute; top: 50%; left: .7rem; z-index: 1; width: 16px; height: 16px; color: var(--muted); pointer-events: none; translate: 0 -50%; }
.row-menu-item > :is(button, a, .button.small), .row-menu-item > .avisarme, .row-menu-item > .avisarme > button { display: flex; width: 100%; }
.row-menu-item > :is(button, a, .button.small), .row-menu-item > .avisarme > button { justify-content: flex-start; min-height: 38px; padding: .45rem .8rem .45rem 2.4rem; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink); font-size: .85rem; font-weight: 500; line-height: 1.3; text-align: left; text-decoration: none; white-space: nowrap; }
.row-menu-item > :is(button, a, .button.small):is(:hover, :focus-visible), .row-menu-item > .avisarme > button:is(:hover, :focus-visible) { border-color: transparent; background: var(--raised); color: var(--ink); outline: none; }
.row-menu-item:has(:is(button, a):is(:hover, :focus-visible)) > .icon { color: var(--accent); }
.row-menu-item.danger > button, .row-menu-item.danger > .icon { color: var(--danger); }
.row-menu-item.danger:has(button:is(:hover, :focus-visible)) > .icon { color: var(--danger); }
.row-menu-item > button:disabled { opacity: .45; }
/* A rule parts the groups: act, share, record, what ends. */
.row-menu-rule { height: 1px; margin: .25rem .35rem; background: var(--line); }
.row-menu-rule[hidden] { display: none; }

/* ---------- A Persona (#687): the head, the private bar, the thread ---------- */
.result-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; }
.result-line .result-count { margin: 0; }
.thread { display: grid; gap: .75rem; margin-top: var(--stack); padding-top: var(--stack); border-top: 1px solid var(--line); }
.thread .section-title { margin: 0; }
.thread-msg { display: grid; gap: .35rem; max-width: min(100%, 44rem); padding: .75rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.thread-enviado { justify-self: end; border-color: #4b3f25; background: #1a1610; }
.thread-auto { background: transparent; border-style: dashed; color: var(--muted); }
.thread-who { color: var(--muted); font-size: .8rem; }
.thread-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.panel-grid + .card { margin-top: var(--gap); }
/* One filter bar for every list (#699): the states as tabs with their counts,
   then the bar (search first, the filters, «Limpiar filtros»), then the count. */
.list-filters { display: grid; gap: .75rem; margin: 0 0 1rem; min-width: 0; }
.list-filters > .tab-row { display: flex; flex-wrap: nowrap; gap: 0 .25rem; width: 100%; overflow-x: auto; box-shadow: inset 0 -1px var(--line); scrollbar-width: thin; }
.list-filters > .tab-row button, .list-filters > .tab-row button:first-child, .list-filters > .tab-row button:last-child { display: inline-flex; align-items: center; gap: .45rem; margin: 0; padding: .6rem .9rem; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--muted); }
.list-filters > .tab-row button:hover { color: var(--ink); border-color: var(--line-strong); }
.list-filters > .tab-row button[aria-pressed="true"] { color: var(--accent); border-bottom-color: var(--accent); background: transparent; }
.tab-count { min-width: 1.4rem; padding: .05rem .4rem; border-radius: 999px; background: var(--raised); color: var(--muted); font-size: .72rem; font-weight: 600; font-variant-numeric: tabular-nums; text-align: center; }
.tab-row button[aria-pressed="true"] .tab-count { background: #fca3111c; color: var(--accent); }
.list-filters .filter-bar > .filter-search { flex: 2 1 18rem; max-width: 30rem; }
.list-filters .filter-bar > label.check { flex: 0 0 auto; max-width: none; align-self: center; min-height: var(--control); font-weight: 500; }
.list-filters .filter-bar > .filter-clear { flex: none; margin-left: auto; }
.list-filters + .result-line, .list-filters + .result-count { margin-top: -.25rem; }
.result-line { margin: 0 0 .6rem; min-height: 2rem; }
@media (max-width: 640px) {
  .list-filters .filter-bar > .filter-clear { margin-left: 0; }
  .list-filters .filter-bar > label.check { grid-column: auto; }
}
/* Colaboraciones (#697): the inbox and a proposal's conversation. */
.inbox-who { display: grid; gap: .15rem; min-width: 14rem; max-width: 36rem; }
.inbox-title { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-weight: 600; }
.inbox-preview { display: -webkit-box; margin: .15rem 0 0; overflow: hidden; color: var(--muted); font-size: .8rem; line-height: 1.45; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.inbox tr.is-unread > td { background: #fca3110a; }
.inbox tr.is-unread > td:first-child { box-shadow: inset 3px 0 var(--accent); }
.badge[data-status="unread"] { border-color: #6b5a33; background: #fca3111c; color: var(--accent); }
.card > .thread { margin-top: 0; padding-top: 0; border-top: 0; }
.thread-msg { max-width: min(100%, 40rem); }
.thread-recibido { justify-self: start; }
.thread-propuesta { border-color: var(--line-strong); }
.thread-empty { margin: 0; }
.thread-composer { display: grid; gap: .5rem; margin-top: .5rem; padding-top: var(--stack); border-top: 1px solid var(--line); }
.thread-composer label { margin: 0; }
.colabora-grid { grid-template-columns: minmax(0, 2fr) minmax(18rem, 1fr); }
@media (max-width: 1100px) { .colabora-grid { grid-template-columns: minmax(0, 1fr); } }
.linked-text { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
/* A Persona's Resumen is their profile (#698): who they are beside what they did. */
/* A Persona's page (#840). «Correo y datos privados» is a card of Resumen:
   dashed while closed, warm once shown. Each card of Actividades keeps its
   list to a short box that scrolls inside it, header fixed. */
.private-card { border-style: dashed; border-color: var(--line-strong); }
.private-card.is-open { border-style: solid; border-color: #6b5a33; background: linear-gradient(180deg, #1d180e, var(--surface)); }
.private-body { display: grid; gap: var(--stack); }
.private-line { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; }
.private-line > svg { flex: 0 0 auto; width: 20px; height: 20px; color: var(--accent); }
.private-line > p { flex: 1 1 16rem; min-width: 0; margin: 0; }
.private-body .facts, .private-body table { margin: 0; }
.actividad-card .table { max-height: min(24rem, 60vh); }
.profile-grid { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: start; }
@media (max-width: 1100px) { .profile-grid { grid-template-columns: minmax(0, 1fr); } }
.profile-grid .card { margin: 0; }
/* #866: a card per section of the profile, side by side where there is room. */
.profile-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: var(--gap); align-items: start; }
.profile-cards > .card { margin: 0; }
.profile-line { margin: 0 0 .35rem; font-size: 1.05rem; font-weight: 600; }
.profile-registro { padding: .75rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.profile-registro summary { cursor: pointer; color: var(--muted); font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.fact-history + .fact-history { margin-top: .75rem; }
.profile-facts { display: grid; margin: 0; }
.profile-facts > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .15rem 1rem; align-items: center; padding: .65rem 0; border-bottom: 1px solid var(--line); }
.profile-facts dt { grid-column: 1; }
.profile-facts dd { grid-column: 1; }
.profile-facts > div:last-child { border-bottom: 0; }
.profile-facts dt { color: var(--muted); font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.profile-facts dd { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .6rem; margin: 0; min-width: 0; overflow-wrap: anywhere; }
.profile-facts dd > small { font-size: .75rem; }
/* #859: the other values of a field, folded under the one it shows. */
.fact-others { margin: .3rem 0 0; padding-left: 1rem; color: var(--muted); }
/* The bar's filters: in the row on a wide screen, under «Filtros» on a phone (#699). */
.filter-more { display: contents; }
.filter-more > label, .filter-more > .field { flex: 1 1 12rem; max-width: 20rem; margin: 0; }
.filter-more > label:has(> input[type="date"]) { flex: 1 1 10rem; max-width: 14rem; }
.filter-more > label.check { flex: 0 0 auto; max-width: none; align-self: center; min-height: var(--control); font-weight: 500; }
/* A filter that takes several (#873): its select, and a chip under it for each chosen value, which removes it. */
.filter-more > .filter-multi { display: grid; gap: .4rem; flex: 1 1 12rem; max-width: 20rem; margin: 0; align-content: start; }
.filter-multi > label { margin: 0; }
.filter-multi > .chips { margin: 0; }
.chip-remove { cursor: pointer; font: inherit; font-size: .8rem; }
.chip-remove:hover, .chip-remove:focus-visible { border-color: var(--accent); }
.filter-toggle { display: none; }
@media (max-width: 640px) {
  .list-filters .filter-bar > .filter-toggle { display: block; }
  .list-filters .filter-bar > .filter-more { display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem; }
  .list-filters .filter-bar.has-toggle:not(.is-open) > .filter-more { display: none; }
  .filter-more > * { max-width: none !important; min-width: 0; margin: 0; }
}
/* A Persona's networks (#698): an icon each, a link, a placeholder when missing. */
.redes { display: grid; gap: .5rem; margin: 0 0 var(--stack); padding: 0; list-style: none; }
.red { display: flex; align-items: center; gap: .75rem; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); }
.red > svg { flex: 0 0 auto; width: 22px; height: 22px; color: var(--accent); }
.red-text { display: grid; gap: .05rem; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.red-text small { font-size: .75rem; }
.red-missing { border-style: dashed; background: transparent; }
.red-missing > svg { color: var(--muted); opacity: .6; }
.red-missing .red-text > span { color: var(--muted); }
.perfil-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: .25rem 1.25rem; }
.perfil-form > label { position: relative; margin: 0 0 .5rem; }
.perfil-form > label > svg { width: 16px; height: 16px; margin-right: .35rem; vertical-align: -3px; color: var(--accent); }
/* Operaciones (#705): a restore's steps, numbered. */
.restore-steps { display: grid; gap: .45rem; margin: 0 0 var(--stack); padding-left: 1.3rem; }
.restore-steps li { overflow-wrap: anywhere; }
/* Comunicados (#709): the segment builder and the mail as it arrives. */
.segmento { display: grid; gap: var(--stack); }
.segmento-grupo { margin: 0; padding: 0; border: 0; min-width: 0; }
.segmento-grupo > legend { margin: 0 0 .35rem; padding: 0; font-weight: 600; }
.segmento-grupo .field-hint { margin: 0 0 .5rem; }
.segmento-opciones { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; }
.segmento-opciones label { margin: 0; font-weight: 500; }
.segmento-regiones { max-height: 12rem; overflow-y: auto; }
.reach-line { margin: var(--stack) 0 0; padding: .7rem .9rem; border: 1px solid #6b5a33; border-radius: var(--radius-sm); background: #fca3110f; color: var(--ink); font-weight: 600; }
.comunicado-frame { max-width: none; height: auto; min-height: 34rem; }
/* What the admin sends (#711): the categorical slots, validated on the card
   surface (dark, #121212; worst adjacent pair ΔE 8.4, the donut's wrap pair 15.9). */
:root { --cat-1: #3987e5; --cat-2: #d95926; --cat-3: #199e70; --cat-4: #c98500; --cat-5: #d55181; }
.cat-1 { fill: var(--cat-1); background: var(--cat-1); } .cat-2 { fill: var(--cat-2); background: var(--cat-2); } .cat-3 { fill: var(--cat-3); background: var(--cat-3); }
.cat-4 { fill: var(--cat-4); background: var(--cat-4); } .cat-5 { fill: var(--cat-5); background: var(--cat-5); }
.correo-split { display: grid; grid-template-columns: minmax(10rem, 13rem) minmax(0, 1fr); gap: 1.5rem; align-items: center; margin: 0 0 var(--stack); }
@media (max-width: 640px) { .correo-split { grid-template-columns: minmax(0, 1fr); justify-items: center; } }
.donut-box { position: relative; width: 100%; max-width: 13rem; }
.donut { display: block; width: 100%; height: auto; overflow: visible; }
.donut-seg { stroke: var(--surface); stroke-width: 2px; stroke-linejoin: round; cursor: default; outline: none; }
.donut-seg:hover, .donut-seg:focus-visible { stroke: var(--ink); }
.donut-total, .donut-sub { pointer-events: none; }
.donut-total { fill: var(--ink); font: 600 28px/1 var(--sans); text-anchor: middle; }
.donut-sub { fill: var(--muted); font: 500 11px/1 var(--sans); letter-spacing: .06em; text-anchor: middle; text-transform: uppercase; }
.chart-tip { position: absolute; z-index: 2; transform: translate(-50%, calc(-100% - 10px)); padding: .35rem .55rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--raised); color: var(--ink); font-size: .78rem; white-space: nowrap; pointer-events: none; }
.donut-legend { display: grid; gap: .55rem; width: 100%; margin: 0; padding: 0; list-style: none; }
.donut-legend li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .2rem .7rem; align-items: center; }
.donut-legend li > div { display: grid; min-width: 0; }
.donut-legend small { font-size: .75rem; }
.donut-legend .swatch { width: 12px; height: 12px; border-radius: 3px; }
.donut-legend .is-empty { opacity: .55; }
.donut-figure { color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }


/* ---------- #704: freshness, «Actualizar», the connection, drafts, Este dispositivo ---------- */
.page-actions > .page-sync { order: 99; display: inline-flex; align-items: center; gap: .6rem; flex: none; }
.freshness { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.freshness:empty { display: none; }
.freshness[data-tone="warn"] { color: var(--accent); }
.page-actions button.refresh { display: inline-flex; align-items: center; gap: .4rem; min-height: 36px; padding: .4rem .8rem; }
.page-actions button.refresh .icon { width: 16px; height: 16px; }
.page-actions button.refresh[aria-busy="true"] .icon { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .page-actions button.refresh[aria-busy="true"] .icon { animation: none; } }
@media (max-width: 640px) {
  .page-actions > .page-sync { flex: 1 1 100%; justify-content: space-between; }
  .refresh-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
.net-status { display: inline-flex; align-items: center; gap: .45rem; min-height: 32px; margin: .75rem 0 0; padding: .2rem .6rem; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); font-size: .75rem; font-weight: 500; }
.net-status:hover { border-color: var(--line-strong); color: var(--ink); }
.net-dot { width: .55rem; height: .55rem; border-radius: 50%; background: #5fd38d; box-shadow: 0 0 0 3px #5fd38d22; }
.net-status[data-state="slow"] .net-dot, .net-status[data-state="reconnecting"] .net-dot { background: var(--accent); box-shadow: 0 0 0 3px #fca31122; }
.net-status[data-state="reconnecting"] .net-dot { animation: pulse-dot 1.2s ease-in-out infinite; }
.net-status[data-state="offline"] .net-dot, .net-status[data-state="server"] .net-dot { background: var(--danger); box-shadow: 0 0 0 3px #ffaaa122; }
.net-status:not([data-state="ok"]) { color: var(--ink); border-color: var(--line-strong); }
@keyframes pulse-dot { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .net-status[data-state="reconnecting"] .net-dot { animation: none; } }
.net-panel { position: fixed; inset: 5.5rem auto auto 1rem; margin: 0; width: min(22rem, calc(100vw - 2rem)); padding: 1rem 1.1rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); box-shadow: 0 18px 48px #000c; color: var(--ink); }
.net-panel h2 { margin: 0 0 .5rem; font-size: 1.1rem; }
.net-panel .facts { margin: 0 0 1rem; font-size: .85rem; }
@media (max-width: 900px) {
  .sidebar-head .net-status { margin: 0 0 0 auto; padding: .2rem .45rem; }
  .sidebar-head .net-status .net-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .sidebar-head .net-status:not([data-state="ok"]) .net-label { position: static; width: auto; height: auto; clip-path: none; }
  .net-panel { inset: 4rem 1rem auto auto; }
}
nav a[data-view][data-draft] .nav-label::after { content: " ●"; color: var(--accent); font-size: .7em; vertical-align: .15em; }
.draft-offer, .editing-elsewhere { margin: 0 0 var(--gap); padding: .9rem 1rem; border: 1px solid #fca31166; border-left: 3px solid var(--accent); border-radius: var(--radius); background: #fca3110f; }
.draft-offer p, .editing-elsewhere p { margin: 0 0 .5rem; }
.draft-offer .toolbar, .editing-elsewhere .toolbar { margin: .25rem 0 0; }
.usage-meter { height: .6rem; margin: 0 0 1rem; border-radius: 999px; background: var(--raised); overflow: hidden; }
.usage-meter > span { display: block; height: 100%; min-width: 2px; border-radius: inherit; background: var(--accent); }

/* ---------- Ayuda (#714) ---------- */
.help-terms { display: grid; gap: .5rem; margin: 0; }
.help-terms dt { font-weight: 600; color: var(--ink); }
.help-terms dd { margin: 0; color: var(--muted); }
/* A chart's key: the accent is this period, the grey the one before. */
.chart-key { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; margin: .6rem 0 .25rem; color: var(--muted); font-size: .8rem; }
.chart-key-item { display: inline-flex; align-items: center; gap: .45rem; }
.chart-key-item i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--accent); }
.chart-key-item i[data-kind="previous"] { background: var(--line-strong); }
/* A page's key: the term (its badge) on the left, the meaning beside it; stacked on a phone. */
.status-legend .facts { margin-bottom: .5rem; }
@media (min-width: 641px) {
  .status-legend .facts-stack > div { display: grid; grid-template-columns: minmax(9rem, 14rem) minmax(0, 1fr); align-items: baseline; gap: 1rem; }
}
.status-legend dd { color: var(--muted); }
.legend-more { margin: 0; font-size: .85rem; }
/* The Ayuda page. */
.ayuda-search { width: 100%; max-width: 36rem; margin: 0 0 .5rem; }
.ayuda-index { display: flex; flex-wrap: wrap; gap: .4rem .5rem; margin: 0 0 var(--gap); }
.ayuda-index a { padding: .3rem .7rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .8rem; text-decoration: none; }
.ayuda-index a:hover { border-color: var(--accent); color: var(--ink); }
main[data-view="ayuda"] > .card { margin-bottom: var(--gap); scroll-margin-top: 1rem; }
.ayuda-terms { display: grid; margin: 0; }
.ayuda-term { display: grid; grid-template-columns: minmax(9rem, 14rem) minmax(0, 1fr); gap: .25rem 1rem; align-items: baseline; padding: .7rem 0; border-bottom: 1px solid #ffffff0a; scroll-margin-top: 1rem; }
.ayuda-term:last-child { border-bottom: 0; }
.ayuda-term dt { margin: 0; }
.ayuda-term dd { margin: 0; color: var(--muted); font-size: .9rem; }
.ayuda-go { white-space: nowrap; }
/* A #section a link just brought into view (#721): a short outline, then nothing. */
.jump-target { scroll-margin-top: 1rem; animation: jump-mark 1.6s ease-out; }
.jump-target:focus { outline: none; }
@keyframes jump-mark { 0%, 60% { outline: 2px solid var(--accent); outline-offset: 4px; } 100% { outline: 2px solid transparent; outline-offset: 4px; } }
@media (prefers-reduced-motion: reduce) { .jump-target { animation: none; } }
@media (max-width: 640px) { .ayuda-term { grid-template-columns: minmax(0, 1fr); } }
.help-link[aria-current="page"] { color: var(--accent); background: var(--raised); }
.umbral-area { margin: 1.5rem 0 .25rem; scroll-margin-top: 1rem; } .umbral-area:first-child { margin-top: 0; }
/* Inside a heading or a tile's label (#721): after the last word, on that word's line, centred on it; it never makes the line taller. */
.help-tail { white-space: nowrap; }
.help-tail > .help { margin: -4px 0 -4px .45rem; vertical-align: middle; white-space: normal; }
h2 .help-tail > .help { position: relative; top: -.1em; }

/* ---------- Referencias (#720) ---------- */
.ref-target { display: grid; gap: .15rem; min-width: 0; }
.ref-key { overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; }
.ref-fold > summary { cursor: pointer; white-space: nowrap; }
.ref-fold[open] > summary { margin-bottom: .5rem; }
.ref-list { display: grid; gap: .6rem; margin: 0; padding: 0; list-style: none; }
.ref-head { margin: 0; }
.ref-context { margin: .15rem 0 0; color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.ref-dialog { width: min(46rem, calc(100vw - 2rem)); }
.ref-from code { overflow-wrap: anywhere; }
.ref-entries { display: grid; gap: .3rem; max-height: 14rem; overflow: auto; margin: 0 0 1rem; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: var(--radius); }
.ref-preview { display: grid; gap: .75rem; max-height: 40vh; overflow: auto; margin: 0 0 1rem; }
.ref-preview:empty { display: none; }
.ref-change { padding: .6rem .8rem; border: 1px solid var(--line); border-radius: var(--radius); }
.ref-before, .ref-after { margin: .3rem 0 0; padding: .25rem .5rem; border-radius: var(--radius-sm); font-size: .82rem; overflow-wrap: anywhere; }
.ref-before { background: #e07a7014; color: var(--muted); text-decoration: line-through; text-decoration-color: #e07a7088; }
.ref-after { background: #6fb98a14; }
.checkbox-line { display: flex; align-items: center; gap: .5rem; margin: 0; font-weight: 400; }

/* ---------- Propuestas (#727) ---------- */
.badge[data-status="propuesta-pendiente"], .badge[data-status="propuesta-ejecutando"] { color: #ffd083; background: #302415; border-color: #69502b; }
.badge[data-status="propuesta-aprobada"] { color: #b8dac3; background: #17231c; border-color: #35513f; }
.badge[data-status="propuesta-fallida"], .badge[data-status="propuesta-obsoleta"] { color: #ffc0b8; background: #301c1a; border-color: #67413c; }
.badge[data-status="propuesta-rechazada"], .badge[data-status="propuesta-retirada"], .badge[data-status="propuesta-caducada"] { color: var(--muted); }
.propuesta-codigo { display: inline-block; padding: 0 .4rem; border: 1px solid #fca31160; border-radius: 999px; color: var(--accent); font-size: .72rem; font-weight: 600; white-space: nowrap; }
@media (max-width: 900px) { .propuesta-table .inbox-who { min-width: 0; } }
.propuesta-banner { margin: 0 0 var(--gap); }
.propuesta-motivo { margin: 0 0 var(--gap); overflow-wrap: anywhere; white-space: pre-wrap; }
/* The agent's words: apart from the admin's own, dashed, never mistaken for what the cards say will run. */
.propuesta-voz { margin: 0 0 var(--gap); padding: 1rem 1.25rem; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: #ffffff05; }
.propuesta-voz-title { margin: 0; font-weight: 700; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.propuesta-voz-note { margin: .25rem 0 .75rem; color: #ffc98a; font-size: .85rem; }
.propuesta-voz-text { margin: 0; padding: .75rem 1rem; border-left: 3px solid var(--line-strong); background: var(--bg); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 24rem; overflow: auto; font-style: italic; }
.propuesta-acciones { margin-bottom: var(--gap); }
.propuesta-accion .card-head h2 { overflow-wrap: anywhere; }
.propuesta-aviso { padding: .6rem .8rem; border: 1px solid #69502b; border-radius: var(--radius-sm); background: #302415; color: #ffd083; }
.propuesta-codigo-line { color: var(--accent); font-size: .85rem; }
.propuesta-accion .facts dd { overflow-wrap: anywhere; min-width: 0; white-space: pre-wrap; }
.propuesta-imagen { margin: 0 0 1rem; }
.propuesta-imagen img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: repeating-conic-gradient(#222 0% 25%, #1a1a1a 0% 50%) 0 0 / 16px 16px; }
.propuesta-imagen figcaption { margin-top: .35rem; }
.propuesta-vista { margin: 0 0 1rem; }
.propuesta-frame { height: 70vh; min-height: 420px; max-width: 640px; margin: 0 0 .5rem; }
.propuesta-personas-total { font-weight: 600; margin-bottom: .25rem; }
.propuesta-personas-lista { max-height: 18rem; overflow: auto; margin: .5rem 0; padding: .25rem 0; list-style: none; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.propuesta-personas-lista li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; padding: .35rem .75rem; border-top: 1px solid #ffffff0a; overflow-wrap: anywhere; }
.propuesta-personas-lista li:first-child { border-top: 0; }
.propuesta-tecnica { margin: .5rem 0 0; font-size: .8rem; }
.propuesta-resultado { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: .75rem 0 0; overflow-wrap: anywhere; }
.propuesta-decision .toolbar { flex-wrap: wrap; }
.propuesta-rechazo { margin-top: 1rem; }
.propuesta-retirar-note { margin-top: 1rem; }
/* #1000: a proposal's steps as sections by thing, its run's summary, the one images warning (#995) and the process manager. */
.propuesta-acciones { display: grid; gap: .5rem; }
.propuesta-plegar { justify-content: flex-end; margin: 0; }
.propuesta-paso { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel, #ffffff05); }
.propuesta-paso[data-estado="fallida"] { border-color: #67413c; }
.propuesta-paso[data-estado="en_curso"] { border-color: #69502b; }
.propuesta-paso > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .6rem; padding: .7rem 1rem; cursor: pointer; list-style: none; }
.propuesta-paso > summary::-webkit-details-marker { display: none; }
.propuesta-paso > summary::before { content: "▸"; color: var(--muted); transition: transform .15s; }
.propuesta-paso[open] > summary::before { transform: rotate(90deg); }
.propuesta-paso-estado { display: inline-flex; width: 1.1rem; justify-content: center; }
.propuesta-paso-mark { font-weight: 700; }
.propuesta-paso[data-estado="hecha"] .propuesta-paso-mark { color: #8fd1a5; }
.propuesta-paso[data-estado="fallida"] .propuesta-paso-mark { color: #ff9d90; }
.propuesta-paso[data-estado="en_curso"] .propuesta-paso-estado { color: var(--accent); }
.propuesta-paso-num { font-size: .8rem; white-space: nowrap; }
.propuesta-paso-titulo { flex: 1 1 16rem; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.propuesta-paso-meta { white-space: nowrap; }
.propuesta-paso > .propuesta-accion { padding: 0 1rem 1rem; }
.propuesta-paso > .propuesta-accion + .propuesta-accion { padding-top: 1rem; border-top: 1px solid #ffffff0a; }
.propuesta-accion .facts dd { overflow-wrap: anywhere; min-width: 0; white-space: pre-wrap; }
.propuesta-accion-titulo { margin: .25rem 0 .5rem; font-size: .95rem; overflow-wrap: anywhere; }
.propuesta-borrador-line { color: var(--muted); font-size: .85rem; }
.propuesta-imagen img { max-height: 22rem; }
.propuesta-imagen figcaption { overflow-wrap: anywhere; }
.propuesta-que-hacer { flex-basis: 100%; margin: .25rem 0 0; color: var(--muted); }
.propuesta-resumen { margin: 0 0 var(--gap); padding: .9rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius); }
.propuesta-resumen[data-estado="fallida"] { border-color: #67413c; }
.propuesta-resumen-text { margin: 0 0 .5rem; font-weight: 600; overflow-wrap: anywhere; }
.propuesta-resumen progress, .propuesta-proceso progress { width: 100%; height: .5rem; accent-color: var(--accent); }
.propuesta-imagenes-aviso { border-color: #fca311; }
.propuesta-imagenes-titulo { font-size: 1.1rem; font-weight: 700; color: #ffd083; }
.propuesta-imagenes-tira { display: flex; flex-wrap: wrap; gap: .4rem; max-height: 16rem; overflow: auto; margin-top: .5rem; }
.propuesta-imagenes-tira img { width: 72px; height: 72px; object-fit: cover; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.propuestas-en-marcha { margin-bottom: var(--gap); }
.propuestas-procesos { display: grid; gap: .6rem; margin: .5rem 0 0; padding: 0; list-style: none; }
.propuesta-proceso { display: grid; gap: .3rem; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.propuesta-proceso[data-estado="fallida"] { border-color: #67413c; }
.propuesta-proceso-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .6rem; }
.propuesta-proceso-titulo { flex: 1 1 14rem; min-width: 0; overflow-wrap: anywhere; }

/* ---------- The tabs shell (#708): the installed app in a wide window ----------
   The bar stands over #main in the page's column, sticky at the top; the
   sidebar takes both rows. Every other window has no bar (data-shell="crumbs"). */
.tab-bar { display: none; }
:root[data-shell="tabs"] { --shell-top: 42px; scroll-padding-top: calc(var(--shell-top) + .5rem); }
:root[data-shell="tabs"] body:not(.signed-out) { grid-template-rows: auto minmax(0, 1fr); }
:root[data-shell="tabs"] body:not(.signed-out) > .sidebar { grid-row: 1 / span 2; }
:root[data-shell="tabs"] body:not(.signed-out) > .tab-bar { position: sticky; top: 0; z-index: 25; display: flex; grid-column: -2 / -1; grid-row: 1; min-width: 0; height: var(--shell-top); border-bottom: 1px solid var(--line); background: var(--surface); }
:root[data-shell="tabs"] body:not(.signed-out) > main { grid-column: -2 / -1; grid-row: 2; padding-top: 2rem; }
/* The sidebar hidden (#510): its «Menú» button sits at the bar's start. */
:root[data-shell="tabs"] body.nav-hidden > .tab-bar { padding-left: 6.25rem; }
:root[data-shell="tabs"] body.nav-hidden .nav-show { top: 3px; left: .5rem; }
:root[data-shell="tabs"] body.nav-hidden > main { padding-top: 2rem; }
/* T1: no crumb to a list (the bar has it); a sub-screen keeps the path inside its tab. */
:root[data-shell="tabs"] .breadcrumbs[data-entries-only], :root[data-shell="tabs"] .breadcrumbs li[data-entry] { display: none; }
:root[data-shell="tabs"] .breadcrumbs li[data-path-start]::before { content: none; }
:root[data-shell="tabs"] :is([id^="regla-"], .jump-target, .umbral-area, main[data-view="ayuda"] > .card) { scroll-margin-top: calc(var(--shell-top) + 1rem); }
/* The strip never wraps: it scrolls sideways, its edges fade where there is more. */
.tab-strip { display: flex; flex: 1; min-width: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; overscroll-behavior-x: contain; }
.tab-strip::-webkit-scrollbar { display: none; }
/* The left fade starts after the pinned tabs, which never scroll. */
.tab-strip { --pins: 0px; }
.tab-strip[data-fade="l"] { mask-image: linear-gradient(90deg, #000 var(--pins), transparent var(--pins), #000 calc(var(--pins) + 48px)); }
.tab-strip[data-fade="r"] { mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent); }
.tab-strip[data-fade="lr"] { mask-image: linear-gradient(90deg, #000 var(--pins), transparent var(--pins), #000 calc(var(--pins) + 48px), #000 calc(100% - 48px), transparent); }
.tab { position: relative; display: flex; flex: 0 0 auto; align-items: center; min-width: 7.5rem; max-width: 15.5rem; height: 100%; border-right: 1px solid var(--line); color: var(--muted); user-select: none; }
.tab:hover { background: var(--raised); color: var(--ink); }
.tab-link { display: flex; flex: 1; align-items: center; gap: .5rem; min-width: 0; height: 100%; padding: 0 .3rem 0 .8rem; color: inherit; font-size: .82rem; font-weight: 500; line-height: 1.2; text-decoration: none; }
.tab-link .icon { width: 15px; height: 15px; opacity: .75; }
.tab-link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tab-title { min-width: 0; max-width: 24ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The active tab is cut from the page under it: same ground, the accent on top. */
.tab:has(> [aria-current]) { background: var(--bg); color: var(--ink); }
.tab:has(> [aria-current])::before { content: ''; position: absolute; inset: 0 0 auto; height: 2px; background: var(--accent); }
.tab:has(> [aria-current])::after { content: ''; position: absolute; inset: auto 0 -1px; height: 1px; background: var(--bg); }
.tab:has(> [aria-current]) .tab-link .icon { color: var(--accent); opacity: 1; }
.tab-close { display: grid; flex: 0 0 auto; place-items: center; width: 24px; height: 24px; min-height: 0; margin: 0 .35rem 0 0; padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); font-size: .9rem; line-height: 1; }
.tab-close .icon { width: 13px; height: 13px; }
.tab-close:hover { border: 0; background: var(--line); color: var(--ink); }
.tab-close:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* «×» on the active tab and under the pointer; elsewhere its place is kept, so tabs do not jump. */
.tab:not(:hover, :focus-within, :has(> [aria-current])) .tab-close .icon { visibility: hidden; }
/* The mark stands in the «×»'s place; «×» again under the pointer. */
.tab-mark { display: block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.tab[data-mark="amber"] .tab-mark, .tab-mark[data-mark="amber"] { background: var(--accent); }
.tab[data-mark="red"] .tab-mark, .tab-mark[data-mark="red"] { width: auto; height: auto; background: none; color: var(--danger); font-size: .85rem; font-weight: 700; line-height: 1; }
.tab-mark[data-mark="none"] { display: none; }
/* #861: a task started in the tab is at it. */
.tab[data-mark="working"] .tab-mark, .tab-mark[data-mark="working"] { width: 10px; height: 10px; background: none; border: 2px solid var(--accent); border-right-color: transparent; animation: spin .9s linear infinite; }
@media (prefers-reduced-motion: reduce) { .tab[data-mark="working"] .tab-mark, .tab-mark[data-mark="working"] { animation: none; border-right-color: var(--accent); } }
.tab[data-mark="none"] .tab-close .tab-mark, .tab:not([data-mark="none"]) .tab-close .icon { display: none; }
.tab:not([data-mark="none"]):is(:hover, :focus-within) .tab-close .tab-mark { display: none; }
.tab:not([data-mark="none"]):is(:hover, :focus-within) .tab-close .icon { display: block; visibility: visible; }
/* Pinned: the icon alone, first, and never closed in bulk. */
.tab[data-pinned] { position: sticky; z-index: 1; width: 46px; min-width: 0; max-width: none; background: var(--surface); }
.tab[data-pinned]:hover { background: var(--raised); }
.tab[data-pinned]:has(> [aria-current]) { background: var(--bg); }
.tab[data-pinned] .tab-link { justify-content: center; padding: 0; }
.tab-pin-mark { position: absolute; top: 8px; right: 7px; width: 6px; height: 6px; }
.tab[data-mark="red"] > .tab-pin-mark { top: 5px; font-size: .7rem; }
.tab.dragging { opacity: .45; }
.tab[data-drop-before] { box-shadow: inset 2px 0 var(--accent); }
.tab[data-drop-after] { box-shadow: inset -2px 0 var(--accent); }
.tab-all { display: grid; flex: 0 0 auto; place-items: center; width: 42px; height: 100%; min-height: 0; padding: 0; border: 0; border-left: 1px solid var(--line); border-radius: 0; background: var(--surface); color: var(--muted); }
.tab-all:hover, .tab-all[aria-expanded="true"] { border-color: var(--line); background: var(--raised); color: var(--ink); }
.tab-all .icon { width: 16px; height: 16px; transform: rotate(90deg); }
.tab-all:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* «⌄»: every tab by entry, with a field to find one. */
.tab-overview { position: fixed; inset: auto; width: min(24rem, calc(100vw - 1rem)); max-height: min(75dvh, 34rem); margin: 0; padding: .5rem; overflow-y: auto; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); box-shadow: 0 18px 48px #000c; color: var(--ink); }
.tab-overview .tab-find { margin: 0 0 .35rem; min-height: 38px; padding: .45rem .7rem; font-size: .85rem; }
.tab-group-title { display: flex; align-items: center; gap: .45rem; margin: .6rem .5rem .2rem; color: var(--muted); font-size: .66rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.tab-group-title .icon { width: 13px; height: 13px; }
.tab-groups ul { margin: 0; padding: 0; list-style: none; }
.tab-overview-item { display: flex; align-items: center; justify-content: space-between; gap: .75rem; width: 100%; min-height: 34px; padding: .35rem .6rem; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink); font-size: .85rem; font-weight: 500; text-align: left; }
.tab-overview-item:is(:hover, :focus-visible) { border: 0; background: var(--raised); outline: none; }
.tab-overview-item[aria-current] { background: #fca31114; color: var(--accent); }
.tab-overview-item .tab-title { flex: 1; max-width: none; }
.tab-overview-closed { justify-content: flex-start; color: var(--muted); }
.tab-overview-closed .icon { width: 14px; height: 14px; }
.tab-overview-empty { margin: .5rem; }
.tab-menu .row-menu-item > button { white-space: normal; }
/* The closing question lists what it would close. */
.tab-close-list { display: grid; gap: .4rem; margin: 0 0 1rem; padding: 0; list-style: none; }
.tab-close-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; overflow-wrap: anywhere; }
/* #741 (D6): a plan's draft step and a step checked when it runs. */
.propuesta-borrador { margin-left: .25rem; vertical-align: middle; font-size: .72rem; }
.propuesta-diferida { padding: .5rem .8rem; border-left: 3px solid var(--line-strong); color: var(--muted); font-size: .9rem; }
/* #741 (D4): Agentes, a tool's errors as a short list in its cell. */
.agentes-errores { margin: .25rem 0 0; padding: 0; list-style: none; font-size: .85rem; }
.agentes-errores li + li { margin-top: .2rem; }
.agentes-errores li { overflow-wrap: anywhere; }
.agentes-table td { white-space: nowrap; }
.agentes-table td:first-child, .agentes-table td:last-child { white-space: normal; }
.agentes-table td:first-child code { overflow-wrap: anywhere; }
@media (max-width: 640px) { .agentes-table td { white-space: normal; } }

/* ---------- #802: the event's cycle ---------- */
/* [802:A] styles (#801 Calendario) */
/* Calendario (#801). One meaning, one colour, everywhere: verde / ámbar / rojo is the day's risk (a
   thin top border and a soft fill), the rombo its opportunity; a chip's dot is the entry's effect
   (red against, green for); «sin revisar» is hatched; «descartada» and «caducada» are struck and muted. */
.calendario-barra { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem 1.5rem; margin: 0 0 1rem; }
.calendario-barra > label { flex: 1 1 16rem; max-width: 24rem; margin: 0; }
.calendario-mes-nav { display: flex; align-items: center; gap: .35rem; }
.calendario-mes-nav button { min-height: 44px; min-width: 44px; padding: .4rem .7rem; }
.calendario-mes-nav button.small { min-height: 36px; }
.calendario-mes { min-width: 11rem; text-align: center; font: 400 1.35rem/1.1 var(--serif); }
.calendario-cadena { flex: 1 1 100%; margin: 0; font-size: .85rem; }
.calendario-grid { display: grid; gap: .35rem; margin: 1rem 0 0; }
.calendario-grid-cabeza, .calendario-semana { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .35rem; }
.calendario-grid-cabeza > div { padding: 0 .5rem .25rem; color: var(--muted); font-size: .68rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.calendario-celda { position: relative; min-height: 112px; padding: .4rem .5rem .5rem; border: 1px solid var(--line); border-top: 3px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
.calendario-celda:hover { border-color: var(--line-strong); background: var(--raised); }
.calendario-celda:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.calendario-celda[aria-pressed="true"] { background: var(--raised); box-shadow: inset 0 0 0 1px var(--accent); }
.calendario-celda[data-fuera] { opacity: .35; cursor: default; background: var(--bg); border-top-color: var(--line); }
.calendario-celda[data-color="verde"] { border-top-color: #4f9d69; background: linear-gradient(180deg, #16261b 0, var(--surface) 42%); }
.calendario-celda[data-color="ambar"] { border-top-color: var(--accent); background: linear-gradient(180deg, #2b2110 0, var(--surface) 42%); }
.calendario-celda[data-color="rojo"] { border-top-color: #e4382b; background: linear-gradient(180deg, #33171a 0, var(--surface) 42%); }
.calendario-celda-cabeza { display: flex; align-items: center; justify-content: space-between; gap: .35rem; margin: 0 0 .3rem; }
.calendario-num { font-variant-numeric: tabular-nums; font-size: .9rem; font-weight: 600; color: var(--muted); }
.calendario-celda[data-hoy] .calendario-num { display: inline-flex; align-items: center; justify-content: center; min-width: 1.6rem; height: 1.6rem; padding: 0 .35rem; border-radius: 999px; background: var(--accent); color: var(--bg); }
.calendario-op { display: inline-flex; align-items: center; gap: .2rem; padding: .05rem .4rem; border: 1px solid #35513f; border-radius: 999px; background: #17231c; color: #b8dac3; font-size: .68rem; font-weight: 600; white-space: nowrap; }
.calendario-op[data-op="3"] { background: #1f3a29; border-color: #4f9d69; }
.calendario-op > i { display: inline-block; width: .45rem; height: .45rem; transform: rotate(45deg); background: currentColor; }
.calendario-chips { margin: 0; padding: 0; list-style: none; display: grid; gap: .2rem; }
.calendario-chip { display: flex; align-items: center; gap: .35rem; min-width: 0; padding: .12rem .4rem; border-radius: 3px; background: #ffffff0a; font-size: .74rem; line-height: 1.35; }
.calendario-chip > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendario-chip > i { flex: none; width: .5rem; height: .5rem; border-radius: 50%; background: var(--line-strong); }
.calendario-chip[data-efecto="contra"] > i { background: #e4382b; }
.calendario-chip[data-efecto="a_favor"] > i { background: #4f9d69; }
.calendario-chip[data-estado="sin_revisar"] { background: repeating-linear-gradient(135deg, #ffffff0e 0 4px, #ffffff03 4px 8px); }
.calendario-chip[data-estado="descartada"], .calendario-chip[data-caducada] { color: var(--muted); text-decoration: line-through; }
.calendario-chip[data-estado="descartada"] > i, .calendario-chip[data-caducada] > i { background: var(--line); }
.calendario-chip-nuestro { font-weight: 600; background: #fca31114; }
.calendario-chip-nuestro > i { width: .55rem; height: .55rem; border-radius: 2px; background: var(--accent); }
.calendario-mas { padding: 0 .4rem; color: var(--muted); font-size: .72rem; }
.calendario-dia-host:empty { display: none; }
.calendario-dia { margin: 1rem 0 0; }
.calendario-dia h3 { margin: 1rem 0 .4rem; color: var(--muted); font-size: .68rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.calendario-dia-lista { margin: 0; padding: 0; list-style: none; display: grid; gap: .5rem; }
.calendario-dia-lista li { padding: .5rem .75rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); }
.calendario-dia-lista li small { display: block; }
.calendario-dia-lista li[data-estado="sin_revisar"] { background: repeating-linear-gradient(135deg, #ffffff08 0 5px, transparent 5px 10px), var(--bg); }
.calendario-dia-lista li[data-estado="descartada"] > a, .calendario-dia-lista li[data-caducada] > a { color: var(--muted); text-decoration: line-through; }
.calendario-lectura { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; }
.calendario-punto { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; background: var(--line-strong); }
.calendario-punto[data-color="verde"] { background: #4f9d69; }
.calendario-punto[data-color="ambar"] { background: var(--accent); }
.calendario-punto[data-color="rojo"] { background: #e4382b; }
.badge.calendario-efecto[data-efecto="contra"] { color: #ffc0b8; background: #301c1a; border-color: #67413c; }
.badge.calendario-efecto[data-efecto="a_favor"] { color: #b8dac3; background: #17231c; border-color: #35513f; }
.badge[data-status="cal-sin_revisar"] { color: #ffd083; background: repeating-linear-gradient(135deg, #3a2c15 0 4px, #302415 4px 8px); border-color: #69502b; }
.badge[data-status="cal-confirmada"], .badge[data-status="cal-run-cerrada"] { color: #b8dac3; background: #17231c; border-color: #35513f; }
.badge[data-status="cal-descartada"], .badge[data-status="cal-run-sin_cerrar"] { color: var(--muted); }
.badge[data-status="cal-run-abierta"] { color: #ffd083; background: #302415; border-color: #69502b; }
.calendario-fuente { align-self: center; }
/* The list: the phone's view of the month, one row per entry grouped by day. */
.calendario-lista { display: grid; gap: 1rem; margin: 1rem 0 0; }
.calendario-lista-dia { padding: .75rem 1rem; border: 1px solid var(--line); border-left: 3px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.calendario-lista-dia[data-color="verde"] { border-left-color: #4f9d69; }
.calendario-lista-dia[data-color="ambar"] { border-left-color: var(--accent); }
.calendario-lista-dia[data-color="rojo"] { border-left-color: #e4382b; }
.calendario-lista-dia h3 { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0 0 .5rem; font-size: .95rem; }
.calendario-lista-dia h3 .calendario-lectura { font-weight: 400; font-size: .85rem; color: var(--muted); }
.calendario-lista-dia ul { margin: 0; padding: 0; list-style: none; display: grid; gap: .4rem; }
.calendario-lista-fila { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; padding: .35rem 0; border-top: 1px solid #ffffff0a; }
.calendario-lista-fila small { flex: 1 1 100%; }
.calendario-lista-fila[data-estado="descartada"] > a, .calendario-lista-fila[data-caducada] > a { color: var(--muted); text-decoration: line-through; }
.calendario-lista-fila[data-kind] > a { font-weight: 600; }
@media (min-width: 641px) { .calendario-lista { display: none; } }
@media (max-width: 640px) { .calendario-grid { display: none; } .calendario-mes { min-width: 0; flex: 1; } .calendario-barra > label { max-width: none; } }
/* Planificar: the month as a strip of days, the ask to paste, the ranking. */
.calendario-tira { display: flex; flex-wrap: wrap; gap: .3rem; margin: 0 0 .75rem; padding: 0; list-style: none; }
.calendario-tira li { position: relative; width: 2.4rem; height: 2.6rem; border: 1px solid var(--line); border-top: 3px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); }
.calendario-tira li[data-finde] { background: var(--bg); }
.calendario-tira li[data-color="verde"] { border-top-color: #4f9d69; background: #16261b; }
.calendario-tira li[data-color="ambar"] { border-top-color: var(--accent); background: #2b2110; }
.calendario-tira li[data-color="rojo"] { border-top-color: #e4382b; background: #33171a; }
.calendario-tira li[data-hoy] { box-shadow: inset 0 0 0 1px var(--accent); }
.calendario-tira li a { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--ink); font-size: .8rem; font-variant-numeric: tabular-nums; text-decoration: none; }
.calendario-tira li a:hover { color: var(--accent); }
.calendario-tira li i { position: absolute; right: .2rem; bottom: .2rem; width: .45rem; height: .45rem; transform: rotate(45deg); background: #b8dac3; }
.calendario-tira li i[data-op="3"] { background: #4f9d69; width: .55rem; height: .55rem; }
.calendario-peticion { min-height: 5.5rem; font-size: .9rem; }
.calendario-puntuacion { font-variant-numeric: tabular-nums; font-weight: 600; }
.calendario-puntuacion[data-sign="up"] { color: #b8dac3; }
.calendario-puntuacion[data-sign="down"] { color: #ffc0b8; }
.calendario-nunca { color: #ffc0b8; font-weight: 600; }
.calendario-resumen { white-space: pre-wrap; }
.calendario-historial { margin: 0; padding: 0 0 0 1.1rem; display: grid; gap: .35rem; font-size: .9rem; }
.calendario-form-mundo[hidden], .calendario-form-plan[hidden] { display: none; }
/* Ámbitos: the tree. */
.calendario-arbol, .calendario-arbol ul { margin: 0; padding: 0; list-style: none; }
.calendario-arbol ul { margin: .25rem 0 0 .9rem; padding-left: .9rem; border-left: 1px solid var(--line); }
.calendario-arbol li { margin: 0 0 .35rem; }
.calendario-arbol-fila { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .75rem; }
.calendario-arbol-fila .toolbar { margin: 0; }
.calendario-arbol li[data-archivado] > .calendario-arbol-fila > a { color: var(--muted); text-decoration: line-through; }
.calendario-arbol li[data-tipo="pais"] > .calendario-arbol-fila > a, .calendario-arbol li[data-tipo="global"] > .calendario-arbol-fila > a { font-weight: 600; }
.calendario-ambito-select option { font-family: var(--sans); }
/* The calendar's sources (#816): a lectura beside «Mejores días», its windows; a proposal beside the current effect
   (dashed: not yet a value); the foco on Ámbitos; the harvest prompt folded. */
.calendario-par { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.calendario-par > .card { margin: 0; min-width: 0; }
@media (max-width: 1500px) { .calendario-par { grid-template-columns: minmax(0, 1fr); } }
.calendario-lectura-autor { margin: -.25rem 0 .5rem; font-size: .85rem; }
.calendario-lectura-resumen { white-space: pre-line; font-size: 1rem; line-height: 1.55; }
.calendario-lectura-h { margin: 1rem 0 .4rem; color: var(--muted); font-size: .68rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.calendario-lectura-lista { margin: 0; padding: 0; list-style: none; display: grid; gap: .4rem; font-size: .9rem; }
.calendario-lectura-lista li { padding: .4rem .6rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); }
.calendario-ventana { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .2rem .75rem; align-items: center; border-left: 3px solid #4f9d69 !important; }
.calendario-ventana strong { white-space: nowrap; }
@media (max-width: 640px) { .calendario-ventana { grid-template-columns: minmax(0, 1fr); } .calendario-ventana .button { justify-self: start; } }
.calendario-propuestas-aviso { margin: 1rem 0 0; padding: .5rem .75rem; border: 1px dashed #69502b; border-radius: var(--radius-sm); color: #ffd083; font-size: .9rem; }
.calendario-efecto-celda { display: grid; gap: .3rem; justify-items: start; }
.calendario-efecto-celda .toolbar { margin: 0; }
.calendario-propuesto { padding: .05rem .45rem; border: 1px dashed #69502b; border-radius: 999px; color: #ffd083; white-space: nowrap; }
.calendario-propuesta-par { display: flex; flex-wrap: wrap; align-items: end; gap: .5rem 1rem; }
.calendario-propuesta-par > div { display: grid; gap: .25rem; }
.calendario-propuesta-par > div:last-child .badge { outline: 1px dashed #ffd083; outline-offset: 2px; }
.calendario-propuesta-porque { margin: .75rem 0 0; font-style: italic; }
.calendario-feed-nota { font-size: .85rem; }
.badge.calendario-foco { color: #ffd083; background: #302415; border-color: #69502b; }
.badge.calendario-foco[data-foco="trimestral"] { color: var(--ink); background: var(--raised); border-color: var(--line-strong); }
.calendario-foco-select { min-height: 32px; width: auto; min-width: 8.5rem; padding: .1rem 2rem .1rem .55rem; font-size: .8rem; background-position: right .5rem center; }
.calendario-foco-select[data-foco="mensual"] { border-color: #69502b; color: #ffd083; }
.calendario-peticion-fold { margin: .5rem 0 0; }
.calendario-peticion-fold textarea { width: 100%; font-family: var(--mono, ui-monospace, monospace); font-size: .8rem; }

/* [802:B] styles (#803, #804) */
/* The hub's blocks (#803): the series column, the web's checklist, the campaign's event line. */
.evento-serie { font-family: var(--mono, ui-monospace, monospace); font-size: .85rem; }
/* #874: an event's Resumen: the Luma image beside its facts (under them on a phone); the description keeps its line breaks. */
.evento-resumen { display: grid; gap: 1rem; }
@media (min-width: 760px) { .evento-resumen:has(.evento-imagen) { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: start; } }
.evento-imagen { width: 100%; height: auto; border-radius: var(--radius, 8px); display: block; }
.evento-descripcion { white-space: pre-line; margin: 0; max-width: 72ch; }
.evento-checklist { display: grid; gap: .35rem; margin: 0 0 .5rem; padding: 0; list-style: none; font-size: .9rem; }
.evento-checklist li { display: flex; align-items: center; gap: .5rem; }
.evento-checklist li[data-ok="1"] { color: var(--muted); }
.promo-evento { margin: 0 0 1rem; }
/* The curve (#804): this edition in the accent over the previous one in grey, the target dashed, today dotted. */
.evento-ritmo { margin: 0 0 1rem; font-size: 1.05rem; line-height: 1.5; }
.evento-curva { margin: 0 0 1rem; }
.evento-curva svg { display: block; width: 100%; height: auto; max-height: 320px; overflow: visible; }
.evento-curva .curva-grid line { stroke: #ffffff12; stroke-width: 1; }
.evento-curva .curva-axis text { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.evento-curva .curva-label { fill: var(--ink); font-size: 12px; font-variant-numeric: tabular-nums; }
.evento-curva path.curva-actual { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.evento-curva path.curva-anterior { fill: none; stroke: var(--line-strong); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.evento-curva circle.curva-actual { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.evento-curva circle.curva-anterior { fill: var(--surface); stroke: var(--line-strong); stroke-width: 2; }
.evento-curva circle.curva-punto:hover { r: 6; }
.evento-curva .curva-objetivo { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 6 4; opacity: .6; }
.evento-curva .curva-hoy { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 4; }
.evento-objetivo-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem 1rem; }
.evento-objetivo-form label { flex: 1 1 12rem; }
.evento-objetivo-form input { width: 100%; }

/* [802:C] styles (#805, #807) */
/* Gasto (#805): the inline form over the rows, its fields in a grid that collapses on a phone. */
.gasto-form { margin: 0 0 1rem; padding: 1rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--bg); }
.gasto-form-title { margin: 0 0 .75rem; font-weight: 600; }
.gasto-form-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: .5rem 1rem; }
.gasto-form-fields > label { margin: 0; }
.gasto-form .toolbar { margin: .75rem 0 0; }
/* Canales (#807): the sentence, the bars inside the cells, the figures with their delta. */
.canales-sentence { margin: 0 0 1rem; font-family: "Instrument Serif", Georgia, serif; font-size: 1.35rem; line-height: 1.35; max-width: 60rem; }
.canales-events { margin: 0 0 1rem; }
.canales-events a { color: var(--ink); }
/* The whole table shows (the totals row is its last line), a little tighter than a list. */
.canales-table { max-height: none; }
.canales-table th, .canales-table td { padding: .6rem .6rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.canales-table td { font-size: .85rem; }
.canales-table td:first-child { white-space: normal; }
.canales-figure { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; }
.canales-cell-bar { display: inline-grid; grid-template-columns: 4rem auto; align-items: center; gap: .5rem; }
.canales-bar { position: relative; display: block; height: 10px; border-radius: 0 4px 4px 0; background: #ffffff0a; overflow: hidden; }
.canales-bar i { position: absolute; inset: 0 auto 0 0; display: block; border-radius: 0 4px 4px 0; background: var(--accent); }
.canales-bar[data-tone="cost"] i { background: var(--line-strong); }
.canales-bar-value { min-width: 3ch; text-align: right; }
.canales-figure-block { margin: 0 0 1rem; }
.canales-figure-block .chart-key { margin-top: .5rem; }
@media (max-width: 640px) {
  .canales-table td { white-space: normal; }
  .canales-sentence { font-size: 1.15rem; }
}

/* [802:D] styles (#808, #817) */
/* The pack an Informe was written from (#817): a fold under the brief, closed unless the address asks for it. */
.informe-paquete { margin-top: 1.5rem; max-width: 72ch; }
.informe-paquete > summary { cursor: pointer; font-weight: 600; }
.informe-paquete .informe-datos { margin-top: .5rem; }
/* The event's report on the hub and the lessons on Planificar: a numbered list, each line with its figure beside it. */
.informe-lecciones { margin: 0 0 1rem; padding-left: 1.4rem; display: grid; gap: .5rem; }
.informe-lecciones li { line-height: 1.5; }
.informe-lecciones .informe-cifra { display: block; margin-top: .1rem; }
.card .evento-informe-titular, .evento-informe-titular { margin: .75rem 0 1rem; font-family: "Instrument Serif", Georgia, serif; font-size: 1.25rem; line-height: 1.35; color: var(--ink); }
/* #868: an entity's onboarding wizard opened from a Persona's, in a dialog wide enough for its panels. */
.wizard-dialog { width: min(44rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); overflow: auto; }

/* ---------- Publicación and Infraestructura (#1107, #1108) ---------- */
/* The content team's five steps: a row on a wide screen, the timeline's column on a phone. */
.steps-flow { margin: 0 0 var(--gap); padding: 1.1rem 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
@media (min-width: 900px) {
  .steps-flow { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); column-gap: .75rem; }
  .steps-flow .step { grid-template-columns: minmax(0, 1fr); row-gap: .35rem; padding: 0; align-content: start; }
  .steps-flow .step-mark { grid-row: auto; }
  .steps-flow .step:not(:last-child)::after { left: 1.85rem; right: -.5rem; top: calc(.75rem - 1px); bottom: auto; width: auto; height: 2px; }
}
.publication-details { font-size: .9rem; }
.publication-details .timeline { margin: 0; }
/* A release's changelog as text (#1107 §4), never wider than its card. */
.changelog-view { max-width: 100%; overflow-wrap: anywhere; font-size: .9rem; }
.changelog-view .changelog-heading { margin: .75rem 0 .25rem; font-weight: 700; }
.changelog-view ul { margin: 0; padding-left: 1.2rem; }
.changelog-view li + li { margin-top: .2rem; }
.drill-findings { padding-left: 1.2rem; overflow-wrap: anywhere; }
.drill-shots-box summary { font-weight: 600; }
.drill-shots { display: flex; flex-wrap: wrap; gap: .5rem; }
.drill-shots img { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; }
/* Rows that wrap instead of wide tables: a title line, then what it says, then its actions on a row of their own. */
.row-list { list-style: none; margin: 0; padding: 0; display: grid; }
.row-item { display: grid; gap: .35rem; min-width: 0; padding: .7rem 0; border-top: 1px solid var(--line); }
.row-item:first-child { border-top: 0; padding-top: 0; }
.row-item > p { margin: 0; overflow-wrap: anywhere; }
.row-item > .toolbar { margin: .15rem 0 0; flex-wrap: wrap; justify-content: flex-start; }
.row-item[data-state="partial"] { padding-left: .75rem; border-left: 3px solid var(--danger); }
.row-line { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; min-width: 0; }
.row-line > * { min-width: 0; overflow-wrap: anywhere; }
.row-line code { font-size: .85rem; }
.row-line .badge { white-space: normal; text-align: left; }
.row-title { font-weight: 700; }
.row-meta { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.row-values { font-family: var(--mono, ui-monospace, monospace); font-size: .82rem; }
.infra-log { max-width: 100%; margin: 0; padding: .75rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); font-size: .78rem; white-space: pre-wrap; overflow-wrap: anywhere; }
/* A service's sections (#1108 D5): links that carry ?ver=, wrapping on a phone. */
.section-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 var(--gap); }
.section-tabs a { padding: .4rem .8rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .88rem; text-decoration: none; }
.section-tabs a[aria-current="page"] { border-color: var(--accent); color: var(--ink); font-weight: 600; }
.service-section > h3 { margin-top: 1.25rem; }
/* «Qué corre dónde» (#1108 D4): lines by tiers; on a phone each line is a block, each tier labelled. */
.where-matrix { width: 100%; table-layout: fixed; background: none; }
.where-matrix th[scope="row"] { width: 7.5rem; font-size: .9rem; letter-spacing: 0; text-transform: none; color: var(--ink); background: none; }
.where-matrix td, .where-matrix th { vertical-align: top; overflow-wrap: anywhere; }
.where-matrix tr:last-child th { border-bottom: 0; }
.where-cell { display: grid; gap: .2rem; font-variant-numeric: tabular-nums; }
.where-next { font-size: .82rem; }
.where-health { display: flex; flex-wrap: wrap; gap: .35rem; }
.health-dot { display: inline-flex; align-items: center; gap: .3rem; font-size: .82rem; color: var(--ink); text-decoration: none; }
.health-dot::before { content: ""; width: .6rem; height: .6rem; border-radius: 50%; background: var(--muted); }
.health-dot[data-status="published"]::before { background: #6fcf97; }
.health-dot[data-status="failed"]::before { background: var(--danger); }
.health-dot[data-status="scheduled"]::before { background: var(--accent); }
@media (max-width: 640px) {
  .where-matrix, .where-matrix tbody, .where-matrix tr, .where-matrix td, .where-matrix th[scope="row"] { display: block; width: 100%; }
  .where-matrix thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .where-matrix tr { padding: .5rem 0; border-bottom: 1px solid var(--line); }
  .where-matrix th[scope="row"] { padding: .25rem 0; border: 0; }
  .where-matrix td { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: .5rem; padding: .25rem 0; border: 0; }
  .where-matrix td::before { content: attr(data-label); color: var(--muted); font-size: .8rem; }
}
