/* Reset, tipografía y layout global. */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font: 400 15px/1.55 var(--f-body);
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--f-display); font-weight: 700; line-height: 1.2; letter-spacing: -.01em; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
a { color: var(--av-pri); text-underline-offset: 2px; }
img { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
/* Base for any control without its own component style (tables, toolbars): zero specificity, so components override it. */
:where(input:not([type=checkbox], [type=radio], [type=range], [type=file], [type=color], [type=hidden], [type=submit], [type=button]), select, textarea) {
    min-height: 32px; padding: 4px 10px; background: var(--surface); color: var(--ink);
    border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
}
:where(input, select, textarea):focus-visible { border-color: var(--av-acc); }
:focus-visible { outline: 3px solid var(--av-acc); outline-offset: 2px; }
[hidden] { display: none !important; }

.muted { color: var(--muted); }
.mono { font-family: var(--f-mono); font-size: .87rem; }
.small { font-size: .85rem; font-weight: 400; }
.sr-only {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
}

.page { width: 100%; max-width: var(--page-max); margin: 0 auto; padding: 24px 16px 48px; }
.is-compact { font-size: 14px; }
.is-compact .page { padding-top: 12px; padding-bottom: 16px; }
.is-compact h1 { font-size: 1.35rem; margin-bottom: 0; }
.is-compact .page-head__section { margin-bottom: 2px; }
/* Formulario de cotización: migas y título en una línea. */
.is-compact .page-head--inline { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.is-compact .page-head--inline .page-head__section { margin: 0; }
/* Páginas sin sesión (ingreso, enlaces): una tarjeta centrada, como el acceso de la tienda. */
.is-guest .page {
    min-height: 100vh; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 12px; padding-top: 48px;
}
.page-head { margin-bottom: var(--head-gap); }
.page-head h1 { margin-bottom: 4px; }
.page-head .muted { margin: 0; font-size: .93rem; }
.page-head .flash { margin-top: 12px; }
.page-head__section {
    margin: 0 0 6px; font-size: .75rem; font-weight: 600; letter-spacing: .06em;
    text-transform: uppercase; color: var(--muted);
}
.page-head__section a { color: inherit; }
.ico { width: 20px; height: 20px; flex: none; }
.skip-link {
    position: absolute; left: 12px; top: -48px; z-index: 100;
    padding: 8px 12px; border-radius: var(--radius-sm); background: var(--surface); color: var(--av-pri);
}
.skip-link:focus { top: 12px; }

/* Logo vertical a color sobre los formularios sin sesión (ingreso, invitación, restablecer). */
.brand-guest { display: block; width: 120px; height: auto; margin: 0 auto 20px; }
/* Logo horizontal a color en las páginas de error. */
.brand-error { display: block; width: 180px; height: auto; margin: 0 0 20px; }

.error-detail {
    white-space: pre-wrap; word-break: break-word; font: .85rem/1.5 var(--f-mono);
    background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px;
}

@media (min-width: 768px) {
    .page { padding: 28px 24px 64px; }
    .is-guest .page { padding-top: 64px; }
}
.page-head--actions { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.section-gap { margin-top: var(--section-gap); }
/* Columnas hermanas parejas: tarjetas o paneles lado a lado con la misma altura (bajan a una columna si no caben). */
.cols { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); align-items: stretch; }
.cols > * { min-width: 0; margin: 0; }
