/* New browser editor: the text looks like the manual (theme/html/fly.css,
   PDF layout), the editing controls are plain and grey. */

.fly-editor { --blue: #4F81BD; --light: #DBE5F1; --dark: #243F60; --only: #b07a40;
              font-family: "Noto Sans", Carlito, Calibri, sans-serif; color: #222; }

.fly-pdfs { position: fixed; right: 16px; bottom: 16px; z-index: 1000; padding: 10px 18px; border-radius: 6px;
            background: #4F81BD; color: #fff; font: 600 14px sans-serif; text-decoration: none;
            box-shadow: 0 2px 6px rgba(0,0,0,.25); }

/* Toolbar */
.fly-toolbar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 6px 14px;
               padding: 8px; background: #f4f6f9; border-bottom: 1px solid #d5dbe3; }
.fly-group { display: flex; gap: 4px; align-items: center; }
.fly-tool, .fly-button, .fly-style { font: 14px "Noto Sans", sans-serif; padding: 5px 10px; border: 1px solid #c8d0db;
            background: #fff; color: #243F60; border-radius: 4px; cursor: pointer; }
.fly-tool:hover, .fly-button:hover { background: #DBE5F1; }
.fly-tool.active { background: #4F81BD; color: #fff; border-color: #4F81BD; }
.fly-show-as { font-size: 13px; color: #555; margin-left: 4px; }

/* The page */
.fly-page .ProseMirror { padding: 24px 32px 80px; outline: none; font-size: 15px; line-height: 1.5; min-height: 400px; }
.fly-page .ProseMirror p, .fly-icontext { margin: 0 0 10px; font-size: 15px; letter-spacing: normal; color: #222; }
.fly-icontext { margin: 0; }
.fly-page h1 { background: #4F81BD; color: #fff; padding: 4px 10px; text-transform: uppercase; font-size: 1.4em; margin: 0 0 14px; }
.fly-page h2 { background: #DBE5F1; padding: 4px 10px; text-transform: uppercase; letter-spacing: .12em; font-size: 1em; margin: 22px 0 10px; }
.fly-page h3 { font-size: 1em; text-transform: uppercase; color: #243F60; margin: 18px 0 8px; }
.fly-page h4 { font-size: 1em; color: #243F60; margin: 14px 0 6px; }

/* Warning and note boxes, as in the manual */
.fly-box { position: relative; display: flex; gap: 14px; align-items: center; margin: 12px 0;
           padding: 8px 36px 8px 8px; border-top: 1px solid #4F81BD; border-bottom: 1px solid #4F81BD; }
.fly-box-side { display: flex; flex-direction: column; align-items: center; width: 54px; flex: none; user-select: none; }
.fly-box-icon { width: 44px; }
.fly-box-label { font-size: 10px; color: #888; text-transform: uppercase; letter-spacing: .08em; }
.fly-box-body { flex: 1; min-width: 0; }
.fly-box-body p:last-child { margin-bottom: 0; }
.fly-warning .fly-box-body { text-transform: uppercase; }

.fly-remove { position: absolute; top: 4px; right: 4px; border: none; background: none; color: #999;
              cursor: pointer; font-size: 14px; padding: 2px 6px; border-radius: 3px; }
.fly-remove:hover { background: #f3d6d6; color: #c0392b; }

/* Only for some models */
.fly-only { margin: 12px 0; border: 2px dashed #d9b48a; border-radius: 6px; padding: 0 12px 4px; }
.fly-only-head { display: flex; align-items: center; gap: 8px; margin: 0 -12px 8px; padding: 4px 36px 4px 10px; position: relative;
                 background: #fbf3ea; border-radius: 4px 4px 0 0; font-size: 13px; color: #8a5a2b; user-select: none; }
.fly-only-head .fly-remove { top: 3px; }
.fly-only-title { font-weight: 600; }
.fly-only-head select { font: 13px "Noto Sans", sans-serif; padding: 2px 4px; border: 1px solid #d9b48a; border-radius: 3px; background: #fff; }
.fly-only-models { color: #8a6d3b; }
.fly-only-unset { border-color: #c0392b; }
.fly-only-unset .fly-only-head { background: #fbe3e3; color: #c0392b; }
.fly-only .fly-only { border-color: #e6cdb0; }

/* "Show as": text not in the chosen model's manual */
.fly-not-in-model { opacity: .35; }
.fly-not-in-model > .fly-only-head .fly-only-models::after { content: "  (not in this manual)"; font-weight: 600; }
.fly-showing-model .fly-only:not(.fly-not-in-model) { border-color: #9cc59e; }
.fly-showing-model .fly-only:not(.fly-not-in-model) > .fly-only-head { background: #eef6ee; color: #2e7d32; }

/* Pictures */
.fly-picture { position: relative; margin: 12px 0; padding: 6px; border: 1px solid transparent; border-radius: 4px; }
.fly-picture:hover, .fly-picture.ProseMirror-selectednode { border-color: #c8d0db; }
.fly-picture.ProseMirror-selectednode { outline: 2px solid #4F81BD; }
.fly-picture-frame { text-align: center; }
.fly-picture-frame img { max-width: 100%; }
.fly-picture-bar { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); display: flex; gap: 6px; align-items: center;
                    padding: 4px 8px; background: rgba(255,255,255,.92); border-radius: 4px; box-shadow: 0 1px 4px rgba(0,0,0,.25);
                    visibility: hidden; font-size: 12px; color: #555; white-space: nowrap; }
.fly-picture-bar .fly-button { font-size: 12px; padding: 2px 8px; }
.fly-picture:hover .fly-picture-bar, .fly-picture.ProseMirror-selectednode .fly-picture-bar { visibility: visible; }
.fly-missing { display: inline-block; padding: 18px 24px; border: 2px dashed #c0392b; color: #c0392b; background: #fdf0f0; border-radius: 4px; font-size: 13px; }
.fly-missing.small { padding: 2px 4px; border-width: 1px; font-size: 11px; }

.fly-iconpara { display: flex; align-items: center; gap: 14px; margin: 10px 0; }
.fly-icon { flex: none; width: 44px; cursor: pointer; border-radius: 4px; }
.fly-icon:hover { outline: 2px solid #4F81BD; }
.fly-icon img { width: 44px; display: block; }
.fly-icontext { flex: 1; }
.fly-inline-picture { height: 1.3em; vertical-align: middle; }

/* Written in VS Code: shown, not edited */
.fly-raw { margin: 12px 0; border-left: 4px solid #bbb; background: #f4f4f4; padding: 4px 10px; }
.fly-raw-label { font-size: 11px; color: #777; text-transform: uppercase; letter-spacing: .06em; }
.fly-raw pre { margin: 4px 0; font-size: 12px; white-space: pre-wrap; }

/* Picture gallery */
.fly-gallery { position: fixed; inset: 0; z-index: 2000; background: rgba(20,30,45,.45); display: flex; align-items: center; justify-content: center; }
.fly-gallery-box { background: #fff; width: min(960px, 92vw); max-height: 86vh; display: flex; flex-direction: column; border-radius: 8px;
                   box-shadow: 0 8px 30px rgba(0,0,0,.3); font-family: "Noto Sans", sans-serif; }
.fly-gallery-head { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid #e3e7ed; }
.fly-gallery-search { flex: 1; font-size: 15px; padding: 6px 10px; border: 1px solid #c8d0db; border-radius: 4px; }
.fly-gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; padding: 16px; overflow: auto; }
.fly-gallery-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; border: 1px solid #e3e7ed;
                    border-radius: 6px; background: #fff; cursor: pointer; font-size: 13px; color: #243F60; }
.fly-gallery-card:hover { border-color: #4F81BD; background: #f4f8fc; }
.fly-gallery-card.current { border: 2px solid #4F81BD; }
.fly-gallery-thumb { height: 100px; display: flex; align-items: center; justify-content: center; }
.fly-gallery-thumb img { max-height: 100px; max-width: 140px; }

/* Pictures page */
.fly-hint { color: #666; font-size: 13px; margin: 6px 0; }
.fly-add-picture { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; width: 100%; }
.fly-add-picture input { flex: 1; min-width: 260px; }
.fly-add-picture .fly-hint { flex-basis: 100%; margin: 0; }
.fly-pictures > .fly-hint, .fly-pictures-search { padding: 0 16px; }
.fly-pictures-search .fly-gallery-search { width: 100%; box-sizing: border-box; }
.fly-pictures-list { padding: 8px 16px 40px; display: flex; flex-direction: column; gap: 8px; }
.fly-picture-card { border: 1px solid #e3e7ed; border-radius: 6px; background: #fff; }
.fly-picture-card.open { border-color: #4F81BD; }
.fly-picture-head { display: flex; align-items: center; gap: 14px; padding: 8px 12px; cursor: pointer; }
.fly-picture-head:hover { background: #f4f8fc; }
.fly-picture-title { flex: 1; display: flex; flex-direction: column; }
.fly-picture-title small { color: #777; }
.fly-picture-status { color: #c0392b; font-size: 13px; }
.fly-open { color: #888; }
.fly-file-thumb { position: relative; width: 120px; height: 72px; display: flex; align-items: center; justify-content: center;
                  background: #f6f7f9; border-radius: 4px; flex: none; }
.fly-file-thumb img { max-width: 116px; max-height: 68px; }
.fly-file-missing { color: #c0392b; font-size: 12px; font-weight: 600; }
.fly-file-none { color: #aaa; }
.fly-new { position: absolute; top: 2px; right: 2px; background: #2e7d32; color: #fff; font-size: 10px; padding: 0 4px; border-radius: 3px; }
.fly-picture-details { padding: 4px 16px 16px; display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; font-size: 14px; }
.fly-how-label { flex-basis: 100%; display: flex; flex-direction: column; gap: 4px; }
.fly-how { font: 14px "Noto Sans", sans-serif; padding: 6px; border: 1px solid #c8d0db; border-radius: 4px; }
.fly-files { border-collapse: collapse; margin-top: 4px; }
.fly-files th { font-size: 13px; text-align: left; color: #243F60; padding: 4px 8px; }
.fly-files td { padding: 6px 8px; vertical-align: top; }
.fly-files td .fly-button { display: block; margin-top: 4px; font-size: 12px; padding: 3px 8px; }
.fly-picture-details > div { flex-basis: 100%; }

/* Translations page */
.fly-counts { font-size: 13px; color: #555; }
.fly-po-head, .fly-po-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 8px 16px; }
.fly-po-head { border-bottom: 1px solid #d5dbe3; color: #243F60; }
.fly-po-row { border-bottom: 1px solid #eef0f3; font-size: 14px; line-height: 1.45; }
.fly-po-english small { display: block; margin-top: 4px; font-size: 11px; color: #999; }
.fly-po-text { width: 100%; box-sizing: border-box; font: 14px/1.45 "Noto Sans", sans-serif; padding: 6px 8px;
               border: 1px solid #c8d0db; border-radius: 4px; resize: vertical; overflow: hidden; }
.fly-po-text:focus { outline: 2px solid #4F81BD; border-color: #4F81BD; }
.fly-po-state { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.fly-po-state .fly-button { font-size: 12px; padding: 2px 8px; }
.fly-state { font-size: 12px; padding: 1px 8px; border-radius: 10px; }
.fly-state-done { background: #e8f3e8; color: #2e7d32; }
.fly-state-check { background: #fdf2dc; color: #a06a00; }
.fly-state-missing { background: #fbe3e3; color: #c0392b; }

/* Chapters page */
.fly-add-chapter select { max-width: 280px; }
.fly-chapters > .fly-hint { padding: 0 16px; }
.fly-chapters-list { padding: 8px 16px 40px; display: flex; flex-direction: column; gap: 6px; }
.fly-chapter { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border: 1px solid #e3e7ed; border-radius: 6px; background: #fff; }
.fly-chapter.new { border-color: #2e7d32; }
.fly-chapter-number { font-weight: bold; color: #243F60; min-width: 2em; text-align: right; }
.fly-chapter-title { flex: 1; font-weight: bold; }
.fly-chapter .fly-hint { margin: 0; }
.fly-chapter .fly-button[disabled] { opacity: 0.3; cursor: default; }
.fly-badge { margin-left: 8px; background: #2e7d32; color: #fff; font-size: 11px; font-weight: normal; padding: 1px 5px; border-radius: 3px; }

/* Draw references (draw.js): draw.io over the whole page */
.fly-draw { position: fixed; inset: 0; z-index: 10000; background: #fff; display: flex; flex-direction: column; }
.fly-draw-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid #c8d0db; background: #f4f8fc; }
.fly-draw-bar .fly-hint { flex-basis: 100%; margin: 0; }
.fly-draw-frame { flex: 1; width: 100%; border: 0; }
.fly-primary { background: #4F81BD; color: #fff; border-color: #4F81BD; }
.fly-primary:hover { background: #243F60; }
.fly-tool[disabled] { opacity: 0.5; cursor: default; }
.fly-draw-note { flex-basis: 100%; color: #8a5a00; background: #fff4d6; border: 1px solid #f0d48a; border-radius: 4px; padding: 4px 8px; }
.fly-ref-state { display: block; margin-top: 4px; font-size: 12px; color: #8a5a00; background: #fff4d6; border-radius: 3px; padding: 2px 6px; max-width: 200px; }
.fly-ref-notice { margin: 4px 0 8px; padding: 4px 8px; border-radius: 4px; background: #e8f3e9; color: #1e5b22; font-size: 13px; }
/* Inside the window but invisible: Chrome pauses frames of other sites placed outside it. */
.fly-draw-hidden { position: fixed; left: 0; top: 0; width: 1000px; height: 800px; border: 0; opacity: 0; pointer-events: none; z-index: -1; }
.fly-chapter .fly-chapter-remove { color: #a12a2a; }
.fly-removed { margin-top: 10px; padding: 8px 12px; border: 1px dashed #d9a3a3; border-radius: 6px; background: #fdf3f3; }
.fly-removed-chapter { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.fly-picture-remove-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid #e3e7ed; }
.fly-picture-remove { color: #a12a2a; }
.fly-remove-message { max-width: none; margin: 0; }

/* Languages page */
.fly-language-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 16px; padding: 8px 16px; }
.fly-language-form label { display: flex; flex-direction: column; font-size: 13px; color: #243F60; gap: 3px; }
.fly-language-form input { font: 14px "Noto Sans", sans-serif; padding: 5px 8px; border: 1px solid #c8d0db; border-radius: 4px; }
.fly-languages > .fly-hint { padding: 0 16px; }
.fly-languages-list { padding: 8px 16px 40px; display: flex; flex-direction: column; gap: 6px; }
