/* Story Canon. Colours come from /theme.css (generated, contrast-tested). */
*, *::before, *::after { box-sizing: border-box; }
html { margin: 0; height: 100%; }
body {
  margin: 0; min-height: 100%; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text); font-family: var(--ui-font); font-size: 16px; line-height: 1.5;
  transition: background-color .4s ease;
}
a { color: var(--accent); }
h1 { font-size: 1.6rem; margin: .2em 0 .6em; }
h2 { font-size: 1rem; margin: 0 0 .4em; letter-spacing: .02em; }
h3 { font-size: .95rem; margin: .8em 0 .3em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.spacer { flex: 1; }
.hint, .meta { color: var(--muted); font-size: .88rem; }
.error { color: var(--text); background: var(--surface); border-left: 4px solid #b3261e; padding: .5em .8em; }
.ok { border-left: 4px solid #2e7d32; padding: .5em .8em; background: var(--surface); }
.callout { border: 1px solid var(--accent); background: var(--surface); padding: .6em .9em; border-radius: 8px; margin-bottom: 1em; }
.copy { width: 100%; font-family: ui-monospace, Consolas, monospace; }
.count { color: var(--muted); font-weight: normal; font-size: .85em; margin-left: .3em; }

/* top bar */
.topbar {
  display: flex; align-items: center; gap: .8rem; padding: .5rem 1rem; background: var(--surface);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; min-height: 52px;
}
.brand { font-weight: 700; text-decoration: none; color: var(--text); letter-spacing: .02em; }
.crumb { color: var(--muted); max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumb::before { content: "/ "; }
.menu { position: relative; }
.menu summary { cursor: pointer; list-style: none; padding: .35em .7em; border: 1px solid var(--border); border-radius: 6px; }
.menu summary::-webkit-details-marker { display: none; }
.menu-body {
  position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: .8rem 1rem; min-width: 230px;
  box-shadow: 0 8px 24px rgba(0,0,0,.18); display: flex; flex-direction: column; gap: .4rem;
}
.menu-body fieldset { border: 0; padding: 0; margin: 0; }
.menu-body legend { font-weight: 600; margin-bottom: .2em; }
.menu-body hr { border: 0; border-top: 1px solid var(--border); width: 100%; }
.radio, .switch { display: flex; align-items: center; gap: .45em; padding: .15em 0; cursor: pointer; }
.badge {
  background: var(--badge); color: var(--badge-text); border-radius: 999px; padding: .25em .8em;
  text-decoration: none; font-weight: 600; font-size: .9rem; display: none; white-space: nowrap;
}
.badge.has-new { box-shadow: 0 0 0 3px var(--border); }

/* forms */
label { display: flex; flex-direction: column; gap: .2em; font-size: .9rem; }
input, select, textarea, button { font: inherit; color: var(--text); }
input, select, textarea {
  background: var(--editor); border: 1px solid var(--border); border-radius: 6px; padding: .45em .6em;
}
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 1px;
}
button {
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: .45em .9em; cursor: pointer;
}
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
button.small { padding: .25em .65em; font-size: .88rem; }
button:disabled { opacity: .75; cursor: default; }
button.linklike { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; text-align: left; }
form.inline { display: inline; }
.row-form { display: flex; gap: .8rem; align-items: flex-end; flex-wrap: wrap; }
.row-form .grow, .row .grow { flex: 1; min-width: 12rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1rem 1.2rem; }

/* narrow pages */
body.narrow main { max-width: 760px; margin: 1.5rem auto; padding: 0 1rem; }
body.narrow main.card { padding: 1.2rem 1.4rem; }
.auth form { display: flex; flex-direction: column; gap: .8rem; }
.auth { max-width: 420px !important; }
.stories { list-style: none; padding: 0; display: grid; gap: .8rem; margin-top: 1rem; }
.story-card { display: flex; flex-direction: column; gap: .1rem; }
.story-title { font-size: 1.15rem; font-weight: 600; text-decoration: none; }
.empty { color: var(--muted); }
ul.plain { padding-left: 1.1em; }
ul.plain li { margin: .3em 0; }
.review-list { list-style: none; padding: 0; display: grid; gap: .8rem; }
.review-summary { font-size: 1.05rem; margin: 0 0 .3em; }
.choices { display: flex; gap: .5rem; margin-top: .6rem; flex-wrap: wrap; align-items: center; }
.choices-row { display: flex; gap: .5rem; flex-wrap: nowrap; }
.choices button { min-width: 6.5rem; min-height: 44px; }

/* workspace */
body.workspace { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.split { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 440px); min-height: 0; }
.editor-col { display: flex; flex-direction: column; min-height: 0; padding: .8rem 1.2rem 1rem; gap: .5rem; }
.scene-bar, .scene-meta { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.scene-meta form:first-child { flex: 1; min-width: 12rem; }
.scene-title { width: 100%; font-size: 1.25rem; font-weight: 600; background: transparent; border-color: transparent; font-family: var(--prose-font); }
.scene-title:hover { border-color: var(--border); }
.pov-form label { flex-direction: row; align-items: center; gap: .4em; }
.save-status { color: var(--muted); font-size: .85rem; }
.conflict { background: var(--surface); border-left: 4px solid #b3261e; padding: .4em .8em; }
.editor {
  flex: 1; width: 100%; resize: none; min-height: 50vh; background: var(--editor); color: var(--text);
  font-family: var(--prose-font); font-size: 1.12rem; line-height: 1.75; padding: 1.2rem 1.4rem;
  border-radius: 8px; border: 1px solid var(--border);
}
.panel-col { border-left: 1px solid var(--border); background: var(--surface); overflow: hidden; min-height: 0; display: flex; flex-direction: column; }
.panel { padding: .9rem 1rem 2rem; display: flex; flex-direction: column; gap: 1rem; }
.panel.flash { animation: flash 1.2s ease; }
@keyframes flash { from { box-shadow: inset 4px 0 0 var(--accent); } to { box-shadow: inset 0 0 0 transparent; } }
.panel-sec { border-bottom: 1px solid var(--border); padding-bottom: .8rem; }
.changes { list-style: none; padding: 0; margin: 0; font-size: .9rem; }
.changes li { padding: .2em 0; display: flex; flex-direction: column; }
.entities { list-style: none; padding: 0; margin: 0; }
.entity { padding: .45em 0; border-top: 1px dashed var(--border); }
.entity:first-child { border-top: 0; }
.ehead { display: flex; flex-wrap: wrap; gap: .35em; align-items: baseline; }
.ename { font-weight: 600; }
.esum { margin: .15em 0 0; display: flex; gap: .4em; align-items: baseline; min-width: 0; font-size: .9rem; }
.esum-text { color: var(--text); flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.esum-text.empty-sum { color: var(--muted); font-style: italic; }
.elinks { display: flex; flex-wrap: wrap; gap: .1em 1em; align-items: flex-start; margin-top: .15em; }
.elinks > details { font-size: .86rem; }
.elinks > details > summary { cursor: pointer; color: var(--accent); list-style: none; text-decoration: underline; text-underline-offset: 2px; }
.elinks > details > summary::-webkit-details-marker { display: none; }
.elinks > details[open] { flex-basis: 100%; }
.edit-body { border-left: 3px solid var(--border); padding-left: .7rem; margin-top: .3rem; }
.when-chip { font-size: .76rem; border-radius: 999px; padding: 0 .55em; border: 1px solid var(--accent); color: var(--accent); white-space: nowrap; }
.fact-tag { font-size: .7rem; letter-spacing: .02em; border: 1px solid var(--border); border-radius: 4px; padding: 0 .4em; color: var(--muted); white-space: nowrap; flex: none; font-family: var(--ui-font, inherit); }
.order-note { margin: -.3rem 0 .3rem; font-size: .8rem; color: var(--muted); }
ol.entities { list-style: none; counter-reset: ev; }
ol.entities > li { counter-increment: ev; padding-left: 1.6em; position: relative; }
ol.entities > li::before { content: counter(ev) "."; position: absolute; left: 0; top: .45em; color: var(--muted); font-size: .85rem; }
.show-all { display: inline-block; margin-top: .3rem; font-size: .88rem; }
.badge[hidden] { display: none !important; }
.tag { font-size: .78rem; border: 1px solid var(--border); border-radius: 999px; padding: 0 .5em; color: var(--muted); }
.mood-chip { font-size: .78rem; border-radius: 999px; padding: 0 .55em; background: var(--accent); color: var(--accent-text); }
.facts { font-size: .9rem; padding-left: 1.1em; margin: .2em 0 .5em; }
.facts li { margin: .15em 0; }
form.mini { display: flex; flex-direction: column; gap: .4rem; margin: .4rem 0 .6rem; }
form.mini .row { display: flex; gap: .5rem; }
form.mini button { align-self: flex-start; }
details.more > summary { cursor: pointer; color: var(--accent); font-size: .88rem; }
.form-msg { margin: 0; font-size: .85rem; color: var(--muted); min-height: 1.2em; }
.panel-foot { font-size: .9rem; }

/* phone: editor only, badge visible */
@media (max-width: 820px) {
  .split { grid-template-columns: 1fr; }
  .panel-col { display: none; }
  .badge { display: inline-block; }
  .crumb { max-width: 30vw; }
  .editor-col { padding: .6rem .7rem .7rem; }
  .editor { padding: .9rem; font-size: 1.08rem; min-height: 60vh; }
  .topbar { gap: .5rem; padding: .4rem .7rem; }
  .menu-body { position: fixed; left: .5rem; right: .5rem; top: 56px; }
  .pov-form label { font-size: .85rem; }
}

/* small polish */
.brand, .menu summary, .badge { white-space: nowrap; }
.crumb { flex: 0 1 auto; min-width: 0; }
.choices.demo button:disabled { opacity: 1; }
@media (max-width: 420px) {
  .brand { font-size: .95rem; }
  .crumb { display: none; }
}

/* ---- right column: tabs, live feed, structures ---- */
.button { display: inline-block; text-decoration: none; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: .45em .9em; color: var(--text); }
.tabs { display: flex; gap: .2rem; padding: .5rem .6rem 0; border-bottom: 1px solid var(--border); background: var(--surface); flex: none; }
.tabs [role="tab"] { border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0; background: transparent; padding: .45em .8em; font-weight: 600; color: var(--muted); }
.tabs [role="tab"][aria-selected="true"] { background: var(--bg); border-color: var(--border); color: var(--text); margin-bottom: -1px; box-shadow: inset 0 3px 0 var(--accent); }
.tab-count { background: var(--badge); color: var(--badge-text); border-radius: 999px; padding: 0 .5em; font-size: .78rem; margin-left: .25em; }
.pane { flex: 1; min-height: 0; overflow-y: auto; }
.pane[hidden] { display: none; }
.pane[data-pane="feed"]:not([hidden]) { display: flex; flex-direction: column; overflow: hidden; }
.feed { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.feed-empty { padding: 1rem; margin: 0; }
.feed-list { list-style: none; margin: 0; padding: .4rem 0 .8rem; flex: 1; overflow-y: auto; scroll-behavior: smooth; }
.feed-item { padding: .5rem 1rem .5rem .9rem; border-left: 4px solid transparent; border-bottom: 1px dashed var(--border); line-height: 1.45; }
.feed-item:last-child { border-bottom: 0; }
.feed-chip { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; border: 1px solid var(--border); border-radius: 4px; padding: 0 .45em; margin-right: .3em; vertical-align: .05em; }
.feed-text { overflow-wrap: anywhere; }
.feed-meta { display: block; color: var(--muted); font-size: .8rem; }
.tone-spotted .feed-chip { border-color: var(--accent); }
.tone-accept .feed-chip { border-color: #2e7d32; }
.tone-rejected .feed-chip { border-color: #b3261e; }
.tone-retcon .feed-chip { border-color: #8e44ad; }
.feed-jump { position: absolute; left: 50%; bottom: .7rem; transform: translateX(-50%); background: var(--badge); color: var(--badge-text); border-color: var(--badge); font-weight: 600; border-radius: 999px; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.feed-jump[hidden] { display: none; }
.feed-foot { margin: 0; padding: .4rem 1rem; border-top: 1px solid var(--border); font-size: .88rem; flex: none; }
.just-in { animation: slotin 1.6s ease both; }
@keyframes slotin {
  0% { opacity: 0; transform: translateY(10px); background: color-mix(in srgb, var(--accent) 34%, transparent); box-shadow: inset 4px 0 0 var(--accent); }
  25% { opacity: 1; transform: none; }
  100% { opacity: 1; transform: none; background: transparent; box-shadow: inset 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .just-in { animation: none; box-shadow: inset 4px 0 0 var(--accent); }
  .feed-list { scroll-behavior: auto; }
}

.structs { padding: .8rem 1rem 2rem; display: flex; flex-direction: column; gap: .7rem; }
body.narrow .structs { padding: 0 0 2rem; }
.struct-intro, .struct-reader { margin: 0; }
.struct-actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.filters { display: flex; gap: .3rem; flex-wrap: wrap; }
.filter[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
.filter[aria-pressed="true"] .count { color: inherit; }
.sgroup h3 { margin: .4rem 0 .3rem; }
.sitems { list-style: none; margin: 0; padding: 0; }
.sitem { padding: .55rem .2rem .55rem .7rem; border-left: 4px solid var(--border); border-bottom: 1px dashed var(--border); display: flex; flex-direction: column; gap: .15rem; }
.sitem[hidden] { display: none; }
.sitem.status-pending { border-left-color: var(--accent); }
.sitem.status-accepted { border-left-color: #2e7d32; }
.sitem.status-rejected { border-left-color: #b3261e; }
.sitem.status-rejected .stext { text-decoration: line-through; text-decoration-color: var(--muted); }
.srow { display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; }
.stext { overflow-wrap: anywhere; flex: 1 1 12rem; }
.pill { font-size: .74rem; font-weight: 700; border: 1px solid var(--border); border-radius: 999px; padding: 0 .55em; background: var(--bg); white-space: nowrap; }
.pill-pending { border-color: var(--accent); }
.pill-pending::before { content: "● "; color: var(--accent); }
.pill-accepted { border-color: #2e7d32; }
.pill-accepted::before { content: "✓ "; }
.pill-rejected { border-color: #b3261e; }
.pill-rejected::before { content: "✕ "; }
.sslot { font-size: .88rem; color: var(--muted); }
.sslot strong { color: var(--text); }
.sevid { font-size: .84rem; color: var(--muted); font-style: italic; overflow-wrap: anywhere; }
.schoices { display: flex; gap: .4rem; align-items: center; margin-top: .25rem; flex-wrap: wrap; }
.pill-edited { border-color: var(--accent); }
.edit-box { display: contents; }
.edit-btn {
  display: inline-block; background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; padding: .25em .65em; font-size: .88rem; cursor: pointer; list-style: none;
}
.edit-btn::-webkit-details-marker { display: none; }
.edit-form {
  flex: 1 1 100%; display: flex; flex-direction: column; gap: .5rem;
  margin-top: .15rem; padding: .65rem .75rem; border: 1px solid var(--border);
  border-radius: 8px; background: var(--bg);
}
.edit-actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.edit-form [hidden] { display: none !important; }
.schoices:has(.edit-box[open]),
.choices-row:has(.edit-box[open]) { flex-wrap: wrap; }
.tone-edited .feed-chip { border-color: var(--accent); }
.etraits { margin: .15rem 0 0; font-size: .85rem; display: flex; flex-wrap: wrap; gap: .25rem; align-items: baseline; }
.etl { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; }
.trait { border: 1px solid var(--border); border-radius: 999px; padding: 0 .55em; }

.accept-all-bar { display: flex; flex-direction: column; align-items: flex-start; gap: .35rem; margin: .2rem 0 .4rem; }
.accept-all-bar .hint { margin: 0; }
.toast {
  position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%);
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; padding: .7rem 1rem; box-shadow: 0 8px 24px rgba(0,0,0,.22);
  display: flex; gap: .8rem; align-items: center; z-index: 20; max-width: min(32rem, calc(100% - 2rem));
}
.toast[hidden] { display: none !important; }
.toast-msg { margin: 0; }

/* help bubble: shown on hover, keyboard focus, or a long press */
.help-bubble {
  position: fixed;
  z-index: 40;
  max-width: min(22rem, calc(100vw - 1.5rem));
  padding: .55em .75em;
  background: var(--text);
  color: var(--bg);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
  font-size: .88rem;
  line-height: 1.4;
  pointer-events: none;
}
.help-bubble[hidden] { display: none !important; }
.help-bubble::after {
  content: "";
  position: absolute;
  left: var(--help-arrow-left, 50%);
  width: 8px; height: 8px;
  background: inherit;
  transform: translateX(-50%) rotate(45deg);
}
.help-bubble[data-place="above"]::after { bottom: -4px; }
.help-bubble[data-place="below"]::after { top: -4px; }
@media (prefers-reduced-motion: reduce) {
  .help-bubble { transition: none; }
}

/* header Help link: always visible, including on a phone */
.help-link {
  color: var(--text); text-decoration: none; font-weight: 600;
  padding: .25em .45em; white-space: nowrap; flex: none;
}
.help-link:hover, .help-link:focus-visible { text-decoration: underline; }
.share-btn {
  color: var(--text); text-decoration: none; font-weight: 600;
  border: 1px solid var(--border); border-radius: 6px; padding: .25em .7em; flex: none;
}
.share-btn:hover { border-color: var(--accent); }

/* library row actions: same-size buttons, Delete on the right in the danger color */
.story-actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .55rem; width: 100%; }
.story-actions .action-btn {
  display: inline-flex; align-items: center; justify-content: center;
  box-sizing: border-box; min-width: 6.4rem; min-height: 2.2rem;
  padding: .35em .85em; font-size: .88rem; font-weight: 600; line-height: 1.2;
  text-decoration: none; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 6px; cursor: pointer;
}
.story-actions .action-btn.danger {
  margin-left: auto; color: #fff; background: #8b1a14; border-color: #8b1a14;
}
.story-actions .action-btn.danger:hover { filter: brightness(1.08); }
.rename-box { position: relative; }
.rename-box summary.action-btn { list-style: none; }
.rename-box summary.action-btn::-webkit-details-marker { display: none; }
.rename-box .tight { margin-top: .4rem; }
.archive-toggle { margin: 1rem 0 .4rem; }
.archived-heading { margin: 1.4rem 0 .6rem; }

/* unobtrusive version + copyright, every page including login and Help */
.site-foot {
  flex: none; margin-top: auto; font-size: .75rem; color: var(--muted);
  text-align: center; padding: .35rem .8rem .55rem; letter-spacing: .01em;
}

/* Reader setting in the story header */
.reader-menu { flex: none; }
.coming-soon { font-size: .78em; font-weight: 600; color: var(--muted); margin-left: .3em; white-space: nowrap; }
.reader-menu .menu-body { min-width: 18rem; }
.switch.is-disabled { opacity: .72; cursor: default; }
.radio.is-disabled { opacity: .72; cursor: default; }
.reader-menu .radio,
.reader-menu .switch {
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  text-align: left;
  width: 100%;
}
.reader-menu .radio input,
.reader-menu .switch input[type="checkbox"] {
  margin: 0;
  flex: none;
  order: 0;
}
.reader-menu .menu-body { text-align: left; }
@media (max-width: 820px) {
  .reader-menu summary { padding: .25em .55em; font-size: .9rem; }
  .reader-menu .menu-body {
    position: absolute; left: auto; right: 0; top: calc(100% + 6px);
    width: min(18rem, calc(100vw - 1.2rem)); min-width: 0;
  }
  .site-foot { font-size: .7rem; padding: .3rem .6rem .45rem; }
}

/* share panel / dialog */
.share-dialog {
  border: 1px solid var(--border); border-radius: 12px; padding: 0;
  background: var(--surface); color: var(--text);
  width: min(32rem, calc(100% - 1.5rem)); max-height: calc(100vh - 2rem);
}
.share-dialog::backdrop { background: rgba(0, 0, 0, .4); }
.share-panel { padding: 1rem 1.2rem 1.2rem; }
.share-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: .6rem; }
.share-head h2 { margin: 0; font-size: 1.15rem; }
.share-members li { display: flex; flex-wrap: wrap; gap: .4rem .7rem; align-items: center; }
.share-add { display: flex; flex-direction: column; gap: .7rem; margin-top: .8rem; }
.role-picks { border: 0; padding: 0; margin: 0; display: flex; gap: 1rem; flex-wrap: wrap; }
.role-picks legend { font-weight: 600; margin-bottom: .2rem; padding: 0; }
.share-role-form select { padding: .2em .4em; }

/* help page */
.help-doc { max-width: 42rem; }
.help-doc h1 { margin-bottom: .4em; }
.help-toc { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: .8rem 1.2rem; margin: 0 0 1.6rem; }
.help-toc h2 { font-size: 1rem; margin: 0 0 .4rem; }
.help-toc ol { margin: 0; padding-left: 1.2rem; }
.help-toc li { margin: .25em 0; }
.help-doc h2 { margin-top: 1.6em; }
.help-doc h2:target, .help-doc h3:target { outline: 3px solid var(--accent); outline-offset: 4px; }
.help-doc ul { padding-left: 1.2rem; }
.help-doc code { font-family: ui-monospace, Consolas, monospace; font-size: .9em; }
@media (max-width: 420px) {
  .help-link { font-size: .95rem; }
}

/* consistency flags (v0.3.0) */
.editor-wrap { position: relative; flex: 1; display: flex; min-height: 50vh; }
.editor-wrap > textarea.editor { flex: 1; min-height: 0; position: relative; z-index: 1; background: transparent; overflow-y: scroll; }
.editor-mirror {
  position: absolute; inset: 0; z-index: 0; overflow-x: hidden; overflow-y: scroll; pointer-events: none; color: transparent;
  white-space: pre-wrap; overflow-wrap: break-word; word-wrap: break-word; background: var(--editor);
  border: 1px solid var(--border); border-radius: 8px; margin: 0; min-height: 0; box-sizing: border-box;
}
.editor-mirror mark { color: transparent; background: transparent; border-radius: 2px; }
.editor-mirror mark.flag-mark { text-decoration: underline wavy #b3261e; text-decoration-thickness: 2px; text-underline-offset: 5px; background: rgba(179, 38, 30, .10); }
.editor-mirror mark.flag-target { background: rgba(245, 190, 40, .55); }
.flag-strip { background: var(--surface); border: 1px solid #b3261e; border-left-width: 5px; border-radius: 8px; padding: .45rem .8rem; }
.flag-strip[hidden] { display: none; }
.flag-details > summary { cursor: pointer; font-weight: 600; }
.flag-icon { color: #b3261e; }
.cflag { padding: .55rem .2rem .55rem .7rem; border-left: 4px solid #b3261e; border-bottom: 1px dashed var(--border); margin-top: .5rem; display: flex; flex-direction: column; gap: .2rem; }
.flag-strip .cflag:last-child { border-bottom: 0; }
.cflags[hidden], .filter-empty[hidden] { display: none; }
.cflags h3 { margin: .4rem 0 .1rem; }
.cflags .hint { margin: 0 0 .3rem; }
.cflag-links { display: flex; gap: .3rem 1rem; flex-wrap: wrap; font-size: .9rem; }
.pill-conflict { border-color: #b3261e; }
.pill-conflict::before { content: "⚠ "; color: #b3261e; }
.tone-conflict { border-left-color: #b3261e; }
.tone-conflict .feed-chip { border-color: #b3261e; }
.just-in.tone-conflict { animation-name: slotin-conflict; }
@keyframes slotin-conflict {
  0% { opacity: 0; transform: translateY(10px); background: color-mix(in srgb, var(--accent) 34%, transparent); box-shadow: inset 4px 0 0 var(--accent); }
  25% { opacity: 1; transform: none; }
  100% { opacity: 1; transform: none; background: transparent; box-shadow: none; border-left-color: #b3261e; }
}
.ai-soon { display: inline-block; cursor: help; }
.ai-soon button[disabled] { pointer-events: none; opacity: .65; }
.entity-target { outline: 3px solid #f5be28; outline-offset: 2px; transition: outline-color 1s; }
@media (max-width: 760px) { .editor-wrap { min-height: 60vh; } }
.button.small { padding: .25em .65em; font-size: .88rem; }
