/* Results in the account (resultados.html) and the professional view (profesional.html). Mobile first.
   Palette: docs/negocio/producto/marca.md (same tokens as index.html). The band is one neutral tone. */
:root {
  --paper: #F1F3EF; --panel: #E5E8E2; --card: #F9FAF7; --ink: #1F1B2D; --soft: #57536A; --rule: #D0D4CB;
  --leaf: #1D7350; --leaf-bg: #D9EDE2; --beet: #B02E5F; --amber: #94650C; --amber-bg: #F3E6C8;
  --mid: #6B6880; --mid-bg: #E3E2EA; --n1: #D8D5E2; --n2: #9C97B3; --n3: #4E4868; --sky: #3E6A8A; --sky-bg: #E2ECF3;
  --bar: #1F1B2D; --bar-fg: #ECE9F1; --pink: #F2C9D6;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #14121C; --panel: #1A1824; --card: #1D1A28; --ink: #ECE9F1; --soft: #A9A4B8; --rule: #2F2B3C;
    --leaf: #6CC79A; --beet: #EE7FA6; --amber: #E2B14F; --leaf-bg: #173326; --amber-bg: #372C14;
    --mid: #A9A4B8; --mid-bg: #2A2737; --n1: #2F2B3C; --n2: #5E587A; --n3: #B9B3CF; --sky: #8DB6D6; --sky-bg: #1C2A36;
    --bar: #0E0C14; --pink: #4A1A30;
  }
}
:root[data-theme="dark"] {
  --paper: #14121C; --panel: #1A1824; --card: #1D1A28; --ink: #ECE9F1; --soft: #A9A4B8; --rule: #2F2B3C;
  --leaf: #6CC79A; --beet: #EE7FA6; --amber: #E2B14F; --leaf-bg: #173326; --amber-bg: #372C14;
  --mid: #A9A4B8; --mid-bg: #2A2737; --n1: #2F2B3C; --n2: #5E587A; --n3: #B9B3CF; --sky: #8DB6D6; --sky-bg: #1C2A36;
  --bar: #0E0C14; --pink: #4A1A30;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--display); font-size: 1rem; line-height: 1.5; overflow-x: hidden; }
h1, h2, h3, h4 { margin: 0; line-height: 1.12; letter-spacing: -0.015em; }
p { margin: 0; }
a { color: var(--leaf); }
button { font: inherit; color: inherit; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.soft { color: var(--soft); } .small { font-size: .9rem; } .tiny { font-size: .8rem; color: var(--soft); }
.k { font-size: .7rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--soft); }

header.top { position: sticky; top: 0; z-index: 5; background: var(--paper); border-bottom: 1px solid var(--rule); }
header.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 56px; }
header.top .brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.15rem; color: var(--ink); text-decoration: none; }
header.top .brand img { height: 26px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px;
  border: 1.5px solid var(--ink); background: var(--ink); color: var(--paper); font-weight: 700; text-decoration: none; cursor: pointer; }
.btn.line { background: transparent; color: var(--ink); }
.btn.small { min-height: 36px; padding: 0 14px; font-size: .9rem; }
.btn[disabled] { opacity: .6; cursor: progress; }

main { padding: 20px 0 96px; }
section.view[hidden] { display: none; }
.crumb { font-size: .75rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--leaf); margin-bottom: 6px; }
h1.title { font-size: clamp(1.7rem, 6vw, 2.3rem); font-weight: 800; margin-bottom: 8px; }
h2.sec { font-size: 1.25rem; font-weight: 800; margin: 26px 0 10px; }
.meta-line { font-size: .85rem; color: var(--soft); margin-bottom: 14px; }
.banner { background: var(--pink); color: #4A1A30; border-radius: 12px; padding: 10px 14px; font-size: .9rem; font-weight: 600; margin-bottom: 16px; }
:root[data-theme="dark"] .banner { color: #F6DCE6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .banner { color: #F6DCE6; } }

.dir { display: inline-block; font-weight: 800; font-size: .8rem; border-radius: 6px; padding: 2px 8px; white-space: nowrap; }
.dir.up { color: var(--leaf); background: var(--leaf-bg); } .dir.down { color: var(--amber); background: var(--amber-bg); } .dir.same { color: var(--mid); background: var(--mid-bg); }
.ev { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; white-space: nowrap; }
.ev .bars { display: inline-flex; gap: 3px; } .ev .bars i { width: 14px; height: 7px; border-radius: 2px; background: var(--rule); display: block; } .ev .bars i.on { background: var(--ink); }
.ev.low { font-weight: 800; }

ol.first { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: p; }
ol.first li { counter-increment: p; display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; background: var(--card); border: 1px solid var(--rule); border-radius: 12px; padding: 12px; }
ol.first li::before { content: counter(p); width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-weight: 800; }
ol.first b { font-size: 1.02rem; } ol.first .act { display: block; font-size: .92rem; margin-top: 4px; }
ol.first button { all: unset; cursor: pointer; display: block; }

.board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 620px) { .board { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { all: unset; cursor: pointer; background: var(--card); border: 1px solid var(--rule); border-radius: 12px; padding: 12px; display: grid; gap: 4px; align-content: start; min-width: 0; }
.tile:focus-visible, .trait > summary:focus-visible, .area > summary:focus-visible { outline: 2px solid var(--leaf); outline-offset: 2px; }
.tile b { font-size: .95rem; line-height: 1.2; overflow-wrap: anywhere; } .tile .word { font-size: 1.1rem; font-weight: 800; }
.tile.focus { border: 1.5px solid var(--ink); } .tile.focus .word { color: var(--beet); }
.tile .cnt { display: flex; gap: 4px; flex-wrap: wrap; }
svg.ico { width: 36px; height: 36px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg .f1 { fill: var(--card); } svg .f2 { fill: var(--leaf-bg); } svg .f3 { fill: var(--pink); } svg .f4 { fill: var(--amber-bg); }

.download { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 18px; }

details.area { background: var(--card); border: 1px solid var(--rule); border-radius: 14px; margin-bottom: 10px; }
details.area > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 36px 1fr auto auto; gap: 12px; align-items: center; padding: 14px; }
details.area > summary::-webkit-details-marker, details.trait > summary::-webkit-details-marker { display: none; }
details.area > summary .q { display: block; font-size: .88rem; color: var(--soft); font-weight: 400; }
details.area > summary h3 { font-size: 1.05rem; }
details.area > summary::after, details.trait > summary::after { content: "+"; font-weight: 800; font-size: 1.3rem; color: var(--soft); }
details.area[open] > summary::after, details.trait[open] > summary::after { content: "−"; }
details.area > .a-body { padding: 0 14px 14px; display: grid; gap: 12px; }
.note { background: var(--amber-bg); border-radius: 10px; padding: 10px 12px; font-size: .9rem; }

.bandbox { border: 1px solid var(--rule); border-radius: 12px; padding: 12px; display: grid; gap: 6px; background: var(--paper); }
.bandbox .bl { font-size: 1.05rem; font-weight: 800; } .bandbox .sub { font-size: .85rem; color: var(--soft); }
.bandbox .share { font-size: .88rem; color: var(--soft); } .bandbox .share b { color: var(--ink); }
svg.hist { width: 100%; height: 56px; display: block; }
svg.hist rect.out { fill: var(--n1); } svg.hist rect.in { fill: var(--n2); } svg.hist rect.me { fill: var(--ink); } svg.hist .tip { fill: var(--beet); }
.hist-axis { display: flex; justify-content: space-between; font-size: .72rem; color: var(--soft); }
.histwrap { position: relative; padding-top: 16px; }
.histwrap .you { position: absolute; top: 0; transform: translateX(-50%); font-size: .75rem; font-weight: 800; line-height: 1; white-space: nowrap; }
.histwrap .you.l { transform: none; } .histwrap .you.r { transform: translateX(-100%); }
.bandbox .share.pos b { display: block; font-size: 1rem; margin-bottom: 2px; }
.scale .track { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 3px; height: 10px; } .scale .track span { background: var(--n1); border-radius: 99px; } .scale .track span.on { background: var(--n3); }
.scale .labels { display: grid; grid-template-columns: 1fr 1fr 1fr; font-size: .72rem; color: var(--soft); } .scale .labels span:nth-child(2) { text-align: center; } .scale .labels span:nth-child(3) { text-align: right; }

.traits { display: grid; gap: 8px; }
details.trait { border: 1px solid var(--rule); border-radius: 12px; background: var(--card); }
details.trait.low { border-style: dashed; border-color: var(--n2); }
details.trait.health { border: 1.5px solid var(--sky); }
details.trait > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 12px; min-height: 48px; }
details.trait > summary .t-name { font-weight: 800; margin-right: auto; }
details.trait > summary::after { margin-left: 4px; }
.htag { font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--sky); background: var(--sky-bg); border-radius: 6px; padding: 2px 6px; }
.t-body { padding: 0 12px 14px; display: grid; gap: 10px; }
.hlabel { font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--sky); }
.que { font-size: 1rem; } .why { font-size: .92rem; color: var(--soft); } .why b { color: var(--ink); }
.foodgrid { display: grid; gap: 10px; }
@media (min-width: 560px) { .foodgrid { grid-template-columns: 1fr 1fr; } }
.foods h4 { font-size: .75rem; letter-spacing: .07em; text-transform: uppercase; margin-bottom: 6px; }
.foods.up h4 { color: var(--leaf); } .foods.down h4 { color: var(--amber); }
.foods ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.foods li { background: var(--panel); border-radius: 8px; padding: 8px 10px; font-size: .92rem; }
.foods.up li { border-left: 3px solid var(--leaf); } .foods.down li { border-left: 3px solid var(--amber); }
.where { font-size: .88rem; color: var(--soft); display: flex; flex-wrap: wrap; gap: 6px 10px; border-top: 1px dashed var(--rule); padding-top: 8px; }
.where b { color: var(--ink); } .ref { background: var(--panel); color: var(--ink); border-radius: 6px; padding: 2px 8px; font-weight: 600; }
.hnote { display: grid; grid-template-columns: 22px 1fr; gap: 10px; background: var(--sky-bg); border-radius: 10px; padding: 10px 12px; font-size: .92rem; }
.hnote .i { width: 22px; height: 22px; border-radius: 50%; background: var(--sky); color: var(--card); display: grid; place-items: center; font: italic 800 .85rem Georgia, serif; }
.meta { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; font-size: .88rem; }
details.evq summary { cursor: pointer; list-style: none; } details.evq summary::-webkit-details-marker { display: none; }
details.evq .q { color: var(--leaf); text-decoration: underline; font-size: .82rem; } details.evq p { font-size: .85rem; color: var(--soft); margin-top: 4px; }
.lownote { font-size: .85rem; font-weight: 600; color: var(--n3); background: var(--n1); border-radius: 8px; padding: 6px 10px; }
details.ciencia { border-top: 1px dashed var(--rule); padding-top: 8px; }
details.ciencia > summary { cursor: pointer; font-size: .9rem; color: var(--leaf); font-weight: 700; }
details.ciencia .qdc { font-size: .95rem; margin: 8px 0; }
details.ciencia .k { margin-bottom: 4px; }
sup { font-size: .68em; line-height: 0; color: var(--leaf); font-weight: 800; margin-left: 1px; }
ol.estudios { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: .84rem; color: var(--soft); }
ol.estudios li { display: grid; grid-template-columns: 18px 1fr; gap: 4px; overflow-wrap: anywhere; }
ol.estudios .n { font-weight: 800; color: var(--leaf); } ol.estudios i { color: var(--ink); }
ol.estudios .hall { display: block; color: var(--ink); margin-top: 2px; }
.folds { display: grid; gap: 8px; }
details.fold { background: var(--card); border: 1px solid var(--rule); border-radius: 12px; }
details.fold > summary { list-style: none; cursor: pointer; padding: 14px; font-weight: 700; display: flex; justify-content: space-between; gap: 10px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: "+"; font-weight: 800; color: var(--soft); } details.fold[open] > summary::after { content: "−"; }
details.fold > summary:focus-visible { outline: 2px solid var(--leaf); outline-offset: 2px; }
.fold-body { padding: 0 14px 14px; display: grid; gap: 8px; font-size: .95rem; }
details.sci summary { cursor: pointer; font-size: .85rem; color: var(--leaf); font-weight: 700; }
.samelist { border: 1px dashed var(--rule); border-radius: 12px; padding: 10px 12px; }
.samelist h4 { font-size: .75rem; letter-spacing: .07em; text-transform: uppercase; color: var(--mid); margin-bottom: 6px; }
.samelist ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.samelist li { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: .92rem; }

.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--rule); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: .8rem; }
th { text-align: left; font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--soft); padding: 6px 8px; border-bottom: 1.5px solid var(--ink); white-space: nowrap; }
td { padding: 6px 8px; border-bottom: 1px solid var(--rule); vertical-align: top; }
td .refs { display: block; font-size: .7rem; color: var(--soft); }
tr.off td { color: var(--soft); opacity: .75; }
details.sci table { margin-top: 6px; }

.card { background: var(--card); border: 1px solid var(--rule); border-radius: 14px; padding: 16px; display: grid; gap: 10px; }
.card label { font-weight: 700; font-size: .92rem; }
.card input, .card select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--paper); border: 1.5px solid var(--rule); border-radius: 10px; padding: 10px 12px; }
.links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.links li { background: var(--card); border: 1px solid var(--rule); border-radius: 12px; padding: 12px; display: grid; gap: 6px; }
.links .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.status { font-size: .75rem; font-weight: 800; border-radius: 6px; padding: 2px 8px; }
.status.active { background: var(--leaf-bg); color: var(--leaf); } .status.expired, .status.revoked { background: var(--mid-bg); color: var(--mid); }
.copybox { display: flex; gap: 8px; } .copybox input { flex: 1; min-width: 0; font-size: .85rem; }
.menu-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.menu-list a, .menu-list button { all: unset; cursor: pointer; display: block; background: var(--card); border: 1px solid var(--rule); border-radius: 12px; padding: 14px; font-weight: 700; }
.ancbar { display: flex; height: 18px; border-radius: 6px; overflow: hidden; margin: 10px 0; } .ancbar span { display: block; }
ul.anc { list-style: none; margin: 0; padding: 0; } ul.anc li { display: grid; grid-template-columns: 14px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--rule); }
ul.anc li i { width: 14px; height: 14px; border-radius: 4px; display: block; } ul.anc li.sub { padding-left: 24px; font-size: .9rem; color: var(--soft); }

nav.bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--card); border-top: 1px solid var(--rule); padding-bottom: env(safe-area-inset-bottom); }
nav.bottom .wrap { display: grid; grid-template-columns: repeat(4, 1fr); }
nav.bottom button { all: unset; cursor: pointer; display: grid; justify-items: center; gap: 2px; padding: 8px 0 10px; font-size: .75rem; font-weight: 700; color: var(--soft); text-align: center; }
nav.bottom button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
nav.bottom button[aria-current="page"] { color: var(--ink); }
nav.bottom button[aria-current="page"] svg { stroke: var(--beet); }
nav.bottom button:focus-visible { outline: 2px solid var(--leaf); outline-offset: -4px; }

.tour { position: fixed; inset: 0; z-index: 20; background: rgba(20, 18, 28, .55); display: grid; place-items: end center; padding: 16px; }
.tour[hidden] { display: none; }
.tour .sheet { background: var(--card); border-radius: 18px; padding: 20px; width: 100%; max-width: 520px; display: grid; gap: 12px; max-height: 88vh; overflow-y: auto; }
@media (min-width: 620px) { .tour { place-items: center; } }
.tour .dots { display: flex; gap: 6px; } .tour .dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--rule); } .tour .dots i.on { background: var(--ink); }
.tour .actions { display: flex; justify-content: space-between; gap: 10px; }
.state { text-align: center; padding: 40px 0; display: grid; gap: 12px; justify-items: center; }
.state[hidden] { display: none; }
@media print { header.top, nav.bottom, .tour, .download, .noprint { display: none !important; } details > summary::after { content: "" !important; } main { padding: 0; } }

/* top bar: "Mi pedido" next to "Salir"; ancestry extras */
.top-actions { display: flex; align-items: center; gap: 14px; }
.top-actions a.small { font-weight: 700; color: inherit; }
ul.anc.facts { margin-top: 14px; } ul.anc.facts li { grid-template-columns: 1fr auto; }
.anc-why { margin-top: 14px; }
