/* reset */
:root { color-scheme: light; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
body { margin: 0; font: 14px/1.4 system-ui, -apple-system, sans-serif; }
img { max-width: 100%; }
[hidden] { display: none !important; }

/* Layout: a collector's album — sticky search band, a dense list of postmark rows, a full detail sheet per postmark, bottom tab bar on phones. */
:root {
  --paper: #EEF0EA;      /* envelope paper */
  --card: #FFFFFF;
  --ink: #18212F;        /* postmark ink */
  --muted: #5A6372;
  --line: #D6DAD2;
  --accent: #23498A;     /* blue cancellation ink */
  --accent-soft: #E3EAF6;
  --brass: #A87A22;      /* stamp-album brass */
  --have: #1E7B34; --have-bg: #DDF0DF;
  --req: #8A5A00; --req-bg: #FCEFC7;
  --dup: #5B2CA0; --dup-bg: #ECE3F8;
  --st-vig: #1E7B34; --st-vig-bg: #E2F0D9;
  --st-sus: #A44A06; --st-sus-bg: #FBE3D2;
  --st-ret: #B0201E; --st-ret-bg: #F8D9D9;
  --st-tra: #6D35D6; --st-tra-bg: #ECE5FA;
  --st-tmp: #1D4ED8; --st-tmp-bg: #DCE7FC;
  --st-his: #4B5563; --st-his-bg: #E5E7EB;
  --img-bg: #FFFFFF;
  --shadow: 0 1px 2px rgba(24,33,47,.06), 0 6px 18px rgba(24,33,47,.06);
  --f-display: "Zilla Slab", "Rockwell", Georgia, serif;
  --f-body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --nav-h: 62px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --paper: #11151B; --card: #1A2029; --ink: #E7EAEE; --muted: #9AA3B0; --line: #2B323D;
  --accent: #8DB0F0; --accent-soft: #1E2A40; --brass: #D7AE5A;
  --have: #6FD08A; --have-bg: #173322; --req: #F1C86A; --req-bg: #3A2E10; --dup: #C3A6F5; --dup-bg: #2D2342;
  --st-vig: #7DD69A; --st-vig-bg: #1A3324; --st-sus: #F2A36B; --st-sus-bg: #3D2717; --st-ret: #F28B8B; --st-ret-bg: #3F1D1D;
  --st-tra: #BDA1F7; --st-tra-bg: #2C2245; --st-tmp: #8EB4FA; --st-tmp-bg: #1B2A47; --st-his: #B6BDC8; --st-his-bg: #2A3039;
  --img-bg: #F4F4F0; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.25); color-scheme: dark; } }
:root[data-theme="dark"] {
  --paper: #11151B; --card: #1A2029; --ink: #E7EAEE; --muted: #9AA3B0; --line: #2B323D;
  --accent: #8DB0F0; --accent-soft: #1E2A40; --brass: #D7AE5A;
  --have: #6FD08A; --have-bg: #173322; --req: #F1C86A; --req-bg: #3A2E10; --dup: #C3A6F5; --dup-bg: #2D2342;
  --st-vig: #7DD69A; --st-vig-bg: #1A3324; --st-sus: #F2A36B; --st-sus-bg: #3D2717; --st-ret: #F28B8B; --st-ret-bg: #3F1D1D;
  --st-tra: #BDA1F7; --st-tra-bg: #2C2245; --st-tmp: #8EB4FA; --st-tmp-bg: #1B2A47; --st-his: #B6BDC8; --st-his-bg: #2A3039;
  --img-bg: #F4F4F0; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.25); color-scheme: dark; }

* { box-sizing: border-box; }
html, body { background: var(--paper); color: var(--ink); }
body { font-family: var(--f-body); font-size: 16px; line-height: 1.45; -webkit-text-size-adjust: 100%; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--paper); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--f-display); text-wrap: balance; margin: 0; }
.wrap { max-width: 1100px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.mono { font-family: var(--f-mono); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- header ---------- */
header.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--paper); border-bottom: 1px solid var(--line); }
.top .wrap { padding-block: 12px 10px; display: grid; gap: 10px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand .seal { flex: none; width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--ink); display: grid; place-items: center; position: relative; }
.brand .seal::after { content: ""; width: 18px; height: 12px; border: 2px dashed var(--ink); border-radius: 2px; }
.brand h1 { font-size: 1.28rem; line-height: 1.05; }
.brand h1 small { display: block; font-family: var(--f-body); font-weight: 400; font-size: .78rem; color: var(--muted); letter-spacing: .02em; }
.brand .grow { flex: 1; min-width: 0; }
.prog { text-align: right; flex: none; }
.prog b { font-family: var(--f-mono); font-size: 1rem; }
.prog .bar { width: 96px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 4px; margin-left: auto; }
.prog .bar i { display: block; height: 100%; background: var(--have); width: 0; transition: width .3s; }
.prog span { font-size: .72rem; color: var(--muted); }
.tabs-desk { display: none; gap: 4px; }
.search { position: relative; }
.search input { width: 100%; padding: 11px 40px 11px 40px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); font-size: 1rem; }
.search input:focus { border-color: var(--accent); outline: none; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.search .clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; width: 32px; height: 32px; border-radius: 8px; color: var(--muted); font-size: 1.2rem; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; margin-inline: -2px; padding-inline: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 12px; font-size: .88rem; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip .n { font-family: var(--f-mono); font-size: .78rem; opacity: .75; }
.chip.filters { border-style: dashed; }
.chip.filters.on { border-style: solid; border-color: var(--accent); color: var(--accent); }

/* ---------- views ---------- */
main { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 90px); }
.view[hidden] { display: none; }
.store-note { font-size: .8rem; color: var(--muted); display: flex; gap: 6px; align-items: center; padding-top: 10px; }
.store-note i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; }
.store-note.ok i { background: var(--have); }
.resultline { font-size: .85rem; color: var(--muted); padding-block: 8px 0; }
.resultbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.resultbar .resultline { flex: 1 1 auto; }
.btn.pdfbtn { padding: 5px 11px; font-size: .82rem; }
.kprog { font-size: .88rem; color: var(--muted); min-height: 1.2em; }
/* list views: Lista / Cuadrícula / Ficha grande */
.resultbar .viewsw { margin-left: auto; }
.viewsw { display: inline-flex; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); }
.viewsw button { all: unset; cursor: pointer; padding: 5px 10px; font-size: .8rem; color: var(--muted); }
.viewsw button + button { border-left: 1px solid var(--line); }
.viewsw button[aria-pressed="true"] { background: var(--accent); color: var(--card); font-weight: 700; }
.viewsw button:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.view-grid .list { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; }
.view-grid.shape-landscape .list { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.view-grid .row { grid-template-columns: minmax(0, 1fr); align-items: start; gap: 8px; padding: 8px; }
.view-grid .row .thumb { width: 100%; height: auto; aspect-ratio: 1 / 1; }
.view-grid .row .thumb.landscape { aspect-ratio: 4 / 3; }
.view-grid .row .thumb.portrait { aspect-ratio: 3 / 4; }
.view-grid .row .txt { padding: 0 2px 2px; }
.view-grid .row .mk { position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }
.view-big .list { grid-template-columns: minmax(0, 1fr); gap: 14px; }
.row.bigrow { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: start; gap: 18px; padding: 14px; }
.row.bigrow .bimgs { display: grid; gap: 10px; align-items: start; }
.row.bigrow .bimgs.two { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.row.bigrow .thumb { width: 100%; height: auto; aspect-ratio: 1 / 1; cursor: pointer; }
.row.bigrow .thumb.landscape { aspect-ratio: 4 / 3; }
.row.bigrow .thumb.portrait { aspect-ratio: 3 / 4; }
.row.bigrow .bextra { display: grid; gap: 10px; }
.row.bigrow figure { margin: 0; }
.row.bigrow figcaption { font-size: .72rem; color: var(--muted); margin-top: 3px; }
.row.bigrow .txt { padding-right: 48px; }
.row.bigrow .mk { position: absolute; top: 14px; right: 14px; }
.row.bigrow .tt { font-size: 1.2rem; -webkit-line-clamp: 3; margin-top: 2px; }
.row.bigrow .bkick { color: var(--muted); }
.bdata { margin: 12px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px 14px; }
.bdata dt, .blong .bl { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.bdata dd { margin: 1px 0 0; font-size: .92rem; overflow-wrap: anywhere; }
.blong { margin-top: 12px; }
.blong p { margin: 2px 0 0; font-size: .88rem; line-height: 1.4; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 719px) { .row.bigrow { grid-template-columns: minmax(0, 1fr); } .row.bigrow .txt { padding-right: 0; } }
@media (max-width: 440px) { .view-grid .list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .view-grid.shape-landscape .list { grid-template-columns: minmax(0, 1fr); } }

.com { margin-top: 22px; content-visibility: auto; contain-intrinsic-size: auto 800px; }
.com > h2 { font-size: 1.45rem; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding-bottom: 6px; border-bottom: 2px solid var(--ink); }
.com > h2 .cnt, .prov h3 .cnt { font-family: var(--f-mono); font-size: .78rem; font-weight: 500; color: var(--muted); }
.prov { margin-top: 14px; }
.prov h3 { font-size: 1.08rem; color: var(--brass); display: flex; gap: 8px; align-items: baseline; margin-bottom: 8px; }
.list { display: grid; gap: 8px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.row { display: grid; grid-template-columns: 76px minmax(0, 1fr) 48px; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px 8px 8px 8px; position: relative; }
.row .open { all: unset; cursor: pointer; display: contents; }
.row .thumb { width: 76px; height: 76px; border-radius: 10px; background: var(--img-bg); display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); }
.row .thumb img { width: 100%; height: 100%; object-fit: contain; }
.row .thumb .noimg { font-size: .62rem; color: #6B7280; text-align: center; padding: 4px; line-height: 1.2; }
.row .txt { min-width: 0; cursor: pointer; }
.row .code { font-family: var(--f-mono); font-size: .74rem; color: var(--brass); font-weight: 600; letter-spacing: .02em; }
.row .pl { font-size: .8rem; font-weight: 600; color: var(--muted); line-height: 1.25; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .tt { font-weight: 700; font-size: .95rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row .meta { font-size: .78rem; color: var(--muted); margin-top: 3px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pill { display: inline-block; font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 999px; line-height: 1.4; }
.e-vig { color: var(--st-vig); background: var(--st-vig-bg); } .e-sus { color: var(--st-sus); background: var(--st-sus-bg); }
.e-ret { color: var(--st-ret); background: var(--st-ret-bg); } .e-tra { color: var(--st-tra); background: var(--st-tra-bg); }
.e-tmp { color: var(--st-tmp); background: var(--st-tmp-bg); } .e-his { color: var(--st-his); background: var(--st-his-bg); }
.mk { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line); background: var(--card); display: grid; place-items: center; transition: transform .12s; }
.mk svg { width: 22px; height: 22px; opacity: 0; }
.mk:active { transform: scale(.92); }
.row.m-tengo { background: var(--have-bg); border-color: var(--have); }
.row.m-tengo .mk { background: var(--have); border-color: var(--have); color: var(--card); }
.row.m-tengo .mk svg { opacity: 1; }
.row.m-solicitado { background: var(--req-bg); border-color: var(--req); }
.row.m-solicitado .mk { border-color: var(--req); color: var(--req); }
.row.m-repetido { background: var(--dup-bg); border-color: var(--dup); }
.row.m-repetido .mk { background: var(--dup); border-color: var(--dup); color: var(--card); }
.row.m-repetido .mk svg { opacity: 1; }
.mtag { font-size: .7rem; font-weight: 700; }
.m-solicitado .mtag { color: var(--req); } .m-repetido .mtag { color: var(--dup); } .m-tengo .mtag { color: var(--have); }

.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 1.1rem; margin-bottom: 6px; font-family: var(--f-display); }
.btn { border: 1.5px solid var(--line); background: var(--card); border-radius: 10px; padding: 9px 14px; font-size: .92rem; display: inline-flex; gap: 8px; align-items: center; text-decoration: none; color: var(--ink); }
.btn.primary { background: var(--accent); color: var(--card); border-color: var(--accent); }
.btn:hover { border-color: var(--accent); }

/* ---------- bottom nav ---------- */
nav.bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); display: grid; grid-template-columns: repeat(3, 1fr); }
nav.bottom button { border: 0; background: none; height: var(--nav-h); display: grid; place-items: center; align-content: center; gap: 2px; font-size: .74rem; color: var(--muted); }
nav.bottom button svg { width: 24px; height: 24px; }
nav.bottom button[aria-current="page"] { color: var(--accent); font-weight: 700; }
@media (min-width: 900px) {
  nav.bottom { display: none; }
  .tabs-desk { display: flex; }
  .tabs-desk button { border: 0; background: none; padding: 8px 12px; border-radius: 8px; color: var(--muted); font-weight: 700; }
  .tabs-desk button[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
  main { padding-bottom: 96px; }
}

/* ---------- sheets (detail + filters) ---------- */
.overlay { position: fixed; inset: 0; z-index: 40; background: rgba(10,14,20,.45); display: flex; justify-content: center; align-items: flex-end; }
.overlay[hidden] { display: none !important; }
.sheet { background: var(--paper); width: 100%; max-width: 760px; max-height: 100%; height: 100%; overflow-y: auto; overscroll-behavior: contain; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
@media (min-width: 800px) { .overlay { align-items: center; padding: 24px; } .sheet { height: auto; max-height: calc(100% - 0px); border-radius: 18px; box-shadow: var(--shadow); } }
.sheet-bar { position: sticky; top: 0; z-index: 2; background: var(--paper); display: flex; align-items: center; gap: 8px; padding-block: 10px; border-bottom: 1px solid var(--line); }
.sheet-bar .t { flex: 1; min-width: 0; font-family: var(--f-mono); font-size: .85rem; color: var(--muted); }
.ibtn { width: 42px; height: 42px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); display: grid; place-items: center; }
.ibtn svg { width: 20px; height: 20px; }
.ibtn:disabled { opacity: .35; cursor: default; }
.det { display: grid; gap: 16px; padding-block: 16px 28px; }
.hero { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .hero { grid-template-columns: 260px minmax(0, 1fr); align-items: start; } }
.bigimg { background: var(--img-bg); border: 1px solid var(--line); border-radius: 16px; aspect-ratio: 1; max-width: 100%; display: grid; place-items: center; overflow: hidden; cursor: zoom-in; }
.bigimg img { width: 92%; height: 92%; object-fit: contain; }
.bigimg.zoom { position: fixed; inset: 0; z-index: 60; border-radius: 0; aspect-ratio: auto; cursor: zoom-out; border: 0; padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
.bigimg.zoom img { width: min(96vw, 96vh); height: auto; }
.bigimg .noimg { color: #6B7280; font-size: .9rem; text-align: center; padding: 20px; }
.htxt { display: grid; gap: 10px; min-width: 0; }
.htxt .code { font-family: var(--f-mono); color: var(--brass); font-weight: 600; }
.htxt h2 { font-size: 1.6rem; line-height: 1.15; }
.fechador { display: inline-flex; align-items: center; gap: 10px; font-family: var(--f-mono); font-weight: 600; font-size: 1rem; letter-spacing: .08em; padding: 6px 12px; border: 2px dashed var(--ink); border-radius: 6px; width: fit-content; }
.fechador small { font-family: var(--f-body); font-weight: 400; letter-spacing: 0; font-size: .74rem; color: var(--muted); }
.place { color: var(--muted); font-size: .95rem; }
.box { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 10px; }
.box h3 { font-family: var(--f-body); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.seg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.seg button { border: 1.5px solid var(--line); background: var(--card); border-radius: 10px; padding: 9px 4px; font-size: .84rem; display: grid; gap: 2px; place-items: center; line-height: 1.15; }
.seg button span { font-size: 1.1rem; }
.seg button[aria-pressed="true"][data-m=""] { border-color: var(--ink); background: var(--paper); font-weight: 700; }
.seg button[aria-pressed="true"][data-m="tengo"] { border-color: var(--have); background: var(--have-bg); color: var(--have); font-weight: 700; }
.seg button[aria-pressed="true"][data-m="solicitado"] { border-color: var(--req); background: var(--req-bg); color: var(--req); font-weight: 700; }
.seg button[aria-pressed="true"][data-m="repetido"] { border-color: var(--dup); background: var(--dup-bg); color: var(--dup); font-weight: 700; }
.mine { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .mine { grid-template-columns: 180px minmax(0, 1fr); } }
.mine label { display: grid; gap: 4px; font-size: .8rem; color: var(--muted); }
.mine input, .mine textarea { border: 1.5px solid var(--line); background: var(--paper); border-radius: 10px; padding: 9px 10px; font-size: .95rem; width: 100%; color: var(--ink); }
.mine textarea { min-height: 44px; resize: vertical; }
.saved { font-size: .75rem; color: var(--have); min-height: 1em; }
.addr { font-size: 1rem; line-height: 1.4; user-select: text; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.notes { font-size: .95rem; line-height: 1.5; }
dl.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: .92rem; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; min-width: 0; }
.estado-exp { font-size: .82rem; color: var(--muted); }
.rel { display: grid; grid-auto-flow: column; grid-auto-columns: 112px; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.rel button { all: unset; cursor: pointer; display: grid; gap: 4px; font-size: .74rem; line-height: 1.2; }
.rel button:focus-visible { outline: 3px solid var(--accent); border-radius: 8px; }
.rel .rimg { width: 112px; height: 112px; background: var(--img-bg); border: 1px solid var(--line); border-radius: 10px; display: grid; place-items: center; overflow: hidden; }
.rel .rimg img { width: 92%; height: 92%; object-fit: contain; }
.rel .rc { font-family: var(--f-mono); color: var(--brass); }
.rel .have { color: var(--have); font-weight: 700; }

.fgrid { display: grid; gap: 12px; padding-block: 16px; }
.fgrid label { display: grid; gap: 4px; font-size: .82rem; color: var(--muted); font-weight: 700; }
.fgrid select { padding: 10px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--card); font-size: 1rem; color: var(--ink); }
.factions { display: flex; gap: 8px; justify-content: space-between; padding-bottom: 20px; }

/* ---------- progress + guide ---------- */
.big { display: grid; gap: 14px; grid-template-columns: 1fr; padding-top: 18px; }
@media (min-width: 720px) { .big { grid-template-columns: 1.2fr 1fr; } }
.ring { display: flex; gap: 18px; align-items: center; }
.ring svg { width: 120px; height: 120px; flex: none; }
.ring .num { font-family: var(--f-mono); font-size: 2rem; font-weight: 600; }
.ring .lab { color: var(--muted); font-size: .9rem; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.kpi b { font-family: var(--f-mono); font-size: 1.3rem; display: block; }
.kpi span { font-size: .78rem; color: var(--muted); }
.bars { display: grid; gap: 4px; }
.barrow { all: unset; cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) 84px; gap: 4px 10px; align-items: center; padding: 8px 10px; border-radius: 10px; }
.barrow:hover, .barrow:focus-visible { background: var(--card); }
.barrow .nm { font-size: .92rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barrow .ct { font-family: var(--f-mono); font-size: .8rem; text-align: right; color: var(--muted); }
.barrow .tr { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.barrow .tr i { display: block; height: 100%; background: var(--have); border-radius: 4px; }
.sec-h { font-size: 1.25rem; margin: 26px 0 10px; }
.guide { display: grid; gap: 14px; padding-top: 18px; max-width: 760px; }
.guide p, .guide li { line-height: 1.55; }
.guide ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.legend { display: grid; gap: 8px; }
.legend div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px; align-items: start; font-size: .92rem; }
/* ---------- add / edit ---------- */
.fab { position: fixed; z-index: 24; right: max(16px, calc(env(safe-area-inset-right, 0px) + 16px)); bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 16px); border: 0; border-radius: 999px; background: var(--accent); color: var(--card); padding: 13px 18px 13px 14px; font-weight: 700; font-size: .95rem; display: inline-flex; gap: 8px; align-items: center; box-shadow: var(--shadow); }
.fab svg { width: 20px; height: 20px; }
@media (min-width: 900px) { .fab { bottom: 24px; } }
.otag { display: inline-block; font-size: .64rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; border: 1.5px dashed var(--brass); color: var(--brass); line-height: 1.3; }
.editnote { font-size: .82rem; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ef { display: grid; gap: 14px; padding-block: 16px 8px; }
.ef .two { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .ef .two { grid-template-columns: 1fr 1fr; } }
.ef label { display: grid; gap: 4px; font-size: .82rem; color: var(--muted); font-weight: 700; min-width: 0; }
.ef label small { font-weight: 400; }
.ef input, .ef select, .ef textarea { border: 1.5px solid var(--line); background: var(--card); border-radius: 10px; padding: 10px; font-size: 1rem; width: 100%; color: var(--ink); font-weight: 400; }
.ef textarea { min-height: 70px; resize: vertical; }
.ef input:focus, .ef select:focus, .ef textarea:focus { border-color: var(--accent); outline: none; }
.ef .err { color: var(--st-ret); font-size: .85rem; min-height: 1em; }
.photo { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; align-items: center; }
.photo .pv { width: 120px; height: 120px; border-radius: 12px; border: 1px solid var(--line); background: var(--img-bg); display: grid; place-items: center; overflow: hidden; color: #6B7280; font-size: .75rem; text-align: center; }
.photo .pv img { width: 100%; height: 100%; object-fit: contain; }
.photo .pb { display: flex; gap: 8px; flex-wrap: wrap; }
.photo input[type=file] { display: none; }
.eactions { display: flex; gap: 8px; justify-content: space-between; flex-wrap: wrap; padding-bottom: 24px; }
.btn.danger { color: var(--st-ret); border-color: var(--st-ret-bg); }
.btn.danger.armed { background: var(--st-ret); color: var(--card); border-color: var(--st-ret); }
.btn:disabled { opacity: .5; cursor: default; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 14px); z-index: 70; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 12px; font-size: .9rem; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
@media (min-width: 900px) { .toast { bottom: 24px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- self-hosted additions ---------- */
nav.bottom { grid-template-columns: repeat(4, 1fr); }
.hdr-actions { display: flex; gap: 6px; flex: none; }
.hdr-actions .ibtn { width: 38px; height: 38px; border-radius: 10px; }
.auth { min-height: 100%; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-left, 0px)); }
.auth .card { width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 24px; display: grid; gap: 14px; box-shadow: var(--shadow); }
.auth h1 { font-size: 1.5rem; display: flex; gap: 12px; align-items: center; }
.auth p { margin: 0; color: var(--muted); font-size: .92rem; }
.auth label { display: grid; gap: 4px; font-size: .85rem; font-weight: 700; color: var(--muted); }
.auth input { border: 1.5px solid var(--line); background: var(--paper); border-radius: 10px; padding: 11px; font-size: 1rem; color: var(--ink); }
.auth .err { color: var(--st-ret); font-size: .9rem; min-height: 1.2em; }
.auth .btn { justify-content: center; padding: 12px; font-size: 1rem; }
.hist-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding-top: 18px; }
.hist-tools .grow { flex: 1; min-width: 0; }
.hist-tools .hsearch { flex: 1 1 220px; min-width: 0; }
.hist-tools .hsearch input { padding: 9px 36px; border-radius: 10px; font-size: .92rem; }
.hist-tools .hsearch input::-webkit-search-cancel-button { display: none; }
.hist-tools select { padding: 9px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font-size: .92rem; }
.next-undo { font-size: .82rem; color: var(--muted); padding-top: 8px; }
.day { font-family: var(--f-display); font-size: 1.05rem; margin: 20px 0 8px; color: var(--brass); }
.hlist { display: grid; gap: 6px; }
.hitem { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: start; }
.hitem .ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 1rem; background: var(--accent-soft); color: var(--accent); }
.hitem.mark .ic, .hitem.imark .ic { background: var(--have-bg); color: var(--have); }
.hitem .sm { font-size: .93rem; line-height: 1.35; overflow-wrap: anywhere; }
.hitem .meta2 { font-size: .76rem; color: var(--muted); margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hitem.undone { opacity: .55; }
.hitem.undone .sm { text-decoration: line-through; }
.hitem .lnk { all: unset; cursor: pointer; color: var(--accent); font-weight: 700; }
.hitem .lnk:focus-visible { outline: 3px solid var(--accent); border-radius: 4px; }
.ubadge { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 1px 6px; border-radius: 999px; background: var(--line); color: var(--muted); }
.mini-hist { display: grid; gap: 8px; }
.mini-hist .mh { display: grid; gap: 4px; padding: 8px 0; border-top: 1px solid var(--line); font-size: .88rem; }
.mini-hist .mh:first-child { border-top: 0; }
.mini-hist .mh .when { font-size: .76rem; color: var(--muted); }
.users { display: grid; gap: 8px; }
.uitem { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.uitem:first-child { border-top: 0; }
.uitem .who b { display: block; }
.uitem .who span { font-size: .8rem; color: var(--muted); }
.uitem .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.uitem select { padding: 7px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); }
.form-inline { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .form-inline { grid-template-columns: 1fr 1fr; } }
.form-inline label { display: grid; gap: 4px; font-size: .8rem; color: var(--muted); font-weight: 700; }
.form-inline input, .form-inline select { border: 1.5px solid var(--line); background: var(--paper); border-radius: 10px; padding: 9px 10px; font-size: .95rem; color: var(--ink); }
.small-err { color: var(--st-ret); font-size: .85rem; min-height: 1em; }
.loading { padding: 60px 16px; text-align: center; color: var(--muted); }
@media (max-width: 480px) {
  .brand { gap: 8px; }
  .brand h1 { font-size: 1.12rem; }
  .brand h1 small { display: none; }
  .prog .bar { width: 58px; }
  .prog span { display: none; }
  .hdr-actions .ibtn { width: 34px; height: 34px; }
  nav.bottom button { font-size: .7rem; }
}

/* ---------- home ---------- */
.home-hero { padding-top: 22px; display: grid; gap: 4px; }
.home-hero h2 { font-size: 1.7rem; }
.home-hero p { margin: 0; color: var(--muted); }
.sections { display: grid; gap: 14px; grid-template-columns: 1fr; margin-top: 18px; }
@media (min-width: 720px) { .sections { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .sections { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.scard { background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; display: grid; grid-template-rows: auto 1fr; box-shadow: var(--shadow); }
.scard .mosaic { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; background: var(--line); }
.scard .mosaic span { aspect-ratio: 1; background: var(--img-bg); display: grid; place-items: center; overflow: hidden; }
.scard .mosaic img { width: 88%; height: 88%; object-fit: contain; }
.scard .body { padding: 16px; display: grid; gap: 10px; align-content: start; }
.scard h3 { font-size: 1.3rem; }
.scard p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.45; }
.scard .pbar { height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; }
.scard .pbar i { display: block; height: 100%; background: var(--have); border-radius: 5px; }
.scard .pnum { display: flex; justify-content: space-between; gap: 8px; font-size: .85rem; color: var(--muted); flex-wrap: wrap; }
.scard .pnum b { font-family: var(--f-mono); color: var(--ink); }
.scard.soon { border-style: dashed; border-width: 2px; box-shadow: none; background: transparent; }
.scard.soon .ph { aspect-ratio: 4 / 1; display: grid; place-items: center; color: var(--muted); font-family: var(--f-display); font-size: 1.05rem; border-bottom: 2px dashed var(--line); }
.scard.add { cursor: pointer; border-style: dashed; border-width: 2px; background: transparent; box-shadow: none; place-items: center; min-height: 160px; grid-template-rows: 1fr; color: var(--accent); font-weight: 700; }
.scard.add:hover, .scard.add:focus-visible { background: var(--accent-soft); }
.scard input, .scard textarea { border: 1.5px solid var(--line); background: var(--paper); border-radius: 10px; padding: 9px 10px; font-size: .95rem; width: 100%; color: var(--ink); }
.recent { margin-top: 26px; }
.recent h2 { font-size: 1.2rem; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.recent h2 button { all: unset; cursor: pointer; font-family: var(--f-body); font-size: .9rem; color: var(--accent); font-weight: 700; }
.vbadge { font-size: .66rem; font-weight: 700; padding: 1px 6px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.tokbox { font-family: var(--f-mono); font-size: .82rem; background: var(--paper); border: 1.5px dashed var(--brass); border-radius: 10px; padding: 10px; overflow-wrap: anywhere; user-select: all; }
pre.cmd { margin: 0; font-family: var(--f-mono); font-size: .78rem; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 10px; overflow-x: auto; white-space: pre; }

/* ---------- generic sections ---------- */
.sec-top { display: grid; gap: 10px; padding-top: 16px; }
.sec-top h2 { font-size: 1.5rem; }
.sec-top p { margin: 0; color: var(--muted); }
.sec-prog { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.sec-prog .pbar { flex: 1; min-width: 160px; height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; }
.sec-prog .pbar i { display: block; height: 100%; background: var(--have); }
.sec-prog span { font-size: .85rem; color: var(--muted); }
.sec-tools { display: grid; gap: 10px; padding-block: 12px 4px; }
.sec-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.sec-filters select { padding: 8px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font-size: .88rem; max-width: 100%; }
.thumb.portrait { aspect-ratio: 3 / 4; height: auto; }
.thumb.landscape { aspect-ratio: 4 / 3; height: auto; }
.gfacts dd { white-space: pre-wrap; }
.ef .check { display: flex; gap: 8px; align-items: center; font-weight: 700; }
.ef .check input { width: auto; }
.settings-form { display: grid; gap: 12px; }
.settings-form label { display: grid; gap: 4px; font-size: .8rem; color: var(--muted); font-weight: 700; }
.settings-form input, .settings-form select, .settings-form textarea { border: 1.5px solid var(--line); background: var(--paper); border-radius: 10px; padding: 9px 10px; font-size: .95rem; color: var(--ink); width: 100%; }
.settings-form input[type=color] { padding: 2px; height: 42px; }
.settings-form textarea.code { font-family: var(--f-mono); font-size: .82rem; min-height: 120px; }

/* ---------- section tabs + sections list ---------- */
.sectabs { display: inline-grid; grid-auto-flow: column; gap: 4px; padding: 4px; margin-top: 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.sectabs button { border: 0; background: none; padding: 8px 18px; border-radius: 9px; font-weight: 700; color: var(--muted); font-size: .92rem; }
.sectabs button[aria-selected="true"] { background: var(--accent); color: var(--card); }
.seclist { display: grid; gap: 10px; padding-top: 18px; }
.secrow { all: unset; cursor: pointer; box-sizing: border-box; display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px 10px 10px; }
.secrow:hover, .secrow:focus-visible { border-color: var(--accent); }
.secrow:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.secrow .si { width: 64px; height: 64px; border-radius: 10px; background: var(--img-bg); border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; color: #6B7280; font-size: 1.5rem; }
.secrow .si img { width: 90%; height: 90%; object-fit: contain; }
.secrow b { display: block; font-family: var(--f-display); font-size: 1.08rem; }
.secrow .sd { font-size: .82rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.secrow .pbar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 6px; }
.secrow .pbar i { display: block; height: 100%; background: var(--have); }
.secrow .num { font-family: var(--f-mono); font-size: .85rem; color: var(--muted); text-align: right; }
.secrow.soon { border-style: dashed; }
.secrow .last { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); }
.resume { display: inline-flex; margin-top: 10px; }

/* ---------- envelope printing ---------- */
.env fieldset { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin: 0; display: grid; gap: 10px; background: var(--card); min-width: 0; }
.env legend { font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 0 6px; }
.env .opt { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: start; font-weight: 700; font-size: .92rem; color: var(--ink); }
.env .opt input[type=radio], .env .opt input[type=checkbox] { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); }
.env .sub { margin-left: 26px; display: grid; gap: 8px; min-width: 0; }
.env .sub[hidden] { display: none; }
.env-preview { position: relative; width: 100%; max-width: 560px; margin: 0 auto; background: #FFFDF8; border: 1px solid #C9C4B5; border-radius: 4px; box-shadow: var(--shadow); color: #1A1A1A; overflow: hidden; font-family: Helvetica, Arial, sans-serif; }
.env-preview .p-abs { position: absolute; white-space: pre; line-height: 1.25; }
.env-preview .p-stamp { position: absolute; border: 1.5px dashed #8A8A8A; display: grid; place-items: center; color: #8A8A8A; font-size: 10px; letter-spacing: .1em; }
.env-preview .p-label { font-size: 7px; color: #777; text-transform: uppercase; letter-spacing: .08em; }
.env-pages { display: grid; gap: 14px; }
.env-pages h4 { margin: 0 0 6px; font-size: .78rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.addr-list { display: grid; gap: 8px; }
.addr-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.addr-item:first-child { border-top: 0; }
.addr-item pre { margin: 4px 0 0; font-family: var(--f-body); font-size: .85rem; color: var(--muted); white-space: pre-wrap; }
.sbadge { font-size: .64rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--have-bg); color: var(--have); margin-left: 6px; text-transform: uppercase; letter-spacing: .04em; }

/* ---------- "Más" menu ---------- */
.more-menu { position: fixed; z-index: 45; min-width: 240px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.25); padding: 6px; display: grid; gap: 2px; }
.more-menu button { all: unset; cursor: pointer; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; align-items: center; padding: 11px 12px; border-radius: 10px; font-size: .95rem; color: var(--ink); }
.more-menu button:hover, .more-menu button:focus-visible { background: var(--accent-soft); }
.more-menu button[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.more-menu svg { width: 20px; height: 20px; color: var(--muted); }
.more-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 6px; }
.page-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.page-h h2 { font-size: 1.6rem; }
/* ---------- contacts ---------- */
.ctools { display: grid; gap: 10px; }
.ctools .row1 { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ctools select { padding: 9px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); }
.clist { display: grid; gap: 8px; }
.crow { all: unset; cursor: pointer; box-sizing: border-box; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px 10px 10px; }
.crow:hover, .crow:focus-visible { border-color: var(--accent); }
.crow:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.crow .av { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .95rem; background: var(--accent-soft); color: var(--accent); }
.crow .cn { font-weight: 700; display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.crow .cn small { font-weight: 400; color: var(--muted); font-family: var(--f-mono); font-size: .76rem; }
.crow .cl { font-size: .84rem; color: var(--muted); }
.crow .ct { font-size: .78rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.crow .ck { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); text-align: right; }
.env-lines { white-space: pre-wrap; font-family: Helvetica, Arial, sans-serif; background: #FFFDF8; color: #1A1A1A; border: 1px solid #C9C4B5; border-radius: 6px; padding: 12px 14px; font-size: .95rem; line-height: 1.35; }
.env-lines::first-line { font-weight: 700; }
@media (max-width: 560px) { .crow { grid-template-columns: 44px minmax(0, 1fr); } .crow .ck { display: none; } }

.ef .enote { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); font-size: .88rem; }
#eCodeSug { justify-self: start; margin-top: -6px; }

/* sections with several images (e.g. front and back of an envelope) */
.photos { display: grid; gap: 14px; }
@media (min-width: 640px) { .photos { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); } }
.photo-slot .plabel { font-weight: 700; font-size: .9rem; margin-bottom: 6px; }
.himgs { display: grid; gap: 8px; min-width: 0; }
.imgswitch { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; }
.imgswitch button { border: 1.5px solid var(--line); background: var(--card); border-radius: 10px; padding: 6px; font-size: .8rem; display: grid; gap: 4px; place-items: center; line-height: 1.15; color: inherit; }
.imgswitch button img { width: 100%; height: 44px; object-fit: contain; background: var(--img-bg); border-radius: 6px; }
.imgswitch button[aria-pressed="true"] { border-color: var(--ink); font-weight: 700; }
.bigimg.landscape:not(.zoom) { aspect-ratio: 4 / 3; }
.bigimg.portrait:not(.zoom) { aspect-ratio: 3 / 4; }
.ef select { width: 100%; }
.ef label[hidden] { display: none; }
html.dark-img .noimg, html.dark-img .photo .pv { color: #C9CCD1 !important; }
.seg.seg2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.seg button[aria-pressed="true"][data-nm="solicitado"] { border-color: var(--req); background: var(--req-bg); color: var(--req); font-weight: 700; }
.seg button[aria-pressed="true"][data-nm="repetido"] { border-color: var(--dup); background: var(--dup-bg); color: var(--dup); font-weight: 700; }
.htxt .kicker { margin-top: 4px; font-size: .95rem; font-weight: 700; letter-spacing: .03em; color: var(--accent); line-height: 1.2; }
.htxt .kicker + h2 { margin-top: -6px; }
/* history detail («Ver detalle») */
.hdbtn { all: unset; cursor: pointer; color: var(--accent); font-weight: 700; font-size: .76rem; }
.hdbtn:focus-visible { outline: 3px solid var(--accent); border-radius: 4px; }
.mini-hist .hdbtn { justify-self: start; }
.hdet { margin-top: 8px; display: grid; gap: 8px; }
.hd-it { border-left: 3px solid var(--accent-soft); padding: 2px 0 2px 10px; display: grid; gap: 4px; }
.hd-h { font-size: .86rem; font-weight: 600; overflow-wrap: anywhere; }
.hd-h .lnk { all: unset; cursor: pointer; color: var(--accent); font-weight: 700; }
.hd-h .lnk:focus-visible { outline: 3px solid var(--accent); border-radius: 4px; }
.hd-act { font-size: .66rem; font-weight: 700; padding: 1px 6px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); margin-left: 4px; }
.hd-act.delete { background: var(--line); color: var(--muted); }
.hd-f { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 3px 10px; font-size: .82rem; }
.hd-f dt { color: var(--muted); }
.hd-f dd { margin: 0; overflow-wrap: anywhere; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.hd-b { color: var(--muted); text-decoration: line-through; }
.hd-a { font-weight: 600; }
.hd-empty, .hd-arr { color: var(--muted); }
.hd-f img { height: 56px; width: auto; border-radius: 6px; border: 1px solid var(--line); background: var(--card); }
@media (max-width: 520px) { .hd-f { grid-template-columns: minmax(0, 1fr); } .hd-f dt { margin-top: 4px; } }
