/* Kit de documentos para psicólogos — estilos. Azul marino profundo + dorado, serif para títulos. */
:root {
  --bg: #08111f;
  --bg2: #0c1729;
  --panel: #0f1d33;
  --card: #12233c;
  --card2: #162a47;
  --line: rgba(212, 176, 106, .16);
  --line2: rgba(212, 176, 106, .32);
  --gold: #d4b06a;
  --gold2: #e9cf96;
  --gold3: #b8924a;
  --ink: #ede6d6;
  --muted: #9aa7ba;
  --muted2: #75839a;
  --ok: #7fc8a0;
  --danger: #e59a8a;
  --paper: #fbf9f4;
  --paper-ink: #1b2b45;
  --paper-muted: #5a6475;
  --paper-rule: #a9b1be;
  --banda: #1f3556;
  --radius: 14px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --side: 272px;
  --tabbar: 64px;
  color-scheme: dark;
}
:root[lang="he"] {
  --serif: "New Peninim MT", "Times New Roman", "David", "Narkisim", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Arial Hebrew", Arial, sans-serif;
}
:root[lang="ja"] {
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", serif;
  --sans: -apple-system, "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden;
  background-image: radial-gradient(1200px 600px at 85% -10%, rgba(212,176,106,.07), transparent 60%),
                    radial-gradient(900px 500px at -10% 110%, rgba(44,78,128,.18), transparent 60%);
  background-attachment: fixed;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
[dir="rtl"] .ic.flip { transform: scaleX(-1); }
.psi, .escudo { flex: none; color: var(--gold); }
.psi path, .escudo path { stroke-linecap: butt; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- Acceso ---------- */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.gate-card { width: 100%; max-width: 420px; text-align: center; padding: 40px 28px 30px; background: linear-gradient(180deg, var(--panel), var(--bg2));
  border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.03); }
.gate .escudo { width: 84px; height: 84px; margin: 0 auto 18px; display: block; }
.brand-name { font-family: var(--serif); font-size: 26px; line-height: 1.15; letter-spacing: .06em; text-transform: uppercase; margin: 0; color: var(--ink); font-weight: 500; }
:root[lang="he"] .brand-name, :root[lang="ja"] .brand-name { letter-spacing: .01em; }
.brand-sub { margin: 10px 0 0; color: var(--gold); font-size: 12px; letter-spacing: .32em; text-transform: uppercase; }
:root[lang="he"] .brand-sub { letter-spacing: .08em; font-size: 14px; }
.gate-rule { width: 64px; height: 1px; background: var(--gold3); margin: 24px auto; opacity: .7; }
.gate h2 { font: 500 19px/1.3 var(--serif); margin: 0 0 6px; }
.gate p { color: var(--muted); margin: 0 0 20px; font-size: 14px; }
.gate form { display: grid; gap: 12px; }
.gate .help { margin: 22px 0 0; font-size: 13px; color: var(--muted2); }
.gate .help a { color: var(--gold2); border-bottom: 1px solid var(--line2); }
.gate .err { color: var(--danger); font-size: 13px; min-height: 18px; margin: 0; }
.input { width: 100%; height: 48px; padding: 0 16px; background: rgba(255,255,255,.035); border: 1px solid var(--line2); border-radius: 12px; outline: none; transition: border .15s, background .15s; }
.input:focus { border-color: var(--gold); background: rgba(255,255,255,.06); }
.gate .input { text-align: center; letter-spacing: .14em; font-size: 17px; text-transform: uppercase; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 11px;
  border: 1px solid var(--line2); background: rgba(255,255,255,.03); color: var(--ink); font-weight: 500; font-size: 14px; white-space: nowrap; transition: background .15s, border .15s, transform .1s; }
.btn:hover { background: rgba(212,176,106,.08); border-color: var(--gold3); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, #e2c27f, #c69d52); color: #1a1407; border-color: transparent; box-shadow: 0 6px 18px rgba(212,176,106,.22); }
.btn.primary:hover { background: linear-gradient(180deg, #ebcd8d, #cfa75c); }
.btn.big { height: 50px; font-size: 16px; border-radius: 12px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.danger:hover { border-color: var(--danger); color: var(--danger); background: rgba(229,154,138,.06); }
.btn .ic { width: 18px; height: 18px; }
.iconbtn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--muted); }
.iconbtn:hover { color: var(--gold2); background: rgba(212,176,106,.08); }
.iconbtn.on { color: var(--gold); }
.iconbtn.on .ic { fill: var(--gold); }

/* ---------- Estructura ---------- */
.shell { min-height: 100vh; }
.side { position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--side); background: linear-gradient(180deg, #0b1628, #08111f);
  border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; z-index: 20; }
.side-brand { display: flex; align-items: center; gap: 12px; padding: 22px 20px 18px; border-bottom: 1px solid var(--line); }
.side-brand .escudo { width: 44px; height: 44px; }
.side-brand b { display: block; font: 500 17px/1.18 var(--serif); letter-spacing: .01em; }
:root[lang="he"] .side-brand b, :root[lang="ja"] .side-brand b { letter-spacing: 0; font-size: 17px; }
.side-brand small { display: block; color: var(--gold); font-size: 9.5px; letter-spacing: .2em; text-transform: uppercase; margin-top: 6px; }
:root[lang="he"] .side-brand small { letter-spacing: .04em; font-size: 12px; }
.side nav { flex: 1; overflow-y: auto; padding: 12px 10px 20px; scrollbar-width: thin; scrollbar-color: #24395a transparent; }
.side-h { margin: 18px 12px 6px; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted2); }
:root[lang="he"] .side-h { letter-spacing: .04em; font-size: 12.5px; }
.nav-a { position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: #c5cedc; font-size: 14px; line-height: 1.3; }
.nav-a .ic { color: var(--gold); opacity: .85; }
.nav-a:hover { background: rgba(255,255,255,.035); color: var(--ink); }
.nav-a.on { background: linear-gradient(90deg, rgba(212,176,106,.14), rgba(212,176,106,.03)); color: var(--ink); }
[dir="rtl"] .nav-a.on { background: linear-gradient(270deg, rgba(212,176,106,.14), rgba(212,176,106,.03)); }
.nav-a.on::before { content: ""; position: absolute; inset-inline-start: -10px; inset-block: 8px; width: 3px; border-radius: 3px; background: var(--gold); }
.nav-a .n { margin-inline-start: auto; font-size: 11.5px; color: var(--muted2); font-variant-numeric: tabular-nums; }
.nav-a .dot { margin-inline-start: auto; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.main { margin-inline-start: var(--side); min-height: 100vh; }
.topbar { display: none; }
.tabbar { display: none; }
.view { max-width: 1180px; margin: 0 auto; padding: 34px 40px 80px; }
.offline { position: fixed; inset-block-end: 16px; inset-inline-end: 16px; z-index: 60; background: #2a2414; color: var(--gold2); border: 1px solid var(--gold3); padding: 8px 14px; border-radius: 10px; font-size: 13px; }

/* ---------- Encabezados ---------- */
.eyebrow { color: var(--gold); font-size: 11.5px; letter-spacing: .22em; text-transform: uppercase; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
:root[lang="he"] .eyebrow { letter-spacing: .04em; font-size: 13px; }
.h1 { font: 500 34px/1.15 var(--serif); margin: 0; letter-spacing: .005em; }
.h2 { font: 500 22px/1.25 var(--serif); margin: 0; }
.lead { color: var(--muted); margin: 10px 0 0; max-width: 70ch; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 42px 0 16px; }
.sec-head a { color: var(--gold2); font-size: 13px; }
.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13.5px; margin-bottom: 18px; }
.crumb:hover { color: var(--gold2); }
.crumb .ic { width: 16px; height: 16px; }

/* ---------- Inicio ---------- */
.hero { position: relative; overflow: hidden; border-radius: 22px; padding: 34px 36px; border: 1px solid var(--line);
  background: linear-gradient(135deg, #13284a 0%, #0d1b31 55%, #0a1526 100%); box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.hero::after { content: ""; position: absolute; inset-inline-end: -40px; inset-block-start: -60px; width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(212,176,106,.16), transparent 65%); pointer-events: none; }
.hero .psi-bg { position: absolute; inset-inline-end: 34px; inset-block-start: 22px; width: 150px; height: 150px; color: rgba(212,176,106,.10); }
.hero .greet { color: var(--gold2); font: italic 400 17px/1.3 var(--serif); margin: 0 0 6px; }
.hero .count { font: 500 36px/1.12 var(--serif); margin: 0; max-width: 18ch; }
.hero .count b { color: var(--gold); font-weight: 500; }
.hero .sub { color: var(--muted); margin: 10px 0 22px; max-width: 54ch; }
.search { position: relative; max-width: 560px; }
.search .ic { position: absolute; inset-inline-start: 16px; top: 50%; transform: translateY(-50%); color: var(--gold); }
.search input { width: 100%; height: 52px; padding-inline: 48px 16px; border-radius: 14px; border: 1px solid var(--line2); background: rgba(5,11,22,.55); outline: none; font-size: 15.5px; }
.search input::placeholder { color: var(--muted2); }
.search input:focus { border-color: var(--gold); background: rgba(5,11,22,.8); }
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.cat { position: relative; display: flex; flex-direction: column; gap: 14px; min-height: 150px; padding: 20px; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--card), #0f1f37); border: 1px solid var(--line); transition: transform .15s, border-color .15s, box-shadow .15s; }
.cat:hover { transform: translateY(-2px); border-color: var(--line2); box-shadow: 0 14px 30px rgba(0,0,0,.3); }
.cat .ico { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line2); color: var(--gold); background: rgba(212,176,106,.06); }
.cat .ico .ic { width: 24px; height: 24px; stroke-width: 1.4; }
.cat h3 { margin: 0; font: 500 16.5px/1.28 var(--serif); }
.cat .meta { margin-top: auto; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12.5px; }
.cat .meta .ic { width: 16px; height: 16px; color: var(--gold); }
.cat .num { position: absolute; inset-block-start: 18px; inset-inline-end: 20px; font: italic 13px var(--serif); color: var(--muted2); }
.cat.empty { opacity: .55; }
.empty-note { color: var(--muted); padding: 22px; border: 1px dashed var(--line2); border-radius: var(--radius); font-size: 14px; }
.news-teaser { display: flex; align-items: center; gap: 14px; margin-top: 18px; padding: 14px 18px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.02); color: var(--muted); font-size: 14px; }
.news-teaser .ic { color: var(--gold); }
.news-teaser b { color: var(--ink); font-weight: 500; }
.news-teaser .go { margin-inline-start: auto; color: var(--gold2); }

/* ---------- Tarjetas de documento ---------- */
.dgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.dcard { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 18px 18px 14px; min-height: 168px; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--card), #0f1f37); border: 1px solid var(--line); transition: transform .15s, border-color .15s, box-shadow .15s; }
.dcard:hover { transform: translateY(-2px); border-color: var(--line2); box-shadow: 0 14px 30px rgba(0,0,0,.3); }
.dcard .top { display: flex; align-items: flex-start; gap: 12px; }
.dcard .top > .ic { width: 30px; height: 30px; color: var(--gold); stroke-width: 1.25; margin-top: 2px; }
.dcard h3 { margin: 0; font: 500 16px/1.3 var(--serif); }
.dcard h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.dcard p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.dcard .foot { margin-top: auto; display: flex; align-items: center; gap: 4px; position: relative; z-index: 1; }
.dcard .foot .id { margin-inline-end: auto; color: var(--muted2); font-size: 11.5px; letter-spacing: .08em; }
.dcard .iconbtn { width: 36px; height: 36px; }
.dcard .dl { border: 1px solid var(--line2); border-radius: 50%; color: var(--gold); }
.dcard .catname { color: var(--gold); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
:root[lang="he"] .dcard .catname { letter-spacing: .02em; font-size: 12px; }
.dcard .snip { color: var(--muted2); font-size: 12.5px; -webkit-line-clamp: 2; }
.dcard mark, .snip mark { background: rgba(212,176,106,.25); color: var(--ink); border-radius: 3px; padding: 0 1px; }
.cat-head { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 28px; }
.cat-head .ico { width: 64px; height: 64px; flex: none; display: grid; place-items: center; border-radius: 16px; border: 1px solid var(--line2); color: var(--gold); background: rgba(212,176,106,.06); }
.cat-head .ico .ic { width: 32px; height: 32px; stroke-width: 1.3; }
.search-page .search { max-width: none; margin-bottom: 14px; }
.result-n { color: var(--muted); margin: 0 0 18px; font-size: 14px; }

/* ---------- Documento ---------- */
.doc-head { margin-bottom: 18px; }
.doc-head .h1 { font-size: 32px; max-width: 30ch; }
.toolbar { position: sticky; top: 0; z-index: 15; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 0; margin: 6px 0 18px;
  background: linear-gradient(180deg, var(--bg) 70%, rgba(8,17,31,0)); }
.toolbar .sp { flex: 1; }
.saved { position: absolute; inset-inline-end: 48px; top: 100%; margin-top: -8px; color: var(--ok); font-size: 12.5px; opacity: 0; transition: opacity .3s; display: inline-flex; align-items: center; gap: 4px; pointer-events: none; white-space: nowrap; }
.toolbar > * { flex: none; }
.saved.show { opacity: 1; }
.saved .ic { width: 15px; height: 15px; }
.legal-note, .ph-legend { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: 12px; font-size: 13.5px; margin-bottom: 12px; }
.legal-note { background: rgba(212,176,106,.07); border: 1px solid var(--line2); color: #d8ccb1; }
.legal-note .ic, .ph-legend .ic { color: var(--gold); margin-top: 1px; }
.ph-legend { background: rgba(255,226,120,.06); border: 1px solid rgba(255,226,120,.22); color: #e3dcc6; }
.ph-legend b { display: block; color: var(--ink); font-weight: 600; margin-bottom: 4px; }
.ph-legend ul { margin: 6px 0 0; padding-inline-start: 18px; color: var(--muted); }
.ph-legend code { font: 12px ui-monospace, Menlo, monospace; background: rgba(255,226,120,.16); color: #f3e7b6; padding: 1px 5px; border-radius: 4px; unicode-bidi: isolate; direction: ltr; }
.guide { border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.02); margin-bottom: 22px; }
.guide summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 14px 18px; font: 500 16px var(--serif); }
.guide summary::-webkit-details-marker { display: none; }
.guide summary .ic { color: var(--gold); }
.guide summary .chev { margin-inline-start: auto; transition: transform .2s; color: var(--muted); }
.guide[open] summary .chev { transform: rotate(180deg); }
.guide-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--line); }
.guide-col { padding: 16px 18px 18px; }
.guide-col + .guide-col { border-inline-start: 1px solid var(--line); }
.guide-col h4 { margin: 0 0 10px; display: flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
:root[lang="he"] .guide-col h4 { letter-spacing: .02em; font-size: 14px; }
.guide-col h4 .ic { width: 18px; height: 18px; padding: 2px; border-radius: 50%; border: 1px solid currentColor; }
.guide-col.evitar h4 { color: #e3a594; }
.guide-col.adaptar h4 { color: #9fc0e8; }
.guide-col ul { margin: 0; padding-inline-start: 18px; color: #c9d1dd; font-size: 13.5px; }
.guide-col li + li { margin-top: 6px; }
.blank-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px; border-radius: 12px; background: #1b2a43; border: 1px solid var(--line2); margin-bottom: 18px; }
.blank-bar b { margin-inline-end: auto; font: 500 16px var(--serif); display: flex; align-items: center; gap: 8px; }
.blank-bar b .ic { color: var(--gold); }

/* ---------- Hoja (formulario = documento impreso) ---------- */
.paper-wrap { display: flex; justify-content: center; }
.paper { width: 100%; max-width: 860px; background: var(--paper); color: var(--paper-ink); border-radius: 6px;
  box-shadow: 0 2px 0 rgba(255,255,255,.04) inset, 0 30px 70px rgba(0,0,0,.5), 0 2px 6px rgba(0,0,0,.4); color-scheme: light;
  font-family: var(--serif); font-size: 15px; line-height: 1.5; }
.sheet, .sheet > thead, .sheet > tbody, .sheet > thead > tr, .sheet > tbody > tr, .sheet > thead > tr > td, .sheet > tbody > tr > td { display: block; }
.sheet { width: 100%; border-collapse: collapse; }
.band { background: var(--banda); color: #f3ebdb; text-align: center; padding: 22px 28px 18px; border-radius: 6px 6px 0 0; position: relative; }
.band::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, transparent, var(--gold3) 20%, var(--gold) 50%, var(--gold3) 80%, transparent); opacity: .9; }
.band .psi { width: 38px; height: 38px; display: block; margin: 0 auto 6px; color: var(--gold); }
.band .logo { display: block; max-height: 56px; max-width: 220px; margin: 0 auto 8px; object-fit: contain; }
.band .who { font: 400 15.5px/1.35 var(--serif); letter-spacing: .04em; }
.band .who.ph { opacity: .55; font-style: italic; }
.band .esp { font-size: 12.5px; opacity: .78; margin-top: 2px; letter-spacing: .03em; }
.band .cfg { display: inline-block; margin-top: 8px; font: 12px var(--sans); color: var(--gold2); border-bottom: 1px dashed rgba(233,207,150,.5); }
.sheet-body { padding: 34px 52px 30px; }
.p-title { text-align: center; font: 600 25px/1.2 var(--serif); font-variant: small-caps; letter-spacing: .05em; margin: 4px 0 26px; color: var(--paper-ink); }
:root[lang="he"] .paper { font-size: 16.5px; }
:root[lang="he"] .fl-l, :root[lang="he"] .chk, :root[lang="he"] .esc-t, :root[lang="he"] .opl { font-size: 15.5px; }
:root[lang="he"] .fl-i, :root[lang="he"] .area { font-size: 16.5px; }
:root[lang="he"] .esc-int, :root[lang="he"] .tbl { font-size: 14.5px; }
:root[lang="he"] .p-title, :root[lang="ja"] .p-title { font-variant: normal; letter-spacing: 0; font-size: 27px; }
.blk { margin: 0 0 22px; break-inside: auto; }
.blk-t { font: 700 15px/1.3 var(--serif); font-variant: small-caps; letter-spacing: .06em; color: var(--paper-ink); margin: 0 0 10px; break-after: avoid; }
:root[lang="he"] .blk-t, :root[lang="ja"] .blk-t { font-variant: normal; letter-spacing: 0; font-size: 16.5px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; column-gap: 30px; row-gap: 6px; }
.fl { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.fl.wide { grid-column: 1 / -1; }
.fl-l { color: var(--paper-muted); font-size: 14px; flex: none; max-width: 62%; }
.fl.wide .fl-l { max-width: 60%; }
.fl-l::after { content: ":"; }
.fl-i { flex: 1; min-width: 40px; border: 0; border-bottom: 1px solid var(--paper-rule); background: transparent; color: var(--paper-ink); padding: 2px 2px 1px; font: 15px var(--serif); outline: none; border-radius: 0; }
.fl-i:focus { border-bottom-color: var(--gold3); background: rgba(212,176,106,.08); }
.fl-i::placeholder { color: #b9bfc9; }
.fl.col { flex-direction: column; align-items: stretch; gap: 2px; }
.fl.col .fl-l { max-width: none; }
.area { width: 100%; resize: none; overflow: hidden; border: 0; outline: none; background-color: transparent; color: var(--paper-ink); font: 15px/30px var(--serif); padding: 0 2px; border-radius: 0;
  background-image: linear-gradient(to bottom, transparent 29px, var(--paper-rule) 29px, var(--paper-rule) 30px); background-size: 100% 30px; background-attachment: local; min-height: 90px; }
.area:focus { background-color: rgba(212,176,106,.06); }
.opts { display: flex; flex-wrap: wrap; gap: 6px 16px; padding-top: 2px; }
.chk { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: 14.5px; color: var(--paper-ink); }
.chk input { position: absolute; opacity: 0; pointer-events: none; }
.chk .bx { width: 16px; height: 16px; border: 1.5px solid #6b7586; border-radius: 3px; display: inline-grid; place-items: center; flex: none; background: #fff; transition: background .12s, border .12s; }
.chk input:checked + .bx { background: var(--paper-ink); border-color: var(--paper-ink); }
.chk input:checked + .bx::after { content: ""; width: 8px; height: 4px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.chk input:focus-visible + .bx { outline: 2px solid var(--gold3); outline-offset: 2px; }
.yn { display: inline-flex; gap: 16px; }
.ptext p { margin: 0 0 10px; text-align: justify; hyphens: auto; outline: none; border-radius: 3px; padding: 1px 3px; margin-inline: -3px; }
.ptext p:focus { background: rgba(212,176,106,.08); }
mark.ph { background: #fff0a8; color: #4b3d06; border-radius: 3px; padding: 0 3px; unicode-bidi: isolate; box-shadow: 0 0 0 1px #ecd56a inset; }
mark.ph.ok { background: transparent; box-shadow: none; color: inherit; padding: 0; }
.lst { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.lst .chk { align-items: flex-start; }
.lst .chk .bx { margin-top: 3px; }
.lst.bul { list-style: disc; padding-inline-start: 22px; }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 8px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { background: #efeae0; color: var(--paper-ink); text-align: start; font-weight: 700; padding: 7px 9px; border: 1px solid #c8cdd5; font-size: 13px; }
.tbl td { border: 1px solid #c8cdd5; padding: 6px 9px; height: 34px; vertical-align: top; min-width: 80px; outline: none; }
.tbl td:focus { background: rgba(212,176,106,.1); }
.addrow { display: inline-flex; align-items: center; gap: 6px; border: 1px dashed #a9b1be; background: transparent; color: var(--paper-muted); border-radius: 8px; padding: 5px 12px; font: 13px var(--sans); }
.addrow:hover { border-color: var(--gold3); color: var(--paper-ink); }
.addrow .ic { width: 15px; height: 15px; }
/* Escala */
.esc-ins { margin: 0 0 8px; font-style: italic; color: var(--paper-muted); }
.esc-note { margin: 0 0 8px; font-size: 13px; color: var(--paper-muted); }
.esc-leg { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.esc-leg span { font: 12.5px var(--sans); color: var(--paper-ink); background: #efeae0; border-radius: 99px; padding: 3px 10px; }
.esc-items { list-style: none; margin: 0; padding: 0; border-top: 1px solid #d9dde3; }
.esc-it { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 18px; padding: 9px 0; border-bottom: 1px solid #e3e6ea; break-inside: avoid; }
.esc-t { font-size: 14.5px; }
.esc-ops { display: flex; gap: 6px; }
.op { position: relative; cursor: pointer; }
.op input { position: absolute; opacity: 0; pointer-events: none; }
.op span { min-width: 34px; height: 34px; padding: 0 8px; display: inline-grid; place-items: center; border-radius: 99px; border: 1.5px solid #b7bec9; color: var(--paper-ink); font: 600 13.5px var(--sans); background: #fff; transition: background .12s, border .12s, color .12s; }
.op:hover span { border-color: var(--paper-ink); }
.op input:checked + span { background: var(--paper-ink); border-color: var(--paper-ink); color: #fff; }
.op input:focus-visible + span { outline: 2px solid var(--gold3); outline-offset: 2px; }
.esc-it.own { grid-template-columns: 1fr; }
.esc-it.own .esc-ops { flex-direction: column; gap: 4px; padding-inline-start: 4px; }
.opl { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; padding: 3px 0; }
.opl input { position: absolute; opacity: 0; pointer-events: none; }
.opl .rd { width: 17px; height: 17px; flex: none; border-radius: 50%; border: 1.5px solid #8a93a2; background: #fff; display: grid; place-items: center; }
.opl input:checked + .rd { border-color: var(--paper-ink); }
.opl input:checked + .rd::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--paper-ink); }
.opl input:focus-visible + .rd { outline: 2px solid var(--gold3); outline-offset: 2px; }
.opl .pts { margin-inline-start: auto; color: var(--paper-muted); font: 12px var(--sans); }
.esc-total { margin-top: 14px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; padding: 12px 16px; border-radius: 10px; background: #f1ece1; border: 1px solid #e2d7bf; }
.esc-total .lbl { font-weight: 700; font-variant: small-caps; letter-spacing: .04em; }
:root[lang="he"] .esc-total .lbl { font-variant: normal; }
.esc-total .val { font: 600 26px/1 var(--serif); color: var(--paper-ink); font-variant-numeric: tabular-nums; }
.esc-total .val small { font-size: 15px; color: var(--paper-muted); font-weight: 400; }
.esc-total .cnt { color: var(--paper-muted); font: 12.5px var(--sans); }
.esc-total .avg { color: var(--paper-muted); font: 12.5px var(--sans); }
.esc-int { margin: 10px 0 0; font-size: 13px; color: var(--paper-muted); line-height: 1.5; }
.esc-int .hit { background: #fdf0c2; color: var(--paper-ink); border-radius: 3px; padding: 0 2px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.esc-int-aviso { margin: 6px 0 0; font: italic 12px var(--sans); color: #8a93a2; }
/* Firmas */
.sigs { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 26px 48px; margin-top: 30px; }
.sig { text-align: center; }
.sig-line { height: 54px; border-bottom: 1px solid var(--paper-ink); }
.sig-l { margin-top: 6px; color: var(--paper-muted); font-size: 13px; }
.sig-place { margin-top: 22px; max-width: 420px; }
.p-foot { margin-top: 30px; padding-top: 10px; border-top: 1px solid #d9c7a0; text-align: center; color: var(--paper-muted); font: 12px var(--sans); }
.paper.blank input, .paper.blank textarea, .paper.blank [contenteditable], .paper.blank label { pointer-events: none; }
.paper.blank .addrow { display: none; }

/* ---------- Ajustes ---------- */
.settings { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.panel { background: linear-gradient(180deg, var(--card), #0f1f37); border: 1px solid var(--line); border-radius: 18px; padding: 24px; }
.panel h2 { margin: 0 0 4px; }
.panel > p { color: var(--muted); margin: 0 0 20px; font-size: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.lab { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.lab .input { height: 44px; font-size: 15px; color: var(--ink); }
.logo-row { display: flex; align-items: center; gap: 14px; }
.logo-prev { width: 72px; height: 72px; border-radius: 14px; border: 1px dashed var(--line2); display: grid; place-items: center; background: var(--banda); overflow: hidden; flex: none; }
.logo-prev img { max-width: 64px; max-height: 64px; object-fit: contain; }
.logo-prev .psi { width: 36px; height: 36px; }
.logo-row small { display: block; color: var(--muted2); font-size: 12px; margin-top: 6px; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.sw { width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(255,255,255,.14); padding: 0; }
.sw.on { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212,176,106,.25); }
.sw-custom { position: relative; width: 34px; height: 34px; border-radius: 50%; overflow: hidden; border: 2px dashed var(--line2); }
.sw-custom input { position: absolute; inset: -6px; width: 46px; height: 46px; border: 0; padding: 0; cursor: pointer; opacity: 0; }
.sw-custom .ic { position: absolute; inset: 0; margin: auto; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.preview-sticky { position: sticky; top: 24px; }
.preview-sticky .paper { font-size: 13px; }
.preview-sticky .sheet-body { padding: 22px 28px 20px; }
.preview-sticky .p-title { font-size: 19px; margin-bottom: 16px; }
.mini-lines div { height: 22px; border-bottom: 1px solid #d3d8df; }
.privacy { display: flex; gap: 10px; align-items: flex-start; color: var(--muted); font-size: 13px; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.privacy .ic { color: var(--gold); }
.settings-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

/* ---------- Novedades ---------- */
.news { list-style: none; margin: 0; padding: 0; position: relative; max-width: 760px; }
.news::before { content: ""; position: absolute; inset-block: 6px; inset-inline-start: 7px; width: 1px; background: var(--line2); }
.news li { position: relative; padding-inline-start: 34px; padding-bottom: 24px; }
.news li::before { content: ""; position: absolute; inset-inline-start: 2px; top: 6px; width: 11px; height: 11px; border-radius: 50%; background: var(--bg); border: 2px solid var(--gold); }
.news time { color: var(--gold); font-size: 12.5px; letter-spacing: .06em; }
.news p { margin: 4px 0 0; color: #d3dae4; }
.badge { display: inline-block; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: #1a1407; background: var(--gold); border-radius: 99px; padding: 1px 8px; margin-inline-start: 8px; vertical-align: 2px; }

.loading { color: var(--muted); padding: 60px 0; text-align: center; }
.toast { position: fixed; z-index: 80; inset-inline: 0; bottom: 28px; margin: 0 auto; width: max-content; max-width: calc(100% - 32px); background: #1d2f4d; color: var(--ink); border: 1px solid var(--line2); padding: 10px 18px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.4); font-size: 14px; }

/* ---------- Bonos ---------- */
.bonos-strip { display: flex; align-items: center; gap: 16px; margin-top: 18px; padding: 16px 20px; border-radius: 16px; border: 1px solid var(--line2);
  background: linear-gradient(100deg, rgba(212,176,106,.16), rgba(212,176,106,.04) 55%, rgba(255,255,255,.02)); }
[dir="rtl"] .bonos-strip { background: linear-gradient(260deg, rgba(212,176,106,.16), rgba(212,176,106,.04) 55%, rgba(255,255,255,.02)); }
.bonos-strip:hover { border-color: var(--gold3); }
.bs-ico { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(180deg, #e2c27f, #c69d52); color: #1a1407; }
.bs-ico .ic { width: 24px; height: 24px; stroke-width: 1.7; }
.bs-txt { flex: 1; min-width: 0; }
.bs-txt b { display: block; font: 500 19px/1.2 var(--serif); color: var(--ink); }
.bs-txt span { display: block; color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.bs-chips { display: flex; gap: 6px; }
.bs-chip { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line2); color: var(--gold); background: rgba(8,17,31,.4); }
.bs-chip .ic { width: 18px; height: 18px; }
.bonos-strip .go { color: var(--gold2); }
.bgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.bcard { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 26px; min-height: 210px; border-radius: 18px; border: 1px solid var(--line2);
  background: radial-gradient(500px 220px at 100% 0%, rgba(212,176,106,.12), transparent 60%), linear-gradient(180deg, var(--card), #0f1f37); transition: transform .15s, border-color .15s, box-shadow .15s; }
[dir="rtl"] .bcard { background: radial-gradient(500px 220px at 0% 0%, rgba(212,176,106,.12), transparent 60%), linear-gradient(180deg, var(--card), #0f1f37); }
.bcard:hover { transform: translateY(-2px); border-color: var(--gold3); box-shadow: 0 16px 36px rgba(0,0,0,.35); }
.bcard .ico { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 14px; border: 1px solid var(--line2); color: var(--gold); background: rgba(212,176,106,.07); }
.bcard .ico .ic { width: 28px; height: 28px; stroke-width: 1.35; }
.bcard .bnum { position: absolute; inset-block-start: 18px; inset-inline-end: 24px; font: italic 500 40px/1 var(--serif); color: rgba(212,176,106,.28); }
.bcard h3 { margin: 4px 0 0; font: 500 21px/1.25 var(--serif); }
.bcard p { margin: 0; color: var(--muted); font-size: 14px; }
.bcard .meta { margin-top: auto; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 13px; }
.bcard .open { display: inline-flex; align-items: center; gap: 4px; color: var(--gold2); font-weight: 500; }
.bcard .open .ic { width: 16px; height: 16px; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.b1-bar { position: sticky; top: 0; z-index: 12; padding: 10px 0 12px; background: linear-gradient(180deg, var(--bg) 82%, rgba(8,17,31,0)); }
.b1-bar .search { max-width: none; }
.b1-hint { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; margin: 10px 0 0; }
.b1-hint .ic { color: var(--gold); width: 17px; height: 17px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line2); background: rgba(255,255,255,.03); color: #c9d1dd; font-size: 13px; }
.chip .ic { width: 15px; height: 15px; color: var(--gold); }
.chip.on { background: var(--gold); color: #1a1407; border-color: var(--gold); }
.chip.on .ic { color: #1a1407; }
.fr-area { margin-top: 26px; }
.fr-sub { margin: 18px 0 8px; color: var(--gold); font: 600 12px var(--sans); letter-spacing: .16em; text-transform: uppercase; }
:root[lang="he"] .fr-sub { letter-spacing: .02em; font-size: 14px; }
.frs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fr { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: linear-gradient(180deg, var(--card), #0f1f37); }
.fr p { flex: 1; margin: 0; font: 16px/1.5 var(--serif); color: var(--ink); }
.fr mark.ph { background: rgba(255,226,120,.16); color: #f3e7b6; box-shadow: 0 0 0 1px rgba(255,226,120,.28) inset; }
.b1-hint mark.ph { background: rgba(255,226,120,.16); color: #f3e7b6; box-shadow: none; }
.fr-act { display: flex; align-items: center; gap: 4px; flex: none; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.pthumb { display: flex; flex-direction: column; gap: 8px; }
.pthumb .pc canvas, .tpl canvas, .est canvas { display: block; width: 100%; height: auto; border-radius: 8px; }
.pthumb .pc { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); transition: transform .15s, border-color .15s; box-shadow: 0 10px 24px rgba(0,0,0,.3); }
.pthumb:hover .pc { transform: translateY(-2px); border-color: var(--gold3); }
.pthumb b { font: 500 14.5px/1.3 var(--serif); color: var(--ink); }
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); gap: 26px; align-items: start; }
.ed-prev { position: sticky; top: 20px; display: flex; justify-content: center; }
.ed-prev canvas { width: 100%; max-width: 560px; height: auto; border-radius: 10px; box-shadow: 0 26px 60px rgba(0,0,0,.5); background: #0c1729; }
.ed-prev.story canvas { max-width: 380px; }
.ed-side { display: grid; gap: 14px; }
.ed-side .h2 { margin-top: -6px; }
.ed-side .eyebrow { margin: 0; }
.tpls { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.tpl, .est { padding: 4px; border-radius: 10px; border: 1.5px solid var(--line); background: transparent; display: grid; gap: 4px; color: var(--muted); }
.tpl small { font-size: 11px; text-align: center; }
.tpl.on, .est.on { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212,176,106,.2); color: var(--ink); }
.estilos { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.ta, .lab .ta { height: auto; min-height: 112px; padding: 10px 14px; line-height: 1.5; resize: vertical; }
.lab #b3p { min-height: 170px; }
.ed-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.b4-note { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-size: 13px; margin: 0; }
.b4-note .ic { color: var(--gold); width: 17px; height: 17px; margin-top: 1px; }
.b4-note a { color: var(--gold2); border-bottom: 1px solid var(--line2); }
.b4-note b { color: var(--ink); font-weight: 500; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--line2); border-radius: 11px; overflow: hidden; }
.seg button { height: 40px; border: 0; background: transparent; color: var(--muted); font-size: 13px; }
.seg button.on { background: rgba(212,176,106,.16); color: var(--ink); }
select.input { appearance: none; -webkit-appearance: none; color: var(--ink); background-color: rgba(255,255,255,.035); }
select.input option { color: #111; }
.chk.dark { color: var(--ink); margin-top: 10px; }
.chk.dark .bx { background: transparent; border-color: var(--gold3); }
.chk.dark input:checked + .bx { background: var(--gold); border-color: var(--gold); }
.chk.dark input:checked + .bx::after { border-color: #1a1407; }
@media (max-width: 1240px) {
  .editor { grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); }
}
@media (max-width: 860px) {
  .tab { font-size: 10.5px; }
  .bonos-strip { flex-wrap: wrap; gap: 12px; padding: 14px 16px; }
  .bs-txt { flex-basis: calc(100% - 100px); }
  .bs-chips { order: 3; width: 100%; }
  .bonos-strip .go { display: none; }
  .bgrid { grid-template-columns: 1fr; }
  .bcard { min-height: 0; padding: 20px; }
  .fr { flex-direction: column; align-items: stretch; gap: 10px; }
  .fr-act { justify-content: flex-end; }
  .pgrid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .editor { grid-template-columns: 1fr; }
  .ed-prev { position: static; }
  .b1-bar { top: calc(57px + env(safe-area-inset-top)); }
}

/* ---------- Tablet ---------- */
@media (max-width: 1240px) {
  :root { --side: 248px; }
  .view { padding: 28px 28px 70px; }
}
/* ---------- Teléfono ---------- */
@media (max-width: 860px) {
  .side { display: none; }
  .main { margin-inline-start: 0; padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); }
  .topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
    background: rgba(8,17,31,.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
  [dir="rtl"] .topbar { padding: 10px 16px 10px 12px; padding-top: calc(10px + env(safe-area-inset-top)); }
  .topbar .escudo { width: 34px; height: 34px; }
  .topbar .t { flex: 1; min-width: 0; }
  .topbar b { display: block; font: 500 13.5px/1.15 var(--serif); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  :root[lang="he"] .topbar b { letter-spacing: 0; font-size: 16px; }
  .topbar small { display: block; color: var(--gold); font-size: 9.5px; letter-spacing: .2em; text-transform: uppercase; margin-top: 2px; }
  :root[lang="he"] .topbar small { letter-spacing: .02em; font-size: 11.5px; }
  .topbar .iconbtn { position: relative; }
  .topbar .iconbtn .dot { position: absolute; top: 9px; inset-inline-end: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
  .tabbar { position: fixed; z-index: 30; inset-inline: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(var(--tabbar) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom); background: rgba(9,19,35,.96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
  .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted2); font-size: 11px; }
  .tab .ic { width: 22px; height: 22px; }
  .tab.on { color: var(--gold); }
  .tab.on .ic { stroke-width: 1.9; }
  .view { padding: 20px 16px 40px; }
  .h1 { font-size: 27px; }
  .doc-head .h1 { font-size: 25px; }
  .hero { padding: 24px 20px; border-radius: 18px; }
  .hero .psi-bg { width: 96px; height: 96px; inset-inline-end: 14px; inset-block-start: 14px; }
  .hero .count { font-size: 27px; max-width: 14ch; }
  .hero .sub { font-size: 14px; }
  .cats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .cat { min-height: 136px; padding: 14px; gap: 10px; }
  .cat .ico { width: 40px; height: 40px; }
  .cat h3 { font-size: 14.5px; }
  .cat .num { inset-block-start: 14px; inset-inline-end: 14px; }
  .dgrid { grid-template-columns: 1fr; gap: 10px; }
  .dcard { min-height: 0; }
  .sec-head { margin-top: 32px; }
  .cat-head .ico { width: 52px; height: 52px; }
  .toolbar { top: calc(57px + env(safe-area-inset-top)); gap: 6px; margin-inline: -16px; padding: 10px 16px; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .toolbar::-webkit-scrollbar { display: none; }
  .toolbar .btn { height: 40px; padding: 0 12px; font-size: 13.5px; }
  .toolbar .btn:not(.primary) .lbl { display: none; }
  .toolbar .btn:not(.primary) { width: 40px; padding: 0; flex: none; }
  .toolbar .iconbtn { margin-inline-start: auto; }
  .saved { inset-inline-end: 16px; }
  .toolbar .sp { display: none; }
  .guide-cols { grid-template-columns: 1fr; }
  .guide-col + .guide-col { border-inline-start: 0; border-top: 1px solid var(--line); }
  .paper { border-radius: 4px; }
  .sheet-body { padding: 24px 18px 22px; }
  .band { padding: 18px 16px 14px; }
  .band .who { font-size: 13.5px; }
  .p-title { font-size: 21px; }
  .fields { grid-template-columns: 1fr; }
  .fl { flex-wrap: wrap; }
  .fl-l { max-width: 100%; }
  .fl.wide .fl-l { max-width: 100%; }
  .fl-i { min-width: 140px; }
  .esc-it { grid-template-columns: 1fr; }
  .esc-ops { flex-wrap: wrap; }
  .settings { grid-template-columns: 1fr; }
  .preview-sticky { position: static; order: -1; }
  .form-grid { grid-template-columns: 1fr; }
  .panel { padding: 18px; }
  .blank-bar b { width: 100%; }
}
@media (max-width: 380px) {
  .cats { grid-template-columns: 1fr; }
}

/* ---------- Impresión / PDF ---------- */
@media print {
  @page { size: A4; margin: 0 0 16mm 0; background: #fff; }
  :root { color-scheme: light; }
  html, body { background: #fff !important; background-image: none !important; color: #000; }
  .side, .topbar, .tabbar, .toolbar, .doc-head, .guide, .legal-note, .ph-legend, .blank-bar, .crumb, .toast, .offline, .addrow, .np, .p-foot { display: none !important; }
  .main { margin: 0 !important; padding: 0 !important; }
  .view { max-width: none; padding: 0 !important; margin: 0; }
  .paper-wrap { display: block; }
  .paper { max-width: none; box-shadow: none; border-radius: 0; background: #fff; font-size: 10.5pt; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sheet { display: table; width: 100%; }
  .sheet > thead { display: table-header-group; }
  .sheet > tbody { display: table-row-group; }
  .sheet > thead > tr, .sheet > tbody > tr { display: table-row; }
  .sheet > thead > tr > td, .sheet > tbody > tr > td { display: table-cell; padding: 0; }
  .band { border-radius: 0; padding: 7mm 16mm 5mm; }
  .band .psi { width: 9mm; height: 9mm; margin-bottom: 1.5mm; }
  .band .logo { max-height: 13mm; margin-bottom: 1.5mm; }
  .band .cfg { display: none; }
  .band .who.ph { display: none; }
  .sheet-body { padding: 8mm 16mm 0 !important; }
  .p-title { font-size: 17pt; margin: 2mm 0 6mm; }
  .blk { margin-bottom: 5mm; }
  .blk-t { font-size: 11pt; }
  .fields { grid-template-columns: 1fr 1fr !important; column-gap: 8mm; }
  .fl { flex-wrap: nowrap !important; }
  .fl-i { font-size: 10.5pt; min-width: 20mm !important; }
  .fl-l { font-size: 10pt; }
  .fl-i:placeholder-shown::placeholder { color: transparent; }
  .area { font-size: 10.5pt; line-height: 7.5mm; background-image: linear-gradient(to bottom, transparent calc(7.5mm - 1px), #a9b1be calc(7.5mm - 1px), #a9b1be 7.5mm); background-size: 100% 7.5mm; }
  .ptext p { text-align: justify; }
  mark.ph { background: none; box-shadow: none; border-bottom: 1px dotted #8a6d00; color: inherit; padding: 0; }
  .tbl-wrap { overflow: visible; }
  .tbl { font-size: 9.5pt; }
  .tbl td { height: 8mm; min-width: 0; }
  .tbl th { font-size: 9pt; }
  .tbl tr { break-inside: avoid; }
  .tbl thead { display: table-header-group; }
  .esc-it { grid-template-columns: 1fr auto !important; padding: 1.6mm 0; }
  .esc-it.own { grid-template-columns: 1fr !important; }
  .esc-it.own .esc-ops { display: grid !important; grid-template-columns: 1fr 1fr; gap: .6mm 8mm; }
  .opl { padding: .3mm 0; font-size: 10pt; }
  .opl .pts { margin-inline-start: 2mm; }
  .esc-ops { flex-wrap: nowrap !important; }
  .op span { min-width: 7mm; height: 7mm; font-size: 9pt; }
  .esc-total { background: #f4f0e6; }
  .sigs { break-inside: avoid; }
  .chk .bx, .opl .rd, .op span { background: #fff; }
}
