:root { font-family: system-ui, sans-serif; color: #182a35; background: #e8eeed; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
header, nav { background: #fff; }
header { display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap; padding: 14px 24px; border-top: 4px solid #08776d; }
header strong { letter-spacing: .08em; }
header span { font-weight: 500; letter-spacing: normal; margin-left: 12px; }
.actions, .tabs, .tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
button, select, input, textarea { font: inherit; }
button, select, input[type=number] { border: 1px solid #a7b9b9; background: white; border-radius: 5px; padding: 6px 10px; color: inherit; }
button { cursor: pointer; }
button:hover, button[aria-pressed=true] { background: #e0efeb; }
a { color: #08645c; }
#export, #accept { background: #08645c; border-color: #08645c; color: white; }
nav { position: sticky; top: 0; z-index: 5; border-block: 1px solid #c7d3d2; }
.tabs { padding: 8px 24px 0; }
.tabs button { border-color: transparent; }
.tools { padding: 7px 24px; font-size: .8rem; }
.tools button, .tools select, .tools input[type=number] { min-height: 28px; padding: 3px 7px; }
.tools input[type=color] { width: 31px; height: 26px; padding: 2px; }
.tools label { display: inline-flex; align-items: center; gap: 5px; }
#objectTools { background: #ecf7f3; }
#tableTools { background: #edf5fb; border-top: 1px solid #c8dbe5; }
#tableTools strong { color: #194459; }
#cellCount { color: #365162; }
#document .picked-cell { outline: 2px solid #008574; outline-offset: -2px; }
#tableHandles { position: absolute; z-index: 4; pointer-events: none; }
.table-grip { position: absolute; pointer-events: auto; touch-action: none; }
.table-grip.column { width: 7px; height: 100%; transform: translateX(-50%); cursor: col-resize; }
.table-grip.row { width: 100%; height: 7px; transform: translateY(-50%); cursor: row-resize; }
.table-grip.column:hover, .table-grip.row:hover, .table-grip:active { background: #00857466; }
.table-grip.nw, .table-grip.ne, .table-grip.sw, .table-grip.se {
  width: 10px; height: 10px; border: 1px solid #008574; background: #fff;
  transform: translate(-50%, -50%); z-index: 1;
}
.table-grip.nw, .table-grip.se { cursor: nwse-resize; }
.table-grip.ne, .table-grip.sw { cursor: nesw-resize; }
#moveObject { cursor: move; touch-action: none; }
input[type=number] { width: 5em; }
main { overflow: auto; padding: 0 16px 30px; }
#message { max-width: 210mm; margin: 12px auto; font-size: .875rem; }
.sheet { position: relative; isolation: isolate; width: 210mm; min-height: 297mm; margin: auto; background: white; box-shadow: 0 3px 20px #142e3620; }
#document { position: relative; min-height: 297mm; padding: var(--page-margins, 18mm); outline: none; font: 11pt/1.45 Arial, sans-serif; overflow-wrap: anywhere; }
#document::after { content: ""; display: block; clear: both; }
#document h1 { font-size: 24pt; }
#document table { width: 100%; border-collapse: collapse; margin: 12px 0; break-inside: auto; }
#document tr { break-inside: avoid; }
#document td, #document th { border: 1px solid #879b9d; padding: 6px; min-width: 30px; text-align: inherit; }
.pdf-import-layout { position: relative; break-inside: avoid; }
.pdf-import-artwork, .pdf-import-text, .object.pdf-import-image { position: absolute; margin: 0; }
.pdf-import-artwork { inset: 0; width: 100%; height: 100%; pointer-events: none; }
.pdf-import-text { white-space: pre; overflow-wrap: normal; }
#document .pdf-import-table { position: absolute; table-layout: fixed; margin: 0; }
#document .pdf-import-table td { position: relative; padding: 0; min-width: 0; line-height: 0; }
#document .banded tbody tr:nth-child(even) { background: #e5f1ef; }
#document .banded thead { background: #125954; color: white; }
#document .minimal td, #document .minimal th { border: 0; border-bottom: 1px solid #a7b9b9; }
.object { display: inline-block; position: relative; vertical-align: middle; width: 45%; max-width: 100%; break-inside: avoid; }
.object img, .object svg { display: block; width: 100%; height: 100%; object-fit: contain; }
.object[data-wrap=left] { float: left; margin-right: 10px; }
.object[data-wrap=right] { float: right; margin-left: 10px; }
.object[data-wrap=front], .object[data-wrap=behind] { width: 0 !important; height: 0 !important; }
.object[data-wrap=front] > *, .object[data-wrap=behind] > * {
  position: absolute;
  width: calc(var(--content-width, 174mm) * var(--object-fraction, .45));
  height: var(--object-height, auto);
  transform: translate(var(--object-x, 0px), var(--object-y, 0px));
}
.object[data-wrap=front] { z-index: 2; }
.object[data-wrap=behind] { z-index: -1; }
.object.selected > * { outline: 2px solid #058c73; }
.inserted-block { margin: 12px 0; }
.page-break { border-bottom: 1px dashed #9baeb0; height: 12px; break-after: page; }
#watermark { position: absolute; inset: 0; pointer-events: none; display: grid; place-items: center; }
#watermark span { color: #244e56; opacity: .16; transform: rotate(-30deg); font-size: 54pt; font-weight: bold; overflow-wrap: anywhere; max-width: 80%; text-align: center; }
dialog { width: min(490px, 94vw); border: 1px solid #a1b5b5; border-radius: 12px; padding: 22px; }
dialog::backdrop { background: #172b3870; }
dialog h2 { margin-top: 0; }
#fields { display: grid; gap: 12px; }
#fields label { display: grid; gap: 4px; }
#fields input[type=text], #fields textarea { width: 100%; padding: 6px; }
#error { color: #9c251a; }
@media print {
  :root, .sheet { background: white; }
  * { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  header, nav, #message, dialog, #tableHandles { display: none !important; }
  main, .sheet, #document { padding: 0; margin: 0; width: auto; min-height: 0; overflow: visible; box-shadow: none; }
  .object.selected > *, #document .picked-cell { outline: none; }
  .page-break { border: 0; height: 0; }
  #watermark { position: fixed; }
}

:root { color: #142c49; background: #e2ebf8; }
header { border-top-color: #215da7; }
a { color: #174e9c; }
#export, #accept { background: #205bab; border-color: #205bab; }
button:hover, button[aria-pressed=true] { background: #dceaff; }
nav { border-color: #b8cce6; }
.tabs { background: #15447d; color: white; }
.tabs button { background: transparent; color: inherit; }
.tabs button[aria-pressed=true], .tabs button:hover { background: #eef5ff; color: #163e73; }
.ribbon-group { border-right: 1px solid #c3d4e9; padding-right: 9px; align-self: stretch; display: grid; align-content: space-between; gap: 4px; }
.ribbon-group small { text-align: center; color: #395b83; }
.ribbon-buttons { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.ribbon-buttons button { min-width: 28px; }
#insertar .ribbon-buttons button span { display: block; color: #235f9e; font-size: 1.32rem; line-height: 1.2; }
.paragraph-mark { width: 15px; height: 12px; display: inline-block; background: repeating-linear-gradient(to bottom,#28588a 0 1px,transparent 1px 3px); vertical-align: middle; }
.paragraph-mark.left { clip-path: polygon(0 0,100% 0,100% 20%,68% 20%,68% 45%,100% 45%,100% 69%,68% 69%,68% 100%,0 100%); }
.paragraph-mark.right { transform: scaleX(-1); clip-path: polygon(0 0,100% 0,100% 20%,68% 20%,68% 45%,100% 45%,100% 69%,68% 69%,68% 100%,0 100%); }
.paragraph-mark.center { clip-path: polygon(0 0,100% 0,100% 20%,82% 20%,82% 45%,100% 45%,100% 69%,82% 69%,82% 100%,18% 100%,18% 69%,0 69%,0 45%,18% 45%,18% 20%,0 20%); }
#tableTools, #objectTools { background: #eaf3ff; flex-wrap: wrap; }
.border-fields { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 5px 0; }
#borderMenu summary { cursor: pointer; }
#draftStatus { max-width: 210mm; margin: 0 auto 8px; color: #425e82; font-size: .78rem; }
#document td, #document th { background-image: var(--diagonal-down, linear-gradient(transparent, transparent)), var(--diagonal-up, linear-gradient(transparent, transparent)); }
#document .banded thead { background: #194680; }
#document .banded tbody tr:nth-child(even) { background: #e7f0fe; }
.table-grip.nw, .table-grip.ne, .table-grip.sw, .table-grip.se { border-color: #215da7; }
#document .picked-cell, .object.selected > * { outline-color: #215da7; }
#objectHandles { position: absolute; z-index: 4; pointer-events: none; }
.object-grip { position: absolute; width: 11px; height: 11px; padding: 0; border: 1px solid #215da7; border-radius: 2px; background: white; pointer-events: auto; transform: translate(-50%,-50%); touch-action: none; }
.object-grip.nw, .object-grip.se { cursor: nwse-resize; }
.object-grip.ne, .object-grip.sw { cursor: nesw-resize; }
.object-grip.rotate { top: -18px; left: 50%; border-radius: 50%; cursor: grab; }
.object-grip.move { top: 50%; left: 50%; cursor: move; background: #d9eaff; }
.object > img, .object > svg { rotate: var(--object-angle, 0deg); }
.object[data-wrap=front] > * { cursor: move; touch-action: none; }
.object > svg[aria-label^="Gráfico"] { width: 100%; }
.object[data-wrap=front] > svg[aria-label^="Gráfico"], .object[data-wrap=behind] > svg[aria-label^="Gráfico"] { width: calc(var(--content-width, 174mm) * var(--object-fraction, .45)); }
.sheet { background: repeating-linear-gradient(to bottom,white 0,white calc(297mm - 2px),#96afd2 calc(297mm - 2px),#96afd2 297mm); }
#watermark { display: block; z-index: 1; }
#watermark span { position: absolute; top: 112mm; left: 50%; transform: translate(-50%,-50%) rotate(-30deg); width: max-content; color: #2264a0; opacity: .22; }
.page-break { display: block; position: relative; border-bottom: 1px dashed #6b90bf; min-height: 22px; height: var(--break-space, 22px); }
.page-break::after { content: "Salto de página"; position: absolute; right: 0; bottom: 2px; color: #47678b; font: 10px system-ui; }
.flow-board { position: relative; height: 285px; min-height: 120px; margin: 12px 0; overflow: hidden; border: 1px solid #b7cae4; background: #f5f9ff; break-inside: avoid; }
.flow-board > svg { position: absolute; inset: 0; height: 100%; width: 100%; pointer-events: none; }
.flow-node { position: absolute; display: grid; place-items: center; background: #e6f1ff; border: 2px solid #346eaa; border-radius: 6px; color: #183a61; min-width: 64px; min-height: 35px; padding: 4px 11px; cursor: move; text-align: center; overflow: hidden; touch-action: none; }
.flow-node.decision { border-radius: 18px; background: #fff3cf; }
.flow-node[data-shape="rectangle"] { border-radius: 6px; }
.flow-node[data-shape="square"] { border-radius: 0; }
.flow-node[data-shape="circle"], .flow-node[data-shape="oval"] { border-radius: 50%; }
.flow-node[data-shape="diamond"], .flow-node.decision:not([data-shape]) {
  --outline-shape: polygon(50% 0,100% 50%,50% 100%,0 50%);
  padding-inline: 22%;
}
.flow-node[data-shape="triangle"] { --outline-shape: polygon(50% 0,100% 100%,0 100%); padding: 18px 16px 2px; }
.flow-node[data-shape="star"] {
  --outline-shape: polygon(50% 0,64% 29%,100% 38%,74% 61%,81% 100%,50% 80%,19% 100%,26% 61%,0 38%,36% 29%);
  padding-inline: 16px;
}
.flow-node[data-shape="parallelogram"] { --outline-shape: polygon(18% 0,100% 0,82% 100%,0 100%); padding-inline: 17px; }
.flow-node:is([data-shape="diamond"],[data-shape="triangle"],[data-shape="star"],[data-shape="parallelogram"],.decision:not([data-shape])) {
  border: 0; border-radius: 0; background: transparent; isolation: isolate; padding-inline: min(20px, 14%);
}
.flow-node:is([data-shape="diamond"],[data-shape="triangle"],[data-shape="star"],[data-shape="parallelogram"],.decision:not([data-shape]))::before,
.flow-node:is([data-shape="diamond"],[data-shape="triangle"],[data-shape="star"],[data-shape="parallelogram"],.decision:not([data-shape]))::after {
  content: ""; position: absolute; clip-path: var(--outline-shape); z-index: -1; pointer-events: none;
}
.flow-node::before { inset: 0; background: #346eaa; }
.flow-node::after { inset: 2px; background: #e6f1ff; }
.flow-node.decision::after { background: #fff3cf; }
.flow-node > span { overflow-wrap: anywhere; max-width: 100%; }
.flow-resize { position: absolute; bottom: 0; right: 0; width: 12px; height: 12px; cursor: nwse-resize; background: #346eaa; }
.flow-menu { position: fixed; z-index: 8; display: grid; gap: 4px; padding: 8px; background: white; border: 1px solid #93acd1; border-radius: 6px; }
.flow-board { resize: vertical; max-height: 1800px; }
.tabs { gap: 3px; padding-bottom: 0; border-bottom: 1px solid #a6bfdd; }
.tabs button { border: 1px solid transparent; border-radius: 6px 6px 0 0; padding: 7px 12px; }
.tabs button[aria-pressed=true] { position: relative; bottom: -1px; border-color: #a6bfdd; border-bottom-color: #f3f7fd; background: #f3f7fd; }
nav > .tools[id="inicio"], nav > .tools[id="insertar"], nav > .tools[id="diseno"] { background: #f3f7fd; }
.editor-bar { position: sticky; top: 0; z-index: 5; }
.editor-bar nav { position: static; }
.editor-bar header { padding: 9px 24px; }
.editor-bar header .actions :is(button, .header-link) {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 34px; padding: 5px 10px; border: 1px solid #a5bad6; border-radius: 5px;
  background: #f7faff; color: #183e71; text-decoration: none; font-size: .84rem; line-height: 1.1;
}
.editor-bar header .actions :is(button, .header-link):hover { background: #e2edff; }
.editor-bar header .actions button[data-command] { min-width: 34px; padding: 5px; font-size: 1rem; }
.editor-bar header .actions button:disabled { opacity: .45; cursor: default; }
.editor-bar header .actions #export { background: #205bab; color: white; border-color: #205bab; }
.editor-bar header .actions #export:hover { background: #194d93; }
@media (max-width: 650px) {
  .editor-bar header { padding-inline: 10px; gap: 6px; }
  .editor-bar header .actions { gap: 4px; }
  .editor-bar header .actions :is(button, .header-link) { padding-inline: 7px; }
}
#pageLabels { position: absolute; inset: 0; pointer-events: none; }
.page-label { position: absolute; display: grid; place-content: center; color: #234d7f; min-width: 2.2em; min-height: 2.2em; transform: translateY(-50%); }
.page-label.left { left: var(--left-margin); }
.page-label.center { left: 50%; transform: translate(-50%,-50%); }
.page-label.right { right: var(--right-margin); }
.page-label.circle, .page-label.square { border: 1px solid currentColor; }
.page-label.circle { border-radius: 50%; }
.page-label.diamond::before { content: ""; position: absolute; inset: .3em; border: 1px solid currentColor; transform: rotate(45deg); }
.object > .imported-page { max-height: var(--print-height, 255mm); object-fit: contain; }
@media print {
  #draftStatus, #objectHandles, #pageLabels, .flow-menu, .flow-resize { display: none !important; }
  .sheet { background: white; }
  #watermark span { top: 45%; }
  .page-break { min-height: 0; height: 0; border: 0; }
  .page-break::after { content: none; }
  .flow-board { resize: none; }
  .inserted-block:has(.imported-page) { margin: 0; }
}
