/* ElseWord, printed pages, book covers and the book reader (js/pc-word.js). */

/* ---------- printed pages (the same in the reader, the preview and the measuring page) ---------- */
#wd-measure { position: fixed; left: -20000px; top: 0; visibility: hidden; pointer-events: none; }
.wd-page { position: relative; flex: none; overflow: hidden; background: #fffdf6; color: #221c20; box-sizing: border-box;
  background-image: linear-gradient(90deg, rgba(120,100,70,.05), transparent 12%, transparent 88%, rgba(120,100,70,.06)); font-kerning: normal; }
.wd-page.blank, .wd-page.endpaper { background: #f2ead8; }
.wd-page.endpaper { background: repeating-linear-gradient(45deg, #e9dfc8 0 6px, #e2d6bc 6px 12px); }
.wd-flow { position: absolute; overflow: hidden; }
.wd-col { display: flow-root; }
.wd-page p, .wd-page h1, .wd-page h2, .wd-page h3, .wd-page blockquote, .wd-page pre { margin: 0; }
/* pages are measured outside any window: the game's window and heading rules must not reach them */
.wd-page .wd-p, .wd-page .wd-q, .wd-page .wd-verse { line-height: inherit; }
.wd-page h1, .wd-page h2, .wd-page h3, .wd-edit h1, .wd-edit h2, .wd-edit h3, .wd-edit p { font-family: inherit; line-height: inherit; }
.wd-p { margin: 0 0 .62em !important; white-space: pre-wrap; overflow-wrap: break-word; }
.wd-page.indents .wd-p { margin: 0 !important; }
.wd-p.ind { text-indent: 1.4em; }
.wd-page.justify .wd-p, .wd-page.justify .wd-q, .wd-page.justify .wd-li { text-align: justify; hyphens: auto; }
.wd-page.justify .wd-p.split { text-align-last: justify; }
.wd-p.cont { text-indent: 0; }
.wd-ch { margin: 0 0 1.1em; text-align: center; }
.wd-ch.open { padding-top: 18%; }
.wd-ch.cont { padding-top: 0; }
.wd-chn { font-size: .72em; letter-spacing: .22em; text-transform: uppercase; opacity: .7; margin-bottom: .35em; }
.wd-ch h1 { font-size: 1.55em; font-weight: normal; line-height: 1.15; }
.f-modern .wd-ch h1, .f-modern .wd-h2 { font-weight: bold; }
.wd-h2 { font-size: 1.22em; font-weight: bold; line-height: 1.2; margin: .5em 0 .45em !important; }
.wd-h3 { font-size: 1.04em; font-weight: bold; font-style: italic; margin: .4em 0 .3em !important; }
.wd-q { margin: .2em 1.6em .75em !important; font-size: .94em; font-style: italic; white-space: pre-wrap; }
.wd-verse { white-space: pre-wrap; margin: .2em 0 .9em 1.4em; }
.wd-verse.split, .wd-code.split { margin-bottom: 0; }
.wd-code { font-family: 'Courier Prime', 'Courier New', monospace; font-size: .82em; line-height: 1.32; white-space: pre-wrap; overflow-wrap: anywhere; background: #f3eee3; border-left: 3px solid #d8ccb4; padding: .3em .6em !important; margin: 0 0 .75em !important; }
.wd-li { position: relative; padding-left: 1.5em; margin: 0 0 .3em; white-space: pre-wrap; }
.wd-mark { position: absolute; left: .2em; top: 0; }
.wd-break { text-align: center; margin: .4em 0 .8em; letter-spacing: .3em; opacity: .75; }
.wd-drop { float: left; font-size: 3.15em; line-height: .8; margin: .06em .07em 0 0; text-indent: 0; }
.wd-run { position: absolute; top: 16px; left: 30px; right: 30px; font-size: .7em; letter-spacing: .14em; text-transform: uppercase; opacity: .55; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wd-run.l { text-align: left; } .wd-run.r { text-align: right; }
.wd-folio { position: absolute; bottom: 16px; left: 30px; right: 30px; font-size: .78em; opacity: .7; text-align: center; }
.wd-page.wd-titlepg .wd-col, .wd-page.wd-dedpg .wd-col { text-align: center; }
.wd-tt { font-size: 2em; line-height: 1.1; margin-top: 32%; }
.wd-tsub { font-size: 1.05em; font-style: italic; margin-top: .6em; opacity: .8; }
.wd-ta { margin-top: 2.2em; letter-spacing: .2em; text-transform: uppercase; font-size: .85em; }
.wd-after { margin-top: 1.4em; font-size: .78em; font-style: italic; opacity: .7; }
.wd-imprint { margin-top: 48%; font-size: .66em; letter-spacing: .25em; text-transform: uppercase; opacity: .45; }
.wd-ded { margin-top: 36%; font-style: italic; white-space: pre-wrap; }
.wd-toch { font-size: 1.3em; text-align: center; margin: 12% 0 1.2em; letter-spacing: .1em; }
.wd-toce { display: flex; align-items: baseline; gap: 4px; margin: 0 0 .35em; color: inherit; cursor: pointer; text-decoration: none; }
.wd-toce.l2 { padding-left: 1em; font-size: .94em; } .wd-toce.l3 { padding-left: 2em; font-size: .9em; }
.wd-toce span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 80%; }
.wd-toce i { flex: 1; border-bottom: 1px dotted rgba(0,0,0,.4); transform: translateY(-.25em); }
.wd-toce:hover span { text-decoration: underline; }

/* ---------- covers ---------- */
.wd-cover { --cov: #7a2a2a; position: relative; flex: none; box-sizing: border-box; background: var(--cov); color: #f3e4bc; border-radius: 3px 8px 8px 3px; overflow: hidden;
  font-family: 'Crimson Pro', Georgia, serif; box-shadow: inset 10px 0 0 rgba(0,0,0,.22), inset 12px 0 0 rgba(255,255,255,.06), 4px 6px 16px rgba(0,0,0,.35);
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 1px, transparent 1px 3px), repeating-linear-gradient(90deg, rgba(0,0,0,.03) 0 1px, transparent 1px 3px); }
.wd-cv-in { position: absolute; inset: 7% 8% 7% 12%; display: flex; flex-direction: column; align-items: center; text-align: center; }
.wd-cv-t { font-size: 30px; line-height: 1.1; margin-top: 28%; }
.wd-cv-s { font-size: 15px; font-style: italic; margin-top: 10px; opacity: .85; }
.wd-cv-a { margin-top: auto; font-size: 14px; letter-spacing: .22em; text-transform: uppercase; }
.wd-cover.hardcover .wd-cv-in { border: 2px solid #d8b450; box-shadow: inset 0 0 0 4px var(--cov), inset 0 0 0 5px rgba(216,180,80,.6); padding: 10px; color: #e8c868; }
.wd-cover.hardcover .wd-cv-t { border-top: 2px solid #d8b450; border-bottom: 2px solid #d8b450; padding: 10px 6px; }
.wd-cover.paperback { border-radius: 2px 4px 4px 2px; }
.wd-cover.paperback .wd-cv-t { background: #f6f0e0; color: #2a2228; padding: 16px 12px; width: 100%; box-sizing: border-box; box-shadow: 0 2px 0 rgba(0,0,0,.2); }
.wd-cover.booklet { border-radius: 1px; box-shadow: inset 4px 0 0 rgba(0,0,0,.15), 3px 4px 10px rgba(0,0,0,.3); }
.wd-cover.booklet::before, .wd-cover.booklet::after { content: ''; position: absolute; left: 5px; width: 3px; height: 16px; background: #b8b8c4; border-radius: 1px; }
.wd-cover.booklet::before { top: 28%; } .wd-cover.booklet::after { bottom: 28%; }
.wd-cover.booklet .wd-cv-t { background: #fbf6ea; color: #2a2228; padding: 10px 14px; border: 1px solid rgba(0,0,0,.25); font-size: 24px; }

/* ---------- the reader ---------- */
.win.wd-bookwin .win-body { padding: 10px 14px 8px; overflow: hidden; }
.wd-reader { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.wd-stage { position: relative; overflow: hidden; }
.wd-spread { display: flex; transform-origin: 0 0; position: absolute; left: 0; top: 0; }
.wd-spread.book .wd-page { box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.wd-spread.book .wd-page:first-child { background-image: linear-gradient(90deg, rgba(120,100,70,.06), transparent 15%, transparent 86%, rgba(60,40,20,.18)); }
.wd-spread.book .wd-page:nth-child(2) { background-image: linear-gradient(90deg, rgba(60,40,20,.2), transparent 12%, transparent 90%, rgba(120,100,70,.06)); }
.wd-spread.closed { left: 25%; }
.wd-spread:not(.book) .wd-page { box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.wd-rnav { display: flex; align-items: center; gap: 8px; width: 100%; font-size: 17px; }
.wd-pg { min-width: 120px; text-align: center; }
.wd-gap { flex: 1; }
.wd-byline { text-align: center; font-size: 15px; opacity: .6; }

/* ---------- ElseWord ---------- */
.win.app-word .win-body.wd-body { position: relative; padding: 0; height: 640px; overflow: hidden; display: flex; flex-direction: column; background: #d8d0c0; }
.wd-menubar { background: #1c2c5a; }
.wd-menubar button:hover { background: #34508a; }
.wd-menubar .es-brand { color: #9ad0f0; }
.wd-tools { display: flex; align-items: center; gap: 3px; padding: 4px 8px; background: #ece4d2; border-bottom: 2px solid #b8ac94; flex-wrap: nowrap; }
.wd-style { font-family: var(--font); font-size: 17px; border: 2px solid var(--ink); background: #fffdf6; padding: 0 4px; height: 26px; min-width: 150px; }
.wd-tb { min-width: 28px; height: 26px; padding: 0 6px; border: 1px solid transparent; background: none; font-family: var(--font); font-size: 18px; color: var(--ink); line-height: 1; }
.wd-tb:hover { border-color: #8a7e6a; background: #fffaf0; }
.wd-tb.bold { font-weight: bold; font-family: Georgia, serif; font-size: 16px; } .wd-tb.ital { font-style: italic; font-family: Georgia, serif; font-size: 16px; } .wd-tb.und { text-decoration: underline; font-family: Georgia, serif; font-size: 16px; }
.wd-tb.txt { border-color: var(--ink); background: #fffaf0; box-shadow: 1px 1px 0 var(--ink); }
.wd-tb.primary { background: #1c2c5a; color: #fff4e0; }
.wd-sep { width: 1px; height: 20px; background: #b8ac94; margin: 0 4px; }
.wd-find { display: flex; align-items: center; gap: 6px; padding: 4px 8px; background: #f4eedc; border-bottom: 1px solid #b8ac94; font-size: 16px; }
.wd-find .field.small { width: 160px; font-size: 16px; }
.wd-main { flex: 1; display: flex; min-height: 0; }
.wd-outline { width: 180px; flex: none; overflow: auto; background: #efe8d8; border-right: 2px solid #b8ac94; padding: 8px 6px; font-size: 16px; }
.wd-outline .side-h { margin-bottom: 6px; }
.wd-oi { display: flex; align-items: center; gap: 1px; }
.wd-oi:not(.ch) { padding-left: 12px; }
.wd-ol { flex: 1; min-width: 0; text-align: left; background: none; border: none; padding: 1px 3px; font-family: var(--font); font-size: 16px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wd-oi.ch .wd-ol { font-weight: bold; }
.wd-ol:hover { background: #fffaf0; }
.wd-om { background: none; border: none; padding: 0 2px; font-size: 11px; color: #6a5e50; }
.wd-om:hover { color: var(--ink); background: #fffaf0; }
.wd-desk { flex: 1; overflow: auto; position: relative; padding: 18px 0 40px; background: #7d828e; background-image: radial-gradient(rgba(255,255,255,.06) 1px, transparent 1px); background-size: 6px 6px; }
.wd-sheet { width: 640px; margin: 0 auto; background: #fffdf6; color: #221c20; box-shadow: 3px 4px 0 rgba(0,0,0,.35); padding: 28px 60px 80px; min-height: calc(100% - 20px); box-sizing: border-box; }
.wd-meta { margin-bottom: 18px; border-bottom: 1px dashed #d8ccb4; padding-bottom: 10px; text-align: center; }
.wd-titlein { width: 100%; border: none; background: none; text-align: center; font-family: 'Crimson Pro', Georgia, serif; font-size: 30px; color: #221c20; outline: none; }
.wd-byrow { display: flex; justify-content: center; align-items: baseline; gap: 4px; font-family: 'Crimson Pro', Georgia, serif; font-style: italic; color: #6a5e60; }
.wd-authin { border: none; background: none; font-family: inherit; font-size: 17px; font-style: italic; color: #4a3e44; outline: none; width: 220px; }
.wd-titlein:focus, .wd-authin:focus { background: #fbf4e2; }
.wd-edit { outline: none; min-height: 380px; white-space: pre-wrap; overflow-wrap: break-word; caret-color: #1c2c5a; }
.wd-edit p { margin: 0 0 .6em; }
.wd-edit h1 { font-size: 1.6em; font-weight: normal; text-align: center; margin: 1.2em 0 .6em; }
.f-modern .wd-edit h1, .f-modern .wd-edit h2 { font-weight: bold; }
.wd-sheet.numch .wd-edit { counter-reset: ch; }
.wd-sheet.numch .wd-edit h1 { counter-increment: ch; }
.wd-sheet.numch .wd-edit h1::before { content: 'Chapter ' counter(ch); display: block; font-size: .45em; letter-spacing: .22em; text-transform: uppercase; opacity: .6; }
.wd-edit h2 { font-size: 1.25em; margin: .9em 0 .4em; }
.wd-edit h3 { font-size: 1.06em; font-style: italic; margin: .7em 0 .3em; }
.wd-edit p.quote { margin: .3em 2em .7em; font-style: italic; font-size: .95em; border-left: 3px solid #e0d4bc; padding-left: .7em; }
.wd-edit pre { font-family: inherit; white-space: pre-wrap; margin: .3em 0 .9em 1.6em; }
.wd-edit pre.code { font-family: 'Courier Prime', 'Courier New', monospace; font-size: .85em; background: #f3eee3; border-left: 3px solid #d8ccb4; padding: .4em .7em; margin-left: 0; }
.wd-edit ul, .wd-edit ol { margin: 0 0 .6em; padding-left: 1.6em; }
.wd-edit hr { border: none; height: 1.4em; margin: .4em 0; position: relative; }
.wd-edit hr::after { content: '⁂'; position: absolute; left: 0; right: 0; text-align: center; opacity: .6; }
.wd-edit hr.pb { height: 1em; border-top: 2px dashed #b8b0c0; margin: 1em -30px; }
.wd-edit hr.pb::after { content: 'page break'; top: -0.85em; font-family: var(--pix); font-size: 9px; letter-spacing: 1px; background: #fffdf6; width: 90px; margin: 0 auto; color: #8a8094; opacity: 1; }
.wd-status { display: flex; align-items: center; gap: 14px; padding: 2px 10px; background: #1c2c5a; color: #d8e4f8; font-size: 16px; white-space: nowrap; }
.wd-file { font-family: var(--pix); font-size: 10px; color: #ffd860; }
.wd-saved { opacity: .75; }
.wd-goal { position: relative; display: inline-block; min-width: 0; }
.wd-goal:not(:empty) { width: 150px; height: 16px; background: #0e1838; border: 1px solid #5a6a9a; }
.wd-goal i { position: absolute; left: 0; top: 0; bottom: 0; background: #5ac860; }
.wd-goal span { position: relative; display: block; text-align: center; font-size: 13px; line-height: 16px; color: #fff; }

/* ---------- dialogs ---------- */
.win.wd-dlg .win-body, .win.wd-printwin .win-body { max-height: 560px; overflow: auto; font-size: 17px; }
.wd-dlg h4, .wd-printwin h4 { margin: 10px 0 4px; }
.wd-tpls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wd-tpl { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 8px 10px; background: #fffaf0; border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); font-family: var(--font); font-size: 18px; color: var(--ink); }
.wd-tpl span { font-size: 15px; opacity: .7; }
.wd-tpl:hover { background: #fff; }
.wd-files { display: flex; flex-direction: column; gap: 4px; max-height: 380px; overflow: auto; }
.wd-fi { display: flex; align-items: center; gap: 6px; padding: 3px 4px; border: 1px solid transparent; }
.wd-fi.on { border-color: #b8ac94; background: #fffaf0; }
.wd-fi img { width: 24px; height: 24px; image-rendering: pixelated; }
.wd-fn { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: left; background: none; border: none; font-family: var(--font); font-size: 17px; color: var(--ink); padding: 0; }
.wd-fn span { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
button.wd-fn:hover b { text-decoration: underline; }
.wd-set { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.wd-set > span { width: 100px; flex: none; }
.wd-opts { display: flex; flex-wrap: wrap; gap: 4px; }
.wd-opts .b { font-size: 15px; padding: 1px 8px; }
.wd-ticks { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; }
.wd-fld { display: flex; flex-direction: column; gap: 2px; margin: 0 0 8px; }
.wd-fld .field { width: 100%; box-sizing: border-box; }
.wd-fld textarea.field { height: 70px; resize: none; }
.wd-count { border-collapse: collapse; width: 100%; margin-bottom: 8px; }
.wd-count th { text-align: left; font-weight: normal; opacity: .75; padding: 2px 0; }
.wd-count td { text-align: right; }
.wd-prow { display: flex; gap: 14px; align-items: flex-start; }
.wd-pthumb { flex: none; overflow: hidden; box-shadow: 2px 3px 8px rgba(0,0,0,.3); }
.wd-pside { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.wd-pside label { display: flex; flex-direction: column; gap: 2px; }
.wd-pinfo { font-size: 15px; opacity: .8; }
.wd-binds { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.wd-bind { display: flex; flex-direction: column; align-items: flex-start; text-align: left; padding: 4px 8px; background: #fffaf0; border: 2px solid #b8ac94; font-family: var(--font); font-size: 17px; color: var(--ink); }
.wd-bind span { font-size: 14px; opacity: .7; }
.wd-bind.on { border-color: var(--ink); background: #fff; box-shadow: 2px 2px 0 var(--ink); }
.wd-swatches { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.wd-sw { width: 26px; height: 26px; border: 2px solid #fff; outline: 2px solid transparent; padding: 0; }
.wd-sw.on { outline-color: var(--ink); }
.wd-sw:disabled { opacity: .3; }

/* pictures in a document (Insert > Picture: drawings from ElseSprite) */
.wd-pic { margin: .3em 0 .5em; line-height: 0; }
.wd-picimg { image-rendering: pixelated; vertical-align: top; max-width: 100%; }
.wd-edit figure.pic { margin: .4em 0; line-height: 0; cursor: default; }
.wd-edit figure.pic:hover img { outline: 1px dashed #8a8094; outline-offset: 2px; }
.wd-picprev { min-height: 70px; padding: 8px; margin: 6px 0; background: #fffdf6; border: 2px solid #c8b898; text-align: center; line-height: 0; overflow: auto; max-height: 280px; }
