:root {
    --bg: #f6f3ee;
    --ink: #1c1a17;
    --muted: #6b645a;
    --accent: #8b2942;
    --accent-soft: #f0e4e8;
    --ok: #2d6a4f;
    --warn: #b08900;
    --error: #9b2226;
    --card: #ffffff;
    --line: #ddd6cb;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.5;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--ink);
    color: #fff;
}

.brand-mark { font-weight: 700; letter-spacing: 0.04em; }
.brand-sub { margin-left: 0.75rem; opacity: 0.75; font-size: 0.9rem; }
.topnav a { color: #fff; margin-left: 1rem; text-decoration: none; }

.wizard {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--line);
    background: #fff;
}

@media (max-width: 760px) {
    .wizard { grid-template-columns: 1fr 1fr; }
}

.wizard-step {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    padding: 0.75rem;
    border-radius: 10px;
    background: var(--bg);
    color: var(--muted);
    border: 1px solid var(--line);
}

.wizard-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--line);
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.wizard-step-body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.wizard-step-body strong {
    color: var(--ink);
    font-size: 0.92rem;
}

.wizard-step-body small {
    font-size: 0.78rem;
    line-height: 1.3;
}

.wizard-step.is-active {
    background: var(--accent-soft);
    border-color: var(--accent);
}

.wizard-step.is-active .wizard-step-num {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.wizard-step.is-done {
    background: #fff;
    border-color: var(--accent);
}

.wizard-step.is-done .wizard-step-num {
    background: var(--accent-soft);
    color: var(--accent);
}

.wizard-step.is-pending {
    opacity: 0.85;
}

.wizard-overview .wizard-step.is-pending .wizard-step-body strong {
    color: var(--muted);
}

.card-start h2 {
    margin-bottom: 0.35rem;
}

.paso-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: var(--bg);
    font-size: 0.82rem;
}

.container {
    max-width: 920px;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

h1, h2 { margin-top: 0; }

label { display: block; font-weight: 600; margin-bottom: 0.35rem; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
textarea,
select {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    margin-bottom: 1rem;
}

textarea { min-height: 100px; resize: vertical; }

select {
    width: 100%;
    margin-bottom: 1rem;
}

.btn {
    display: inline-block;
    padding: 0.65rem 1.1rem;
    border: none;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    cursor: pointer;
    text-decoration: none;
}

.btn-secondary {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}

.indicador-row { display: flex; gap: 0.5rem; align-items: flex-start; margin-bottom: 0.5rem; }
.indicador-row span { min-width: 1.5rem; padding-top: 0.65rem; color: var(--muted); }

.nivel-grid { display: grid; gap: 1rem; }
.nivel-card { border-left: 4px solid var(--accent); padding-left: 1rem; }

.alert { padding: 0.75rem 1rem; border-radius: 8px; margin: 1rem 0; }
.alert-ok { background: #d8f3dc; color: var(--ok); }
.alert-warn { background: #fff3cd; color: var(--warn); }
.alert-error { background: #f8d7da; color: var(--error); }
.alert-info { background: #e7f1ff; color: #1d3557; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 0.65rem; border-bottom: 1px solid var(--line); text-align: left; }

.footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--muted);
    font-size: 0.85rem;
}

.hint { color: var(--muted); font-size: 0.9rem; }

.page-with-guia {
    display: grid;
    gap: 1.25rem;
}

@media (min-width: 960px) {
    .page-with-guia {
        grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
        align-items: start;
    }
}

.guia-panel {
    background: #fff;
    border-color: var(--accent-soft);
}

.guia-kicker {
    margin: 0 0 0.35rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
}

.guia-titulo {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
}

.guia-intro {
    color: var(--muted);
    font-size: 0.92rem;
    margin-top: 0;
}

.guia-bloque {
    border-top: 1px solid var(--line);
    padding-top: 0.65rem;
    margin-top: 0.65rem;
}

.guia-bloque summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--ink);
    list-style: none;
}

.guia-bloque summary::-webkit-details-marker { display: none; }

.guia-bloque summary::before {
    content: "▸ ";
    color: var(--accent);
}

.guia-bloque[open] summary::before { content: "▾ "; }

.guia-contenido {
    padding: 0.5rem 0 0.25rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.guia-contenido p:first-child { margin-top: 0; }

.guia-lista {
    margin: 0.35rem 0 0.75rem;
    padding-left: 1.1rem;
}

.guia-lista li { margin-bottom: 0.35rem; }

.guia-ejemplo {
    margin: 0.5rem 0;
    padding: 0.75rem 1rem;
    border-left: 4px solid var(--accent);
    background: var(--accent-soft);
    font-style: italic;
    color: var(--ink);
}

.campo-ayuda {
    margin: -0.15rem 0 1rem;
    font-size: 0.88rem;
    color: var(--muted);
}

.page-design {
    display: grid;
    gap: 1.25rem;
}

@media (min-width: 1024px) {
    .page-design {
        grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
        align-items: start;
    }

    .page-design-aside {
        position: sticky;
        top: 1rem;
    }
}

.page-design-aside {
    display: grid;
    gap: 1rem;
}

.doc-preview {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 8px 24px rgba(28, 26, 23, 0.06);
}

.doc-preview-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--line);
}

.doc-preview-kicker {
    margin: 0;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
    font-weight: 700;
}

.doc-preview-title {
    margin: 0.15rem 0 0;
    font-size: 1rem;
}

.doc-preview-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: var(--bg);
    color: var(--muted);
    white-space: nowrap;
}

.doc-section {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px dashed var(--line);
}

.doc-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.doc-section h3 {
    margin: 0 0 0.5rem;
    font-size: 0.92rem;
}

.doc-section.is-active h3 { color: var(--accent); }
.doc-section.is-complete h3 { color: var(--ok); }

.doc-dl {
    margin: 0;
    display: grid;
    gap: 0.45rem;
}

.doc-dl dt {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.doc-dl dd {
    margin: 0;
    font-size: 0.88rem;
}

.doc-placeholder {
    margin: 0;
    font-size: 0.82rem;
    color: var(--muted);
    font-style: italic;
}

.wizard-micro-progress {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.wizard-micro-dot {
    flex: 1;
    height: 4px;
    border-radius: 999px;
    background: var(--line);
}

.wizard-micro-dot.is-active,
.wizard-micro-dot.is-done {
    background: var(--accent);
}

.wizard-micro-kicker {
    margin: 0 0 0.75rem;
    font-size: 0.82rem;
    color: var(--accent);
    font-weight: 600;
}

.wizard-micro-pregunta {
    font-size: 1.35rem;
    margin-bottom: 0.35rem;
}

.card-wizard {
    min-height: 280px;
}

.wizard-micro-nav {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.25rem;
}

.input-lg {
    font-size: 1.1rem;
    padding: 0.85rem 1rem;
}

.btn-link {
    background: transparent;
    color: var(--accent);
    border: none;
    padding: 0.35rem 0;
    margin-bottom: 0.5rem;
    text-decoration: underline;
    cursor: pointer;
    font: inherit;
}

.btn-ejemplo {
    display: inline-block;
}

.resumen-contexto {
    background: var(--bg);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.resumen-contexto p {
    margin: 0.35rem 0;
}

.autosave-hint {
    min-height: 1.25rem;
    margin: 0.75rem 0 0;
    font-size: 0.8rem;
    color: var(--muted);
}

.page-design-aside .guia-panel {
    max-height: 42vh;
    overflow: auto;
}

.elemento-grid {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px dashed var(--line);
}

.preview-redaccion {
    grid-column: 1 / -1;
    padding: 0.75rem 1rem;
    background: var(--accent-soft);
    border-radius: 8px;
    font-style: italic;
    min-height: 2.5rem;
}

.card-ref { display: grid; gap: 0.75rem; }
.taxonomia-img { max-width: 280px; border-radius: 8px; border: 1px solid var(--line); }

.indicador-block {
    border: none;
    margin: 0 0 1rem;
    padding: 0 0 1rem;
}

.indicador-block legend { font-weight: 700; margin-bottom: 0.5rem; }
