/* Classless foundation: semantic HTML is styled without extra classes. */
:root {
    color-scheme: light;
    --page: #f4f7fa;
    --surface: #fff;
    --surface-soft: #e8eef5;
    --text: #33415c;
    --heading: #1b263b;
    --muted: #66758a;
    --accent: #415a77;
    --accent-hover: #1b263b;
    --on-accent: #fff;
    --border: #cdd6e0;
    --focus: #5f7fa3;
    --selection: #ccd9e8;
    --danger: #b23a48;
    --message: #dce7f3;
    --shadow: 0 6px 24px rgb(27 38 59 / 8%);
    --radius: 12px;
}


*, *::before, *::after { box-sizing: border-box; }
html {
    background: var(--page);
    scrollbar-color: var(--border) var(--page);
    scrollbar-width: thin;
    -webkit-text-size-adjust: 100%;
}
body {
    max-width: 848px;
    margin: 0 auto;
    padding: clamp(24px, 5vw, 56px) 24px;
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.65;
    overflow-wrap: anywhere;
    text-rendering: optimizeLegibility;
}
::selection { background: var(--selection); color: var(--heading); }
h1, h2, h3, h4, h5, h6 {
    margin: 1.6em 0 0.65em;
    color: var(--heading);
    font-weight: 650;
    line-height: 1.2;
    letter-spacing: -0.025em;
    text-wrap: balance;
}
h1 { font-size: clamp(2rem, 5vw, 2.8rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2rem); }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; }
h5, h6 { font-size: 1rem; }
body > :first-child { margin-top: 0; }
p, ul, ol, dl, figure { margin: 0 0 1.25rem; }
strong, b, dt { color: var(--heading); font-weight: 650; }
small, figcaption { color: var(--muted); font-size: 0.875em; }
dd { margin: 0.25rem 0 1rem 1.5rem; }
li + li { margin-top: 0.3rem; }
a {
    color: var(--accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.22em;
}
a:hover { color: var(--accent-hover); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
hr { margin: 2rem 0; border: 0; border-top: 1px solid var(--border); }

form { margin: 1rem 0 1.5rem; }
label, legend { color: var(--heading); font-weight: 550; }
label { display: inline-block; margin-bottom: 0.4rem; }
legend { padding: 0 0.4rem; }
form > legend { padding: 0; margin-bottom: 0.4rem; }
fieldset {
    min-width: 0;
    margin: 1.25rem 0;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
input, select, textarea, button {
    max-width: 100%;
    margin: 0 0 0.65rem;
    font: inherit;
    line-height: 1.4;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}
input, select, textarea {
    padding: 0.75rem 0.9rem;
    color: var(--text);
    background: var(--surface);
    accent-color: var(--accent);
}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="hidden"]), select {
    width: 22rem;
    min-height: 46px;
}
textarea { display: block; width: 100%; min-height: 120px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { border-color: var(--focus); }
input[type="checkbox"], input[type="radio"] {
    width: 1.1rem;
    height: 1.1rem;
    margin: 0 0.5rem 0 0;
    vertical-align: middle;
}
input[type="checkbox"] + label, input[type="radio"] + label { font-weight: 400; }
input[type="range"] { padding: 0; width: 22rem; }
input[type="color"] { width: 4rem; height: 3rem; padding: 0.3rem; }
input[type="file"] { font-size: 0.9rem; }
button, input[type="submit"], input[type="button"], input[type="reset"] {
    width: auto;
    min-height: 46px;
    padding: 0.7rem 1.3rem;
    background: var(--accent);
    border-color: transparent;
    color: var(--on-accent);
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow);
}
button:hover, input[type="submit"]:hover, input[type="button"]:hover, input[type="reset"]:hover {
    background: var(--accent-hover);
    border-color: transparent;
}
button:active, input[type="submit"]:active, input[type="button"]:active, input[type="reset"]:active { box-shadow: none; }
:is(input, select, textarea, button):disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
input[readonly], textarea[readonly] { background: var(--surface-soft); }
button + button { margin-left: 0.4rem; }

img, video, canvas, svg { max-width: 100%; height: auto; }
audio, iframe { max-width: 100%; }
img, video { border-radius: var(--radius); }
figure { margin-inline: 0; }
figcaption { margin-top: 0.5rem; }
code, kbd, samp, pre {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.9em;
    background: var(--surface-soft);
    border-radius: 6px;
}
code, kbd, samp { padding: 0.15em 0.4em; }
kbd { border: 1px solid var(--border); }
pre { padding: 1rem; overflow-x: auto; }
pre code { padding: 0; background: none; }
blockquote {
    margin: 1.5rem 0;
    padding: 0.75rem 1.25rem;
    background: var(--surface-soft);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
}
blockquote > :last-child { margin-bottom: 0; }
mark { background: var(--selection); color: var(--heading); padding: 0.1em 0.25em; }
abbr[title] { cursor: help; text-underline-offset: 0.2em; }
table { width: 100%; margin: 1.5rem 0; border-collapse: collapse; font-variant-numeric: tabular-nums; }
caption { margin-bottom: 0.75rem; color: var(--muted); text-align: left; }
th, td { padding: 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--heading); background: var(--surface-soft); }
tbody tr:nth-child(even) { background: var(--surface); }
details {
    margin: 1rem 0;
    padding: 1rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
summary { color: var(--heading); font-weight: 600; cursor: pointer; }
details[open] > summary { margin-bottom: 1rem; }
progress, meter { width: 100%; accent-color: var(--accent); }
[hidden], [x-cloak] { display: none !important; }
.right { float: right; }
.clear { clear: both; }
.ancho { width: 100%; }

@media (max-width: 600px) {
    body { padding: 24px 16px; }
    fieldset { padding: 0.75rem; }
    th, td { padding: 0.5rem; }
}
@media (prefers-reduced-motion: reduce) {
    input, select, textarea, button { transition: none; }
}
@media print {
    :root {
        color-scheme: light;
        --page: #fff;
        --surface: #fff;
        --surface-soft: #f5f5f5;
        --text: #222;
        --heading: #000;
        --muted: #555;
        --accent: #174b3d;
        --border: #bbb;
        --message: #f5f5f5;
        --shadow: none;
    }
    body { max-width: none; padding: 0; }
}
