/* Wixy Company · Diseño 3 (oscuro, crema y oro) · v0.7.3
   Tokens: tinta #16120c · panel #201a11 · línea #4b3f2a · crema #efe4cc · oro #c9a35a · musgo #7d9a45
   Rasgo propio: un campo de vóxeles en CSS que se desvanece detrás del contenido. */

:root, [data-theme="dark"] {
  --ink: #16120c;
  --panel: #201a11;
  --panel-2: #2a2216;
  --line: #4b3f2a;
  --text: #efe4cc;
  --muted: #b5a687;
  --gold: #c9a35a;
  --gold-strong: #e0bd73;
  --moss: #7d9a45;
  --danger: #d0705a;
  --on-gold: #1c160d;
  --vox-a: #2b2417;
  --vox-b: #352b1b;
  --vox-c: #3f5226;
}
[data-theme="light"] {
  --ink: #f6efdf;
  --panel: #fffaf0;
  --panel-2: #f1e6cf;
  --line: #d6c49d;
  --text: #221b10;
  --muted: #6b5c3f;
  --gold: #8f6a24;
  --gold-strong: #7a5918;
  --moss: #4f6b22;
  --danger: #a3402b;
  --on-gold: #fffaf0;
  --vox-a: #ece0c4;
  --vox-b: #e3d4b1;
  --vox-c: #cfdcb0;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
[data-theme="light"] { color-scheme: light; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 16px/1.6 "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
h1, h2, h3 { font-family: "Palatino Linotype", Palatino, "Book Antiqua", "Iowan Old Style", Georgia, serif; font-weight: 700; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.6vw, 3.6rem); letter-spacing: -.01em; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
a { color: var(--gold-strong); text-underline-offset: 3px; }
a:hover { color: var(--text); }
code, pre { font-family: Consolas, "Cascadia Mono", ui-monospace, monospace; font-size: .9em; }
:focus-visible { outline: 2px solid var(--gold-strong); outline-offset: 3px; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: .92rem; }
.fine { font-size: .84rem; color: var(--muted); }
.skip { position: absolute; left: -999px; top: 0; background: var(--gold); color: var(--on-gold); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }

/* Barra superior */
.top { display: flex; align-items: center; gap: 1.5rem; padding: .9rem clamp(1rem, 4vw, 3rem); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--text); }
.brand-word { font-family: "Palatino Linotype", Palatino, Georgia, serif; font-size: 1.3rem; font-weight: 700; line-height: 1; display: flex; flex-direction: column; }
.brand-word small { font-family: "Segoe UI", system-ui, sans-serif; font-weight: 400; font-size: .62rem; letter-spacing: .32em; color: var(--muted); margin-top: .2rem; }
.top nav ul { list-style: none; display: flex; gap: 1.4rem; margin: 0; padding: 0; }
.top nav a { color: var(--text); text-decoration: none; padding: .3rem 0; border-bottom: 2px solid transparent; }
.top nav a[aria-current="page"], .top nav a:hover { border-bottom-color: var(--gold); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.inline { display: inline; margin: 0; }
.icon-btn { background: none; border: 1px solid var(--line); color: var(--text); width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { border-color: var(--gold); }

/* Botones: la forma cambia con la jerarquía (primario con esquinas cortadas, secundario redondeado) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .65rem 1.25rem; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; border: 1px solid transparent; border-radius: 999px; }
.btn.primary { background: var(--gold); color: var(--on-gold); border-radius: 2px; clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
.btn.primary:hover { background: var(--gold-strong); color: var(--on-gold); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--gold); color: var(--text); }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Campo de vóxeles */
.voxels {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  --s: 34px;
  background:
    linear-gradient(var(--vox-c), var(--vox-c)) calc(var(--s) * 3) calc(var(--s) * 2) / var(--s) var(--s) no-repeat,
    linear-gradient(var(--vox-c), var(--vox-c)) calc(var(--s) * 9) calc(var(--s) * 5) / var(--s) var(--s) no-repeat,
    linear-gradient(var(--vox-b), var(--vox-b)) calc(var(--s) * 6) calc(var(--s) * 1) / calc(var(--s) * 2) var(--s) no-repeat,
    conic-gradient(var(--vox-a) 25%, transparent 0 50%, var(--vox-b) 0 75%, transparent 0) 0 0 / calc(var(--s) * 2) calc(var(--s) * 2),
    conic-gradient(transparent 25%, var(--vox-a) 0 50%, transparent 0) var(--s) 0 / calc(var(--s) * 3) calc(var(--s) * 3);
  -webkit-mask-image: linear-gradient(105deg, transparent 38%, #000 78%);
  mask-image: linear-gradient(105deg, transparent 38%, #000 78%);
  opacity: .9;
}

/* Portada */
.hero { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); align-items: center; gap: 2rem; padding: clamp(2.5rem, 7vw, 6rem) clamp(1rem, 4vw, 3rem); border-bottom: 1px solid var(--line); }
.hero-copy, .hero-logo { position: relative; z-index: 1; }
.hero h1 { max-width: 12ch; font-size: clamp(2.6rem, 6.4vw, 5.2rem); }
.lede { font-size: 1.15rem; max-width: 56ch; color: var(--text); }
.cta-row { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.6rem 0 1rem; }
.hero-logo { margin: 0; justify-self: center; }
.hero-logo img { width: min(100%, 420px); height: auto; border-radius: 6px; box-shadow: 0 0 0 1px var(--line), 0 30px 80px -30px #000; }

.band { padding: clamp(2rem, 5vw, 4rem) clamp(1rem, 4vw, 3rem); }
.band > h2 { max-width: 30ch; }
.ledger { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); border-top: 1px solid var(--line); margin-top: 1.4rem; }
.ledger > div { padding: 1.2rem 1.2rem 1.2rem 0; border-bottom: 1px solid var(--line); }
.ledger > div + div { padding-left: 1.2rem; border-left: 1px solid var(--line); }
.ledger > div:last-child h3 { color: var(--muted); }
.ledger p { color: var(--muted); max-width: 40ch; }

/* Texto largo */
.prose { max-width: 72ch; margin: 0 auto; padding: clamp(2rem, 5vw, 4rem) 1.2rem; }
.prose h2 { margin-top: 2rem; }
.modes dt { font-family: "Palatino Linotype", Palatino, Georgia, serif; font-weight: 700; font-size: 1.1rem; margin-top: 1rem; }
.modes dd { margin: .2rem 0 0; color: var(--muted); }
.steps { padding-left: 1.3rem; }
.steps li { margin-bottom: .4rem; }
.product { display: flex; gap: 1.2rem; align-items: flex-start; padding: 1.2rem 0; border-bottom: 1px solid var(--line); }
.product img { border-radius: 4px; flex: none; }
.about-logo { width: min(100%, 360px); height: auto; display: block; margin-bottom: 1rem; }
.draft { border-left: 3px solid var(--gold); padding: .4rem .9rem; color: var(--muted); background: var(--panel); }

/* Acceso */
.auth { position: relative; overflow: hidden; display: grid; place-items: center; padding: clamp(2rem, 6vw, 4rem) 1rem; min-height: 70vh; }
.auth .voxels { opacity: .5; -webkit-mask-image: radial-gradient(circle at 50% 50%, transparent 30%, #000 75%); mask-image: radial-gradient(circle at 50% 50%, transparent 30%, #000 75%); }
.auth-card { position: relative; z-index: 1; width: min(100%, 420px); background: var(--panel); border: 1px solid var(--line); padding: 2rem; text-align: left; }
.auth-card h1 { font-size: 1.7rem; text-align: center; }
.auth-logo { display: block; text-align: center; margin-bottom: .6rem; }
.auth-logo img { width: 150px; height: auto; }
.oauth { display: grid; gap: .5rem; }
.or { display: flex; align-items: center; gap: .8rem; color: var(--muted); font-size: .85rem; margin: 1rem 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.stack { display: grid; gap: .9rem; }
.field { display: grid; gap: .3rem; }
.field span { font-size: .92rem; color: var(--muted); }
input[type="text"], input[type="email"], input[type="password"], input[type="file"], select, textarea {
  font: inherit; color: var(--text); background: var(--ink); border: 1px solid var(--line); border-radius: 4px; padding: .6rem .7rem; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); }
.check { display: flex; gap: .5rem; align-items: flex-start; font-size: .92rem; }

/* Avisos */
.flash { margin: 1rem auto 0; max-width: 72ch; padding: .7rem 1rem; border: 1px solid var(--line); border-left-width: 4px; background: var(--panel); }
.flash-ok { border-left-color: var(--moss); }
.flash-error { border-left-color: var(--danger); }
.flash-info { border-left-color: var(--gold); }
.notice { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; justify-content: space-between; border: 1px solid var(--gold); padding: .7rem 1rem; margin-bottom: 1.2rem; }
.notice p { margin: 0; }

/* Área privada */
.app { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: calc(100vh - 140px); }
.side { border-right: 1px solid var(--line); padding: 1.4rem 1rem; display: flex; flex-direction: column; gap: 1.2rem; }
.side ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .2rem; }
.side a { display: flex; align-items: center; gap: .65rem; padding: .55rem .8rem; color: var(--text); text-decoration: none; border-left: 3px solid transparent; border-radius: 0 6px 6px 0; }
.side a svg { color: var(--muted); flex: none; }
.side a img { border-radius: 5px; flex: none; }
.side a[aria-current="page"] svg { color: var(--gold); }
.side a:hover { background: var(--panel); }
.side a[aria-current="page"] { border-left-color: var(--gold); background: var(--panel); }
.side form { margin-top: auto; }
.app-main { padding: clamp(1.2rem, 3vw, 2.4rem); max-width: 1000px; min-width: 0; }
.app-main.wide { max-width: 1320px; }
.app-main .cat-tool { background: none; padding: 0; font-size: 15px; }
.app-main h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.panel { background: var(--panel); border: 1px solid var(--line); padding: 1.3rem; margin-bottom: 1rem; }
.panel h2 { font-size: 1.2rem; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.status { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.status li { display: grid; grid-template-columns: 12px 1fr; column-gap: .6rem; }
.status li::before { content: ""; width: 10px; height: 10px; margin-top: .45rem; background: var(--muted); }
.status li.ok::before { background: var(--moss); }
.status strong { font-weight: 600; }
.status span { grid-column: 2; font-size: .86rem; color: var(--muted); }
.projects { list-style: none; padding: 0; margin: 0; }
.projects li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .3rem 1rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { text-align: left; padding: .55rem .4rem; border-bottom: 1px solid var(--line); }
.table th { color: var(--muted); font-weight: 600; }
.row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1rem; }
.report-md, .answer pre { white-space: pre-wrap; word-break: break-word; background: var(--ink); border: 1px solid var(--line); padding: 1rem; max-height: 70vh; overflow: auto; font-size: .86rem; }
.answer pre { font-family: inherit; font-size: .95rem; max-height: none; }
.log { list-style: none; padding: 0; margin: 0; }
.log li { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.log.notif li.unread span { font-weight: 600; }
.log.notif li.unread span::before { content: ""; display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; background: var(--gold-strong); margin-right: .5rem; vertical-align: middle; }
.badge { display: inline-block; min-width: 1.3rem; padding: 0 .35rem; border-radius: 999px; background: var(--gold); color: var(--on-gold); font-size: .75rem; font-weight: 700; text-align: center; line-height: 1.3rem; }
.log time { color: var(--muted); }
.danger-zone { border-color: var(--danger); }

/* Perfil en la barra superior */
.profile { display: flex; align-items: center; gap: .55rem; color: var(--text); text-decoration: none; padding: .2rem .8rem .2rem .2rem; border: 1px solid var(--line); border-radius: 999px; }
.profile img { width: 36px; height: 36px; border-radius: 50%; }
.profile:hover { border-color: var(--gold); color: var(--text); }

/* Bienvenida del panel: el paisaje solo aquí */
.welcome { position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 1.2rem; min-height: 220px; display: grid; }
.welcome picture, .welcome img { grid-area: 1 / 1; width: 100%; height: 100%; object-fit: cover; object-position: center 60%; display: block; }
.welcome img { max-height: 280px; }
.welcome-copy { grid-area: 1 / 1; align-self: end; padding: 1.4rem 1.6rem; background: linear-gradient(90deg, #16120ce6 0%, #16120cb3 45%, transparent 80%); color: #efe4cc; }
.welcome-copy h1 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); margin: 0 0 .2em; }
.welcome-copy p { margin: 0; }

/* Tarjetas de las dos herramientas */
.tool-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.tool-card { display: flex; gap: 1rem; align-items: flex-start; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 1.1rem; box-shadow: 0 10px 30px -18px #000; }
.tool-card img { width: 120px; height: 120px; border-radius: 16px; flex: none; }
.tool-card h3 { font-size: 1.25rem; margin-bottom: .3em; }
.tool-card p { color: var(--muted); font-size: .95rem; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 1rem; align-items: start; margin-bottom: 1rem; }
.dash-grid .tool-cards { grid-template-columns: 1fr; }
.status-panel { margin: 0; }
.band .tool-cards { max-width: 1100px; margin: 0 auto; }

/* Extensiones y documentación */
.lede-sm { color: var(--muted); max-width: 70ch; }
.ext-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.ext { margin: 0; }
.pill { font-size: .8rem; padding: .15rem .6rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); white-space: nowrap; }
.pill-ok { border-color: var(--moss); color: var(--moss); }
.kv2 { display: grid; grid-template-columns: 90px 1fr; gap: .25rem .8rem; margin: .6rem 0 0; font-size: .9rem; }
.kv2 dt { color: var(--muted); }
.kv2 dd { margin: 0; }
.prose-in { max-width: 80ch; }
.modes-doc dt { font-family: "Palatino Linotype", Palatino, Georgia, serif; font-weight: 700; margin-top: .9rem; }
.modes-doc dd { margin: .2rem 0 0; color: var(--muted); }

/* Pie */
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding: 1.4rem clamp(1rem, 4vw, 3rem); border-top: 1px solid var(--line); font-size: .86rem; }
.foot-brand { display: flex; gap: .8rem; align-items: flex-start; max-width: 60ch; }
.foot-brand p { margin: 0; }
[data-theme="light"] .foot-mark { filter: invert(1) hue-rotate(180deg); }
.foot nav { display: flex; gap: 1.2rem; }

@media (max-width: 860px) {
  .top { flex-wrap: wrap; gap: .8rem; }
  .top nav { order: 3; width: 100%; overflow-x: auto; }
  .hero { grid-template-columns: 1fr; }
  .hero-logo { order: -1; }
  .hero-logo img { width: 200px; }
  .tool-cards, .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .tool-card img { width: 84px; height: 84px; }
  .profile span { display: none; }
  .profile { padding: .2rem; }
  .welcome-copy { background: linear-gradient(0deg, #16120cee 0%, #16120c99 60%, transparent 100%); }
  .ledger > div + div { padding-left: 0; border-left: 0; }
}
/* Tablets y teléfonos: la barra lateral pasa a ser una fila desplazable bajo la barra superior */
@media (max-width: 1080px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { border-right: 0; border-bottom: 1px solid var(--line); padding: .5rem 1rem; flex-direction: row; align-items: center; gap: .6rem; position: sticky; top: 0; z-index: 5; background: var(--ink); }
  .side nav { flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: thin; }
  .side ul { display: flex; gap: .2rem; width: max-content; }
  .side a { border-left: 0; border-bottom: 2px solid transparent; border-radius: 6px; padding: .45rem .6rem; white-space: nowrap; }
  .side a[aria-current="page"] { border-bottom-color: var(--gold); }
  .side form, .side > .btn { margin: 0; flex: none; }
  .side .btn.wide { width: auto; padding: .45rem .9rem; }
}
@media (max-width: 560px) {
  .side a span { font-size: .9rem; }
  .side form { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }

/* ───── Área de trabajo según la referencia «Panel Wixy» ───── */
.app-top { gap: 1.5rem; }
.app-top .brand { min-width: 200px; }
.search { flex: 1; max-width: 1000px; display: flex; align-items: center; gap: .6rem; border: 1px solid var(--line); border-radius: 10px; padding: 0 .9rem; background: var(--panel); color: var(--muted); }
.search:focus-within { border-color: var(--gold); }
.search input { flex: 1; border: 0; background: transparent; color: var(--text); font: inherit; padding: .7rem 0; outline: none; min-width: 0; }
.search-spacer { flex: 1; }
a.icon-btn { color: var(--text); }
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .3rem; color: var(--text); }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary img { width: 40px; height: 40px; border-radius: 50%; box-shadow: 0 0 0 1px var(--gold); }
.menu-pop { position: absolute; right: 0; top: calc(100% + .5rem); z-index: 20; min-width: 230px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: .4rem; box-shadow: 0 18px 40px -16px #000; display: grid; }
.menu-pop a, .menu-pop button { display: block; width: 100%; text-align: left; padding: .55rem .7rem; border-radius: 6px; color: var(--text); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--panel-2); color: var(--text); }
.menu-pop form { margin: 0; }
.menu-who { margin: 0; padding: .5rem .7rem .6rem; border-bottom: 1px solid var(--line); margin-bottom: .3rem; display: grid; }
.menu-who span { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.danger-text { color: var(--danger) !important; }

/* Barra lateral con iconos en recuadro */
.side { padding: 1.2rem .9rem; }
.side ul { gap: .45rem; }
.side a { gap: .8rem; padding: .4rem .5rem; border-left: 0; border-radius: 10px; border: 1px solid transparent; }
.side a:hover { background: var(--panel); }
.tile { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--text); }
.tile svg { width: 24px; height: 24px; color: currentColor; }
.tile img { border-radius: 6px; }
.side a[aria-current="page"] { background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 30%, var(--panel-2)), color-mix(in srgb, var(--gold) 14%, var(--panel))); border-color: var(--gold); }
.side a[aria-current="page"] .tile { border-color: transparent; background: transparent; }
.side a[aria-current="page"] .side-label { font-weight: 600; }
.side-brand { margin-top: auto; border: 1px solid var(--line); border-radius: 10px; padding: 1rem; text-align: center; display: grid; justify-items: center; gap: .3rem; background: linear-gradient(180deg, var(--panel), color-mix(in srgb, var(--gold) 8%, var(--panel))); }
.side-brand strong { font-family: "Palatino Linotype", Palatino, Georgia, serif; font-size: 1.05rem; }
.side-brand span { color: var(--gold); font-size: .8rem; line-height: 1.4; }

/* Bienvenida */
.welcome { min-height: 300px; border-color: color-mix(in srgb, var(--gold) 60%, var(--line)); }
.welcome img { max-height: 320px; }
.welcome-copy { align-self: center; padding: 2rem 2.4rem; background: linear-gradient(90deg, #16120cd9 0%, #16120c99 50%, transparent 85%); }
.welcome-copy h1 { font-size: clamp(2rem, 4.4vw, 3.4rem); color: #f3e3bf; text-shadow: 0 2px 12px #000a; }
.welcome-sub { font-weight: 600; font-size: 1.1rem; }
.welcome-tag { display: grid; grid-template-columns: minmax(40px, 160px) auto minmax(40px, 160px); align-items: center; gap: .5rem; margin-top: .9rem !important; color: #e0bd73; max-width: 440px; justify-items: center; }
.welcome-tag .rule { height: 1px; width: 100%; background: linear-gradient(90deg, transparent, #c9a35a); }
.welcome-tag .rule + svg + .rule { background: linear-gradient(90deg, #c9a35a, transparent); }
.welcome-tag .words { grid-column: 1 / -1; font-weight: 600; }

/* Tarjetas principales */
.dash-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; margin-bottom: 1.4rem; }
.dash-card { display: flex; gap: 1rem; align-items: flex-start; padding: 1.3rem; border: 1px solid color-mix(in srgb, var(--gold) 55%, var(--line)); border-radius: 12px; background: radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--gold) 12%, var(--panel)), var(--panel) 60%); box-shadow: 0 16px 36px -24px #000; }
.dash-card img { width: 104px; height: 104px; border-radius: 14px; flex: none; }
.dash-card h2 { font-size: 1.35rem; margin-bottom: .35em; }
.dash-card p { color: var(--muted); margin-bottom: 1rem; }
.status-card .shield { flex: none; width: 84px; height: 96px; display: grid; place-items: center; color: var(--gold); }
.status-card .shield svg { width: 84px; height: 84px; stroke-width: 1.2; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.checks li { display: grid; grid-template-columns: 20px 1fr; gap: .55rem; align-items: start; font-size: .92rem; }
.checks small { display: block; color: var(--muted); font-size: .78rem; }
.checks .dot { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; margin-top: 1px; border: 1px solid var(--muted); }
.checks .ok .dot { background: var(--moss); border-color: var(--moss); color: #fff; }

/* Proyectos recientes + tarjeta de marca */
.dash-bottom { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(260px, 1fr); gap: 1.1rem; align-items: start; }
.recent .panel-head h2 { display: flex; align-items: center; gap: .5rem; font-size: 1.3rem; }
.recent .panel-head h2 svg { color: var(--gold); fill: currentColor; }
.proj-list { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: .7rem; }
.proj-row { display: flex; align-items: center; gap: 1rem; padding: .9rem 1.1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.proj-row img { border-radius: 10px; flex: none; }
.proj-info { flex: 1; min-width: 0; display: grid; }
.proj-info a { color: var(--text); text-decoration: none; font-size: 1.1rem; }
.proj-info span { color: var(--muted); font-size: .9rem; }
.proj-info .proj-sum { font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.more > summary { width: 44px; height: 44px; justify-content: center; border: 1px solid var(--line); border-radius: 10px; }
.more > summary:hover { border-color: var(--gold); }
.empty { border: 1px dashed var(--line); border-radius: 12px; padding: 1.2rem; display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; }
.empty p { margin: 0; color: var(--muted); max-width: 56ch; }
.brand-card { display: flex; gap: 1rem; align-items: center; padding: 1.3rem; border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--line)); border-radius: 12px; background: radial-gradient(120% 120% at 100% 100%, color-mix(in srgb, var(--gold) 14%, var(--panel)), var(--panel) 65%); }
.brand-card img { flex: none; }
.brand-card div { display: grid; gap: .3rem; }
.brand-card strong { font-family: "Palatino Linotype", Palatino, Georgia, serif; font-size: 1.3rem; }
.brand-card span { color: var(--gold); font-size: .92rem; }
body.in-app .foot { padding-top: 1rem; padding-bottom: 1rem; }

@media (max-width: 1280px) {
  .dash-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-card { grid-column: 1 / -1; }
}
@media (max-width: 1080px) {
  .side-brand, .side-login { display: none; }
  .tile { width: 34px; height: 34px; border: 0; background: none; }
  .tile svg { width: 20px; height: 20px; }
  .tile img { width: 24px; height: 24px; }
  .side a { padding: .3rem .6rem .3rem .3rem; gap: .4rem; }
  .side a[aria-current="page"] { border-bottom-width: 1px; }
}
@media (max-width: 860px) {
  .dash-row, .dash-bottom { grid-template-columns: minmax(0, 1fr); }
  .app-top .brand { min-width: 0; }
  .app-top .brand-word { display: none; }
  .app-top { flex-wrap: nowrap; gap: .7rem; }
  .app-top nav { display: none; }
  .welcome-copy { padding: 1.4rem; }
}
@media (max-width: 560px) {
  .dash-card { flex-direction: column; }
  .dash-card img { width: 72px; height: 72px; }
  .status-card .shield { display: none; }
  .proj-row { flex-wrap: wrap; }
  .proj-row .btn { flex: 1; justify-content: center; }
  .search { padding: 0 .6rem; }
  .menu-pop { position: fixed; left: .8rem; right: .8rem; top: 4.2rem; min-width: 0; }
}

/* Ajustes tras la revisión visual */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.welcome-copy { align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
.dash-card .btn { white-space: nowrap; }
.app-top .brand { flex: none; }
.app-top .search { min-width: 0; }
@media (max-width: 560px) {
  .app-top { padding: .7rem .8rem; }
  .app-top .mark { width: 46px; height: auto; }
}
.linked { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: .5rem; }
.linked li { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 8px; background: var(--ink); }
.linked li > span { display: flex; gap: .6rem; align-items: center; }

.icon-btn.bell { position: relative; }
.icon-btn.bell .dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold-strong); }

.ai-keys { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .5rem; }
.ai-keys li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 8px; flex-wrap: wrap; }
.ai-keys .row { display: flex; gap: .4rem; margin: 0; }

/* ── Mis proyectos: barra, menús Ordenar/Ver y vistas (como el Explorador de Windows) ── */
.proj-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem 1.5rem; }
.proj-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.menu.tb > summary { padding: .5rem .8rem; border: 1px solid var(--line); border-radius: 8px; gap: .45rem; }
.menu.tb > summary:hover, .menu.tb[open] > summary { border-color: var(--gold); }
.menu.tb .menu-pop { min-width: 250px; }
.menu-pop [aria-checked] { position: relative; padding-left: 1.9rem; display: flex; align-items: center; gap: .55rem; }
.menu-pop [aria-checked="true"]::before { content: ""; position: absolute; left: .75rem; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--gold-strong); }
.menu-pop hr { border: 0; border-top: 1px solid var(--line); margin: .3rem .2rem; width: auto; }
.proj-status { min-height: 1.3em; margin: .4rem 0; font-size: .9rem; color: var(--moss); }
.proj-status.error { color: var(--danger); }
.proj-rename { font: inherit; padding: .25rem .45rem; background: var(--ink); color: var(--text); border: 1px solid var(--gold); border-radius: 6px; width: min(100%, 28rem); }
.proj-info .proj-type, .proj-info .proj-size { font-size: .85rem; }
.proj-list .menu-pop { right: 0; }
.import-report { margin-top: 1.6rem; }
.import-report > summary { cursor: pointer; font-weight: 600; }
.proj-head { display: none; }

/* Detalles: columnas Nombre · Fecha · Tipo · Tamaño */
.proj-list.view-details { gap: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.proj-list.view-details .proj-row { display: grid; grid-template-columns: 28px minmax(0, 2.4fr) minmax(0, 1.2fr) minmax(0, 1.4fr) 5.5rem auto auto; gap: .9rem; padding: .45rem .9rem; border: 0; border-radius: 0; border-bottom: 1px solid var(--line); background: none; }
.proj-list.view-details .proj-row:last-child { border-bottom: 0; }
.proj-list.view-details .proj-row:hover { background: var(--panel-2); }
.proj-list.view-details img { width: 28px; height: 28px; border-radius: 6px; }
.proj-list.view-details .proj-info { display: contents; }
.proj-list.view-details .proj-info a { font-size: .98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-list.view-details .proj-sum { display: none; }
.proj-list.view-details .btn { padding: .3rem .8rem; }
#proj-head:not([hidden]) { display: grid; grid-template-columns: 28px minmax(0, 2.4fr) minmax(0, 1.2fr) minmax(0, 1.4fr) 5.5rem auto; gap: .9rem; padding: .5rem 1.9rem .4rem .9rem; margin-top: .4rem; color: var(--muted); font-size: .82rem; }

/* Lista: una línea por proyecto */
.proj-list.view-list { grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: .3rem .8rem; }
.proj-list.view-list .proj-row { padding: .35rem .6rem; gap: .6rem; border-color: transparent; background: none; }
.proj-list.view-list .proj-row:hover { border-color: var(--line); background: var(--panel); }
.proj-list.view-list img { width: 24px; height: 24px; border-radius: 5px; }
.proj-list.view-list .proj-info a { font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-list.view-list .proj-info span, .proj-list.view-list > li > .btn { display: none; }

/* Iconos: tarjetas en cuadrícula */
.proj-list.view-xl, .proj-list.view-md { grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .9rem; }
.proj-list.view-md { grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); }
.proj-list.view-xl .proj-row, .proj-list.view-md .proj-row { position: relative; flex-direction: column; align-items: center; text-align: center; padding: 1.1rem .8rem .9rem; }
.proj-list.view-xl img { width: 112px; height: 112px; border-radius: 14px; }
.proj-list.view-md img { width: 72px; height: 72px; }
.proj-list.view-xl .proj-info, .proj-list.view-md .proj-info { width: 100%; }
.proj-list.view-xl .proj-info a, .proj-list.view-md .proj-info a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-list.view-md .proj-info span:not(.proj-date), .proj-list.view-xl .proj-size { display: none; }
.proj-list.view-xl .proj-sum { white-space: normal; }
.proj-list.view-xl .menu.more, .proj-list.view-md .menu.more { position: absolute; top: .4rem; right: .4rem; }
.proj-list.view-md > li > .btn { display: none; }
@media (max-width: 760px) {
  .proj-list.view-details .proj-row { grid-template-columns: 28px minmax(0, 1fr) auto auto; }
  .proj-list.view-details .proj-date, .proj-list.view-details .proj-type, .proj-list.view-details .proj-size { display: none; }
  #proj-head:not([hidden]) { display: none; }
}

/* ── CAT: chat flotante ──
   La burbuja usa el mismo corte en esquinas que los botones dorados de la página; el panel es tinta con filo de oro. */
.cat-fab { position: fixed; right: clamp(.9rem, 2.5vw, 1.8rem); bottom: clamp(.9rem, 2.5vw, 1.8rem); z-index: 60; width: 64px; height: 64px; padding: 0; border: 0; cursor: pointer;
  background: linear-gradient(145deg, var(--gold-strong), var(--gold)); clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
  display: grid; place-items: center; filter: drop-shadow(0 14px 22px rgba(0, 0, 0, .55)); transition: transform .18s ease; }
.cat-fab img { width: 54px; height: 54px; border-radius: 4px; background: var(--ink); clip-path: polygon(11px 0, 100% 0, 100% calc(100% - 11px), calc(100% - 11px) 100%, 0 100%, 0 11px); }
.cat-fab:hover { transform: translateY(-2px); }
.cat-fab.open { transform: scale(.92); }
.cat-fab:focus-visible { outline: none; filter: drop-shadow(0 0 0 2px var(--text)) drop-shadow(0 14px 22px rgba(0, 0, 0, .55)); }
.cat-panel { position: fixed; right: clamp(.9rem, 2.5vw, 1.8rem); bottom: calc(clamp(.9rem, 2.5vw, 1.8rem) + 76px); z-index: 60; width: min(420px, calc(100vw - 1.8rem)); height: min(640px, calc(100vh - 7.5rem));
  display: flex; flex-direction: column; background: var(--ink); color: var(--text); border: 1px solid var(--line); border-top: 2px solid var(--gold); border-radius: 14px; box-shadow: 0 30px 70px -20px #000; overflow: hidden; }
.cat-panel[hidden] { display: none; }
.cat-panel.drop { border-color: var(--gold-strong); }
.cat-head { display: flex; align-items: center; gap: .7rem; padding: .8rem .8rem .7rem 1rem; border-bottom: 1px solid var(--line); background: var(--panel); }
.cat-head img { border-radius: 8px; }
.cat-title { flex: 1; display: grid; line-height: 1.15; }
.cat-title strong { font-family: "Palatino Linotype", Palatino, Georgia, serif; font-size: 1.2rem; letter-spacing: .04em; }
.cat-title span { color: var(--muted); font-size: .8rem; }
.cat-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; }
.cat-icon:hover { color: var(--text); border-color: var(--line); }
.cat-ctx { margin: 0; padding: .4rem 1rem; font-size: .78rem; color: var(--muted); border-bottom: 1px solid var(--line); }
.cat-log { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .8rem; scroll-behavior: smooth; }
.cat-hello { text-align: center; margin: auto 0; color: var(--muted); }
.cat-hello img { border-radius: 12px; margin-bottom: .4rem; }
.cat-hello p { margin: .2rem 0; }
.cat-hello strong { color: var(--text); font-family: "Palatino Linotype", Palatino, Georgia, serif; font-size: 1.15rem; }
.cat-sugs { display: grid; gap: .4rem; margin-top: 1rem; }
.cat-sugs button { font: inherit; font-size: .88rem; text-align: left; padding: .55rem .75rem; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; }
.cat-sugs button:hover { border-color: var(--gold); }
.cat-msg { max-width: 88%; font-size: .93rem; line-height: 1.5; overflow-wrap: anywhere; }
.cat-msg p { margin: 0 0 .45rem; }
.cat-msg p:last-child { margin-bottom: 0; }
.cat-msg ul, .cat-msg ol { margin: .2rem 0 .5rem; padding-left: 1.2rem; }
.cat-msg pre { margin: .4rem 0; padding: .6rem .7rem; background: #0e0b07; border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; font-size: .82rem; line-height: 1.45; }
.cat-msg :not(pre) > code { background: var(--panel-2); padding: .05rem .3rem; border-radius: 4px; }
.cat-msg.user { align-self: flex-end; background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px 14px 4px 14px; padding: .55rem .8rem; }
.cat-msg.cat { align-self: flex-start; padding: .1rem 0 .1rem .8rem; border-left: 2px solid var(--gold); }
.cat-msg.cat.error { border-left-color: var(--danger); color: var(--muted); }
.cat-files { font-size: .75rem; color: var(--gold-strong); }
.cat-useful { margin-top: .4rem; display: inline-flex; align-items: center; gap: .35rem; font: inherit; font-size: .78rem; color: var(--muted); background: none; border: 1px solid var(--line); border-radius: 999px; padding: .2rem .6rem; cursor: pointer; }
.cat-useful:hover:not(:disabled) { color: var(--text); border-color: var(--gold); }
.cat-useful:disabled { cursor: default; color: var(--moss); }
.cat-msg.thinking { display: flex; gap: .3rem; padding: .6rem .8rem; }
.cat-msg.thinking span { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); animation: cat-dot 1s infinite ease-in-out; }
.cat-msg.thinking span:nth-child(2) { animation-delay: .15s; }
.cat-msg.thinking span:nth-child(3) { animation-delay: .3s; }
@keyframes cat-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.cat-screen { display: grid; grid-template-columns: 84px 1fr auto; align-items: center; gap: .6rem; padding: .5rem .8rem; border-top: 1px solid var(--line); background: var(--panel); font-size: .8rem; }
.cat-screen[hidden] { display: none; }
.cat-screen video { width: 84px; height: 50px; object-fit: cover; border-radius: 6px; border: 1px solid var(--gold); background: #000; }
.cat-screen div { display: grid; }
.cat-screen span { color: var(--muted); }
.cat-chip-btn { display: inline-flex; align-items: center; gap: .3rem; font: inherit; font-size: .78rem; background: none; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: .3rem .5rem; cursor: pointer; }
.cat-compose { position: relative; padding: .6rem .7rem .55rem; border-top: 1px solid var(--line); }
.cat-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .45rem; }
.cat-chips[hidden] { display: none; }
.cat-chip { display: inline-flex; align-items: center; gap: .35rem; max-width: 100%; font-size: .78rem; padding: .2rem .25rem .2rem .5rem; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); }
.cat-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 14rem; }
.cat-chip button { display: grid; place-items: center; width: 20px; height: 20px; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.cat-chip button:hover { color: var(--text); background: var(--panel-2); }
/* La barra para escribir: una píldora como la de los chats de IA, en tinta y oro. */
.cat-bar { display: flex; align-items: flex-end; gap: .35rem; padding: .35rem; background: var(--panel); border: 1px solid var(--line); border-radius: 26px; }
.cat-bar:focus-within { border-color: var(--gold); }
.cat-bar textarea { flex: 1; resize: none; border: 0; outline: 0; background: none; color: var(--text); font: inherit; font-size: .95rem; line-height: 1.4; padding: .5rem .2rem; max-height: 160px; }
.cat-bar textarea::placeholder { color: var(--muted); }
.cat-plus, .cat-send { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; cursor: pointer; }
.cat-plus { border: 0; background: none; color: var(--text); }
.cat-plus:hover, .cat-plus[aria-expanded="true"] { background: var(--panel-2); }
.cat-send { border: 0; background: var(--gold); color: var(--on-gold); }
.cat-send:hover { background: var(--gold-strong); }
.cat-send:disabled { opacity: .5; cursor: default; }
.cat-menu { position: absolute; left: .7rem; bottom: calc(100% - .2rem); z-index: 2; min-width: 240px; padding: .35rem; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 40px -16px #000; display: grid; }
.cat-menu[hidden] { display: none; }
.cat-menu button { display: flex; align-items: center; gap: .65rem; text-align: left; font: inherit; font-size: .9rem; color: var(--text); background: none; border: 0; border-radius: 8px; padding: .5rem .6rem; cursor: pointer; }
.cat-menu button:hover { background: var(--panel-2); }
.cat-menu button span { display: grid; }
.cat-menu small { color: var(--muted); font-size: .74rem; }
.cat-remaining { margin: .35rem .3rem 0; font-size: .74rem; color: var(--muted); min-height: 1em; }
.cat-remaining:empty { display: none; }
.cat-login { padding: 1rem; border-top: 1px solid var(--line); text-align: center; }
.cat-login p { margin: 0 0 .6rem; color: var(--muted); }
.share-learning { margin: .6rem 0 .9rem; display: grid; gap: .6rem; justify-items: start; }
@media (max-width: 560px) {
  .cat-panel { right: 0; left: 0; bottom: 0; width: 100%; height: calc(100dvh - 3.5rem); border-radius: 14px 14px 0 0; }
  .cat-fab.open { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cat-fab, .cat-log { transition: none; scroll-behavior: auto; }
  .cat-msg.thinking span { animation: none; opacity: .7; }
}
.cat-note { margin: 0 0 .45rem; padding: .45rem .6rem; font-size: .78rem; color: var(--muted); border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.cat-note[hidden] { display: none; }
.cat-note button { font: inherit; color: var(--gold-strong); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }

/* Contacto y Turnstile (PUBLICAR_RENDER, bloque 3) */
.contact-form { max-width: 36rem; }
.contact-form textarea { width: 100%; font: inherit; padding: .6rem .7rem; border-radius: 8px; border: 1px solid var(--line, #3a3226); background: var(--field, transparent); color: inherit; resize: vertical; }
.cf-turnstile { min-height: 65px; margin: .4rem 0; }

/* Verificación en dos pasos y edad (PUBLICAR_RENDER, bloque 5) */
.twofa-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: .8rem; margin-top: .6rem; }
.twofa-choice { border: 1px solid var(--line, #3a3226); border-radius: 10px; padding: .8rem 1rem; }
.twofa-choice h3 { margin: 0 0 .3rem; font-size: 1rem; }
.twofa-setup ol { padding-left: 1.2rem; }
.twofa-setup .qr { margin: .6rem 0; }
.twofa-setup .qr svg { width: 220px; height: 220px; border-radius: 6px; }
.secret { letter-spacing: .05em; word-break: normal; overflow-wrap: normal; }
.auth-card form.stack + form.stack { margin-top: .6rem; }
.recovery-codes { columns: 2; list-style: none; padding: 0; font-size: 1.05rem; }
.recovery-codes li { margin: .25rem 0; }

/* Aviso de cookies de medición (etiqueta de Google, solo si está configurada) */
.cookie-banner { position: fixed; left: 1rem; bottom: 1rem; z-index: 60; max-width: 30rem; background: var(--panel, #1f1a14); border: 1px solid var(--line, #3a3226); border-radius: 12px; padding: .9rem 1rem; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.cookie-banner p { margin: 0 0 .6rem; font-size: .92rem; }
.cookie-banner .row { display: flex; gap: .5rem; flex-wrap: wrap; }
