/* Formatted text - as shown (.rich) and in the field that edits it (.rf) - the same file in MGProject and
   MGService. The look follows MGWiki's pages, at the size of an issue's text. */

/* ---------------------------------------------------------------- as shown */
.rich { white-space:normal; word-wrap:break-word; overflow-wrap:anywhere; line-height:1.6; color:var(--n800); font-size:14px; }
.rich > :first-child { margin-top:0; }
.rich > :last-child { margin-bottom:0; }
.rich p { margin:0 0 8px; }
.rich h1, .rich h2, .rich h3, .rich h4, .rich h5, .rich h6 {
  font-family:var(--font-display); color:var(--n800); line-height:1.3; margin:16px 0 6px; font-weight:700;
}
.rich h1 { font-size:22px; } .rich h2 { font-size:19px; } .rich h3 { font-size:17px; }
.rich h4 { font-size:15px; } .rich h5 { font-size:14px; } .rich h6 { font-size:13px; color:var(--n400); }
.rich ul, .rich ol { margin:0 0 8px; padding-left:24px; }
.rich li { margin:2px 0; }
.rich li > p { margin:0 0 4px; }
.rich a { color:var(--ax-petrol); text-decoration:none; }
.rich a:hover { text-decoration:underline; }
.rich blockquote { margin:0 0 10px; padding:2px 0 2px 14px; border-left:3px solid var(--n40); color:var(--n400); }
.rich code { background:var(--n20); padding:1px 5px; border-radius:4px; font-family:var(--font-mono); font-size:12.5px; color:var(--n800); }
.rich pre {
  background:var(--n10); border:1px solid var(--n30); border-radius:var(--radius); padding:10px 12px; margin:0 0 10px;
  overflow:auto; font-family:var(--font-mono); font-size:12.5px; line-height:1.5; white-space:pre-wrap;
}
.rich pre code { background:none; padding:0; }
.rich hr { border:0; border-top:1px solid var(--n30); margin:16px 0; }
.rich img { max-width:100%; height:auto; border-radius:var(--radius); vertical-align:bottom; }
.rich figure, .rich .doc-figure { margin:8px 0 12px; }
.rich figure img { display:block; border:1px solid var(--n30); cursor:zoom-in; }
.rich.rf-body figure img { cursor:default; }
.rich figcaption { margin-top:6px; font-size:12px; color:var(--n200); }
.rich table { border-collapse:collapse; margin:4px 0 12px; font-size:13.5px; min-width:50%; }
.rich th, .rich td { border:1px solid var(--n40); padding:6px 10px; vertical-align:top; text-align:left; }
.rich th { background:var(--n20); font-family:var(--font-display); font-weight:700; }
.rich td > p:last-child, .rich th > p:last-child { margin-bottom:0; }
.rich table.sized { table-layout:fixed; }
.rich .mention {
  background:var(--ax-petrol-soft); color:var(--ax-petrol-deep); padding:0 5px; border-radius:4px; font-weight:500;
  white-space:nowrap;
}
.rich li:has(> input[type=checkbox]) { list-style:none; margin-left:-22px; }
.rich li > input[type=checkbox] { margin:0 8px 0 0; vertical-align:-2px; accent-color:var(--ax-petrol); }
.rich .attachment-link {
  display:inline-flex; align-items:center; gap:6px; padding:2px 10px 2px 8px; border:1px solid var(--n30);
  border-radius:var(--radius-pill); background:var(--n10); font-size:13px; line-height:20px; max-width:100%;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.rich .attachment-link::before { content:"\1F4CE"; font-size:12px; }
.rich .panel {
  margin:0 0 10px; padding:10px 14px 10px 42px; border-radius:var(--radius); position:relative;
  border:1px solid var(--panel-line); background:var(--panel-bg); color:var(--n800);
}
.rich .panel > :last-child { margin-bottom:0; }
.rich .panel::before {
  position:absolute; left:13px; top:11px; width:18px; height:18px; border-radius:50%;
  display:grid; place-items:center; font:700 11px/1 var(--font-display); color:#fff; background:var(--panel-mark);
}
.rich .panel-info { --panel-bg:#EAF3FC; --panel-line:#BBD6F2; --panel-mark:#2E7DD1; }
.rich .panel-info::before { content:"i"; }
.rich .panel-note { --panel-bg:#F2EFFB; --panel-line:#D5CDF2; --panel-mark:#6B5BC4; }
.rich .panel-note::before { content:"\270E"; }
.rich .panel-warning { --panel-bg:#FDF5E4; --panel-line:#F1D9A1; --panel-mark:#B98900; }
.rich .panel-warning::before { content:"!"; }
.rich .panel-success { --panel-bg:#E9F6F0; --panel-line:#B9E0CC; --panel-mark:#1F9D6B; }
.rich .panel-success::before { content:"\2713"; }
[data-theme="dark"] .rich .panel-info { --panel-bg:#17283A; --panel-line:#244260; }
[data-theme="dark"] .rich .panel-note { --panel-bg:#221E36; --panel-line:#3A3360; }
[data-theme="dark"] .rich .panel-warning { --panel-bg:#2E2614; --panel-line:#544419; }
[data-theme="dark"] .rich .panel-success { --panel-bg:#132A20; --panel-line:#1F4A37; }
.rich .status, .rich .date-chip {
  display:inline-block; padding:0 6px; border-radius:3px; font:700 11px/18px var(--font-display);
  letter-spacing:.04em; white-space:nowrap; vertical-align:1px;
}
.rich .status { text-transform:uppercase; }
.rich .status-grey { background:var(--n30); color:var(--n500); }
.rich .status-blue { background:#DCEBFA; color:#1B5C9E; }
.rich .status-green { background:#DDF2E7; color:#17704D; }
.rich .status-red { background:#FBE3E1; color:#A82E26; }
.rich .date-chip { background:var(--n20); color:var(--n500); border:1px solid var(--n40); font-weight:600; letter-spacing:0; }
[data-theme="dark"] .rich .status-blue { background:#17324F; color:#8DC1F5; }
[data-theme="dark"] .rich .status-green { background:#143826; color:#7FD8AE; }
[data-theme="dark"] .rich .status-red { background:#3D1A18; color:#F2A099; }

/* a text that can be edited: one click opens the field, as in Jira */
.rich-view.editable { cursor:text; border-radius:var(--radius); padding:6px 8px; margin:-6px -8px; min-height:34px;
  transition:background .12s ease; }
.rich-view.editable:hover { background:var(--n10); box-shadow:inset 0 0 0 1px var(--n30); }
.rich-view .rich-empty { color:var(--n200); }
.rich-view a, .rich-view img { cursor:pointer; }

/* ---------------------------------------------------------------- the field */
.rf {
  container-type:inline-size; position:relative; border:1px solid var(--n40); border-radius:var(--radius); background:var(--n0);
  transition:border-color .12s ease, box-shadow .12s ease;
}
.rf:focus-within { border-color:var(--ax-petrol); box-shadow:0 0 0 1px var(--ax-petrol); }
.rf-toolbar, .rf-tablebar {
  display:flex; flex-wrap:wrap; align-items:center; gap:1px; padding:4px 6px; border-bottom:1px solid var(--n30);
  background:var(--n10); border-radius:var(--radius) var(--radius) 0 0;
}
.rf-tablebar { background:var(--n0); border-radius:0; padding:3px 6px; }
.rf-tablebar[hidden] { display:none; }
.rf-btn {
  height:28px; min-width:28px; display:inline-flex; align-items:center; justify-content:center; gap:1px;
  border:0; background:none; border-radius:4px; color:var(--n500); cursor:pointer; padding:0 4px;
}
.rf-btn:hover { background:var(--n30); color:var(--n800); }
.rf-btn.on { background:var(--ax-petrol-soft); color:var(--ax-petrol-deep); }
.rf-icon { display:block; flex:none; }
.rf-style { min-width:104px; justify-content:space-between; padding:0 6px 0 8px; font:600 13px var(--font-display); }
.rf-style-name { white-space:nowrap; }
.rf-caret { width:0; height:0; margin-left:3px; border-left:3.5px solid transparent; border-right:3.5px solid transparent;
  border-top:4px solid currentColor; opacity:.7; }
.rf-letter { position:relative; font:700 15px/1 var(--font-display); padding-bottom:4px; display:inline-block; }
.rf-swatch { position:absolute; left:-2px; right:-2px; bottom:0; height:3px; border-radius:2px;
  background:linear-gradient(90deg, #DE350B 0 34%, #FF991F 34% 67%, #0052CC 67%); }
.rf-split { width:1px; height:18px; background:var(--n40); margin:0 4px; }
.rf-grow { flex:1; }
.rf-busy { font-size:12px; color:var(--n200); padding:0 6px; }
.rf-scroll { overflow:auto; max-height:70vh; }
.rf-body {
  position:relative; min-height:96px; padding:10px 12px; outline:none; white-space:pre-wrap; white-space:break-spaces;
  font-variant-ligatures:none; caret-color:var(--ax-petrol); cursor:text;
}
.rf-body pre { white-space:pre-wrap; }
.rf-body li { position:relative; }
.rf-body .is-empty::before {
  content:attr(data-placeholder); position:absolute; color:var(--n70); pointer-events:none; white-space:nowrap;
}
.rf-body .ProseMirror-selectednode { outline:2px solid var(--ax-petrol); outline-offset:2px; border-radius:2px; }
.rf-body figure.ProseMirror-selectednode, .rf-body img.ProseMirror-selectednode { outline:none; }
.rf-body img.picked { outline:2px solid var(--ax-petrol); outline-offset:2px; }
.rf-body img:hover { outline:1px dashed var(--n50); outline-offset:2px; }
.rf-body li.task-item { display:flex; gap:8px; align-items:flex-start; margin-left:-22px; list-style:none; }
.rf-body li.task-item > .task-text { flex:1; min-width:0; }
.rf-body li.task-item.done > .task-text { color:var(--n200); text-decoration:line-through; }
.rf-body .task-box { width:15px; height:15px; margin:4px 0 0; accent-color:var(--ax-petrol); flex:none; cursor:pointer; }
.rf-body .tableWrapper { position:relative; overflow-x:auto; overflow-y:visible; padding-right:16px; margin:4px 0 12px; }
.rf-body .tableWrapper table { margin:0; }
.rf-body .table-grips { position:absolute; inset:0 auto auto 0; width:0; height:0; }
.rf-body .col-grab, .rf-body .table-grab { position:absolute; width:11px; cursor:col-resize; user-select:none; z-index:5; }
.rf-body .table-grab { width:13px; cursor:ew-resize; }
.rf-body .col-grab::before, .rf-body .table-grab::before {
  content:""; display:block; width:2px; height:100%; margin:0 auto; background:transparent;
}
.rf-body .tableWrapper:hover .col-grab::before, .rf-body .tableWrapper:hover .table-grab::before { background:var(--n50); }
.rf-body .col-grab:hover::before, .rf-body .table-grab:hover::before { background:var(--ax-petrol); }
.rf-body td, .rf-body th { position:relative; }
.rf-body .selectedCell::after {
  content:""; position:absolute; inset:0; z-index:2; pointer-events:none;
  background:color-mix(in srgb, var(--ax-petrol) 16%, transparent);
}
.rf-body.dropping { outline:2px dashed var(--ax-petrol); outline-offset:-4px; background:var(--ax-petrol-soft); }
.rf-uploading .rf-body { opacity:.85; }
.ProseMirror-hideselection *::selection { background:transparent; }
.ProseMirror-hideselection { caret-color:transparent; }
img.ProseMirror-separator { display:inline !important; border:none !important; margin:0 !important; }
.ProseMirror-gapcursor { display:none; pointer-events:none; position:absolute; }
.ProseMirror-gapcursor:after {
  content:""; display:block; position:absolute; top:-2px; width:20px; border-top:1px solid var(--n800);
  animation:rf-blink 1.1s steps(2, start) infinite;
}
@keyframes rf-blink { to { visibility:hidden; } }
.ProseMirror-focused .ProseMirror-gapcursor { display:block; }
/* the grid for pictures is the page editor's (MGWiki); a field shows only the size */
.rf .pixel-grid { display:none; }
.rf .size-badge {
  position:absolute; z-index:60; pointer-events:none; background:var(--n800); color:var(--n0);
  border-radius:var(--radius); padding:3px 8px; font-size:12px; font-weight:600; white-space:nowrap;
}

/* Save and Cancel under a field, as in Jira */
.rf-actions { display:flex; align-items:center; gap:6px; margin-top:8px; }
.rf-actions .hint { margin:0 0 0 6px; font-size:12px; }

/* menus: the text style, more formatting, colour, insert - and "/" and "@" */
.rf-menu, .slash-menu, .mention-box {
  position:absolute; z-index:1200; background:var(--n0); border:1px solid var(--n40);
  border-radius:var(--radius-lg); box-shadow:var(--shadow-overlay); padding:4px;
  min-width:220px; max-height:340px; overflow-y:auto;
}
.rf-menu-item, .slash-hit {
  display:flex; align-items:center; gap:10px; width:100%; border:0; background:none; text-align:left;
  padding:6px 9px; border-radius:var(--radius); color:var(--n500); font-size:13.5px; cursor:pointer;
}
.rf-menu-item:hover, .slash-hit:hover, .slash-hit.on { background:var(--n20); color:var(--n800); }
.rf-menu-item.on { background:var(--ax-petrol-soft); color:var(--ax-petrol-deep); }
.rf-menu-label { flex:1; }
.rf-menu-keys { font-size:11.5px; color:var(--n200); white-space:nowrap; padding-left:14px; }
.rf-menu-split { height:1px; background:var(--n30); margin:4px 6px; }
.rf-style-h1 .rf-menu-label { font:700 20px var(--font-display); }
.rf-style-h2 .rf-menu-label { font:700 18px var(--font-display); }
.rf-style-h3 .rf-menu-label { font:700 16px var(--font-display); }
.rf-style-h4 .rf-menu-label { font:700 14.5px var(--font-display); }
.rf-style-h5 .rf-menu-label { font:700 13.5px var(--font-display); }
.rf-style-h6 .rf-menu-label { font:700 12.5px var(--font-display); color:var(--n400); }
.rf-colours { display:grid; grid-template-columns:repeat(5, 26px); gap:6px; padding:6px; }
.rf-colour { width:26px; height:26px; border-radius:4px; border:1px solid rgba(0,0,0,.12); cursor:pointer; padding:0;
  background:var(--n0); display:grid; place-items:center; }
.rf-colour:hover { box-shadow:0 0 0 2px var(--ax-petrol); }
.rf-nocolour { width:16px; height:16px; background:linear-gradient(135deg, transparent 45%, var(--n200) 45% 55%, transparent 55%); }
.slash-icon {
  width:26px; height:26px; flex:none; display:grid; place-items:center; border:1px solid var(--n40);
  border-radius:var(--radius); font-size:12px; font-weight:700; font-family:var(--font-display);
  color:var(--n400); background:var(--n10);
}
.mention-hit {
  display:flex; align-items:center; gap:9px; width:100%; text-align:left; padding:6px 8px; border:0;
  background:none; border-radius:var(--radius); cursor:pointer; color:var(--n400);
}
.mention-hit:hover, .mention-hit.on { background:var(--ax-petrol-soft); }
.mention-hit b { display:block; color:var(--n800); font-size:13.5px; }
.mention-hit .hint { margin:0; font-size:12px; }
.link-bubble {
  position:absolute; z-index:1150; display:flex; align-items:center; gap:4px; padding:4px 6px;
  background:var(--n0); border:1px solid var(--n40); border-radius:var(--radius-lg);
  box-shadow:var(--shadow-overlay); font-size:13px; max-width:520px;
}
.link-bubble[hidden] { display:none; }
.link-bubble .lb-url { padding:0 6px; color:var(--ax-petrol); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.link-bubble button { border:0; background:none; padding:3px 8px; border-radius:var(--radius); color:var(--n400); cursor:pointer; }
.link-bubble button:hover { background:var(--n20); color:var(--n800); }

/* a narrow field: table, code, panel and quote are in the + menu only */
@container (max-width:560px) {
  .rf-wide { display:none; }
  .rf-toolbar .rf-split { margin:0 2px; }
}
.rf-body td p, .rf-body th p { margin:0; }
