trix-editor {
  border: 1px solid #bbb;
  border-radius: 3px;
  margin: 0;
  padding: 0.4em 0.6em;
  min-height: 5em;
  outline: none; }

trix-toolbar * {
  box-sizing: border-box; }

trix-toolbar .trix-button-row {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  overflow-x: auto; }

trix-toolbar .trix-button-group {
  display: flex;
  margin-bottom: 10px;
  border: 1px solid #bbb;
  border-top-color: #ccc;
  border-bottom-color: #888;
  border-radius: 3px; }
  trix-toolbar .trix-button-group:not(:first-child) {
    margin-left: 1.5vw; }
    @media (max-width: 768px) {
      trix-toolbar .trix-button-group:not(:first-child) {
        margin-left: 0; } }

trix-toolbar .trix-button-group-spacer {
  flex-grow: 1; }
  @media (max-width: 768px) {
    trix-toolbar .trix-button-group-spacer {
      display: none; } }

trix-toolbar .trix-button {
  position: relative;
  float: left;
  color: rgba(0, 0, 0, 0.6);
  font-size: 0.75em;
  font-weight: 600;
  white-space: nowrap;
  padding: 0 0.5em;
  margin: 0;
  outline: none;
  border: none;
  border-bottom: 1px solid #ddd;
  border-radius: 0;
  background: transparent; }
  trix-toolbar .trix-button:not(:first-child) {
    border-left: 1px solid #ccc; }
  trix-toolbar .trix-button.trix-active {
    background: #cbeefa;
    color: black; }
  trix-toolbar .trix-button:not(:disabled) {
    cursor: pointer; }
  trix-toolbar .trix-button:disabled {
    color: rgba(0, 0, 0, 0.125); }
  @media (max-width: 768px) {
    trix-toolbar .trix-button {
      letter-spacing: -0.01em;
      padding: 0 0.3em; } }

trix-toolbar .trix-button--icon {
  font-size: inherit;
  width: 2.6em;
  height: 1.6em;
  max-width: calc(0.8em + 4vw);
  text-indent: -9999px; }
  @media (max-width: 768px) {
    trix-toolbar .trix-button--icon {
      height: 2em;
      max-width: calc(0.8em + 3.5vw); } }
  trix-toolbar .trix-button--icon::before {
    display: inline-block;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    opacity: 0.6;
    content: "";
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain; }
    @media (max-width: 768px) {
      trix-toolbar .trix-button--icon::before {
        right: 6%;
        left: 6%; } }
  trix-toolbar .trix-button--icon.trix-active::before {
    opacity: 1; }
  trix-toolbar .trix-button--icon:disabled::before {
    opacity: 0.125; }

trix-toolbar .trix-button--icon-attach::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M10.5%2018V7.5c0-2.25%203-2.25%203%200V18c0%204.125-6%204.125-6%200V7.5c0-6.375%209-6.375%209%200V18%22%20stroke%3D%22%23000%22%20stroke-width%3D%222%22%20stroke-miterlimit%3D%2210%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E");
  top: 8%;
  bottom: 4%; }

trix-toolbar .trix-button--icon-bold::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M6.522%2019.242a.5.5%200%200%201-.5-.5V5.35a.5.5%200%200%201%20.5-.5h5.783c1.347%200%202.46.345%203.24.982.783.64%201.216%201.562%201.216%202.683%200%201.13-.587%202.129-1.476%202.71a.35.35%200%200%200%20.049.613c1.259.56%202.101%201.742%202.101%203.22%200%201.282-.483%202.334-1.363%203.063-.876.726-2.132%201.12-3.66%201.12h-5.89ZM9.27%207.347v3.362h1.97c.766%200%201.347-.17%201.733-.464.38-.291.587-.716.587-1.27%200-.53-.183-.928-.513-1.198-.334-.273-.838-.43-1.505-.43H9.27Zm0%205.606v3.791h2.389c.832%200%201.448-.177%201.853-.497.399-.315.614-.786.614-1.423%200-.62-.22-1.077-.63-1.385-.418-.313-1.053-.486-1.905-.486H9.27Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); }

trix-toolbar .trix-button--icon-italic::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M9%205h6.5v2h-2.23l-2.31%2010H13v2H6v-2h2.461l2.306-10H9V5Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); }

trix-toolbar .trix-button--icon-link::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M18.948%205.258a4.337%204.337%200%200%200-6.108%200L11.217%206.87a.993.993%200%200%200%200%201.41c.392.39%201.027.39%201.418%200l1.623-1.613a2.323%202.323%200%200%201%203.271%200%202.29%202.29%200%200%201%200%203.251l-2.393%202.38a3.021%203.021%200%200%201-4.255%200l-.05-.049a1.007%201.007%200%200%200-1.418%200%20.993.993%200%200%200%200%201.41l.05.049a5.036%205.036%200%200%200%207.091%200l2.394-2.38a4.275%204.275%200%200%200%200-6.072Zm-13.683%2013.6a4.337%204.337%200%200%200%206.108%200l1.262-1.255a.993.993%200%200%200%200-1.41%201.007%201.007%200%200%200-1.418%200L9.954%2017.45a2.323%202.323%200%200%201-3.27%200%202.29%202.29%200%200%201%200-3.251l2.344-2.331a2.579%202.579%200%200%201%203.631%200c.392.39%201.027.39%201.419%200a.993.993%200%200%200%200-1.41%204.593%204.593%200%200%200-6.468%200l-2.345%202.33a4.275%204.275%200%200%200%200%206.072Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); }

trix-toolbar .trix-button--icon-strike::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M6%2014.986c.088%202.647%202.246%204.258%205.635%204.258%203.496%200%205.713-1.728%205.713-4.463%200-.275-.02-.536-.062-.781h-3.461c.398.293.573.654.573%201.123%200%201.035-1.074%201.787-2.646%201.787-1.563%200-2.773-.762-2.91-1.924H6ZM6.432%2010h3.763c-.632-.314-.914-.715-.914-1.273%200-1.045.977-1.739%202.432-1.739%201.475%200%202.52.723%202.617%201.914h2.764c-.05-2.548-2.11-4.238-5.39-4.238-3.145%200-5.392%201.719-5.392%204.316%200%20.363.04.703.12%201.02ZM4%2011a1%201%200%201%200%200%202h15a1%201%200%201%200%200-2H4Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); }

trix-toolbar .trix-button--icon-quote::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M4.581%208.471c.44-.5%201.056-.834%201.758-.995C8.074%207.17%209.201%207.822%2010%208.752c1.354%201.578%201.33%203.555.394%205.277-.941%201.731-2.788%203.163-4.988%203.56a.622.622%200%200%201-.653-.317c-.113-.205-.121-.49.16-.764.294-.286.567-.566.791-.835.222-.266.413-.54.524-.815.113-.28.156-.597.026-.908-.128-.303-.39-.524-.72-.69a3.02%203.02%200%200%201-1.674-2.7c0-.905.283-1.59.72-2.088Zm9.419%200c.44-.5%201.055-.834%201.758-.995%201.734-.306%202.862.346%203.66%201.276%201.355%201.578%201.33%203.555.395%205.277-.941%201.731-2.789%203.163-4.988%203.56a.622.622%200%200%201-.653-.317c-.113-.205-.122-.49.16-.764.294-.286.567-.566.791-.835.222-.266.412-.54.523-.815.114-.28.157-.597.026-.908-.127-.303-.39-.524-.72-.69a3.02%203.02%200%200%201-1.672-2.701c0-.905.283-1.59.72-2.088Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); }

trix-toolbar .trix-button--icon-heading-1::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M21.5%207.5v-3h-12v3H14v13h3v-13h4.5ZM9%2013.5h3.5v-3h-10v3H6v7h3v-7Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); }

trix-toolbar .trix-button--icon-code::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M3.293%2011.293a1%201%200%200%200%200%201.414l4%204a1%201%200%201%200%201.414-1.414L5.414%2012l3.293-3.293a1%201%200%200%200-1.414-1.414l-4%204Zm13.414%205.414%204-4a1%201%200%200%200%200-1.414l-4-4a1%201%200%201%200-1.414%201.414L18.586%2012l-3.293%203.293a1%201%200%200%200%201.414%201.414Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); }

trix-toolbar .trix-button--icon-bullet-list::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M5%207.5a1.5%201.5%200%201%200%200-3%201.5%201.5%200%200%200%200%203ZM8%206a1%201%200%200%201%201-1h11a1%201%200%201%201%200%202H9a1%201%200%200%201-1-1Zm1%205a1%201%200%201%200%200%202h11a1%201%200%201%200%200-2H9Zm0%206a1%201%200%201%200%200%202h11a1%201%200%201%200%200-2H9Zm-2.5-5a1.5%201.5%200%201%201-3%200%201.5%201.5%200%200%201%203%200ZM5%2019.5a1.5%201.5%200%201%200%200-3%201.5%201.5%200%200%200%200%203Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); }

trix-toolbar .trix-button--icon-number-list::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M3%204h2v4H4V5H3V4Zm5%202a1%201%200%200%201%201-1h11a1%201%200%201%201%200%202H9a1%201%200%200%201-1-1Zm1%205a1%201%200%201%200%200%202h11a1%201%200%201%200%200-2H9Zm0%206a1%201%200%201%200%200%202h11a1%201%200%201%200%200-2H9Zm-3.5-7H6v1l-1.5%202H6v1H3v-1l1.667-2H3v-1h2.5ZM3%2017v-1h3v4H3v-1h2v-.5H4v-1h1V17H3Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); }

trix-toolbar .trix-button--icon-undo::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M3%2014a1%201%200%200%200%201%201h6a1%201%200%201%200%200-2H6.257c2.247-2.764%205.151-3.668%207.579-3.264%202.589.432%204.739%202.356%205.174%205.405a1%201%200%200%200%201.98-.283c-.564-3.95-3.415-6.526-6.825-7.095C11.084%207.25%207.63%208.377%205%2011.39V8a1%201%200%200%200-2%200v6Zm2-1Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); }

trix-toolbar .trix-button--icon-redo::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M21%2014a1%201%200%200%201-1%201h-6a1%201%200%201%201%200-2h3.743c-2.247-2.764-5.151-3.668-7.579-3.264-2.589.432-4.739%202.356-5.174%205.405a1%201%200%200%201-1.98-.283c.564-3.95%203.415-6.526%206.826-7.095%203.08-.513%206.534.614%209.164%203.626V8a1%201%200%201%201%202%200v6Zm-2-1Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); }

trix-toolbar .trix-button--icon-decrease-nesting-level::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M5%206a1%201%200%200%201%201-1h12a1%201%200%201%201%200%202H6a1%201%200%200%201-1-1Zm4%205a1%201%200%201%200%200%202h9a1%201%200%201%200%200-2H9Zm-3%206a1%201%200%201%200%200%202h12a1%201%200%201%200%200-2H6Zm-3.707-5.707a1%201%200%200%200%200%201.414l2%202a1%201%200%201%200%201.414-1.414L4.414%2012l1.293-1.293a1%201%200%200%200-1.414-1.414l-2%202Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); }

trix-toolbar .trix-button--icon-increase-nesting-level::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M5%206a1%201%200%200%201%201-1h12a1%201%200%201%201%200%202H6a1%201%200%200%201-1-1Zm4%205a1%201%200%201%200%200%202h9a1%201%200%201%200%200-2H9Zm-3%206a1%201%200%201%200%200%202h12a1%201%200%201%200%200-2H6Zm-2.293-2.293%202-2a1%201%200%200%200%200-1.414l-2-2a1%201%200%201%200-1.414%201.414L3.586%2012l-1.293%201.293a1%201%200%201%200%201.414%201.414Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); }

trix-toolbar .trix-dialogs {
  position: relative; }

trix-toolbar .trix-dialog {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  font-size: 0.75em;
  padding: 15px 10px;
  background: #fff;
  box-shadow: 0 0.3em 1em #ccc;
  border-top: 2px solid #888;
  border-radius: 5px;
  z-index: 5; }

trix-toolbar .trix-input--dialog {
  font-size: inherit;
  font-weight: normal;
  padding: 0.5em 0.8em;
  margin: 0 10px 0 0;
  border-radius: 3px;
  border: 1px solid #bbb;
  background-color: #fff;
  box-shadow: none;
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none; }
  trix-toolbar .trix-input--dialog.validate:invalid {
    box-shadow: #F00 0px 0px 1.5px 1px; }

trix-toolbar .trix-button--dialog {
  font-size: inherit;
  padding: 0.5em;
  border-bottom: none; }

trix-toolbar .trix-dialog--link {
  max-width: 600px; }

trix-toolbar .trix-dialog__link-fields {
  display: flex;
  align-items: baseline; }
  trix-toolbar .trix-dialog__link-fields .trix-input {
    flex: 1; }
  trix-toolbar .trix-dialog__link-fields .trix-button-group {
    flex: 0 0 content;
    margin: 0; }

trix-editor [data-trix-mutable]:not(.attachment__caption-editor) {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none; }

trix-editor [data-trix-mutable]::-moz-selection,
trix-editor [data-trix-cursor-target]::-moz-selection, trix-editor [data-trix-mutable] ::-moz-selection {
  background: none; }

trix-editor [data-trix-mutable]::selection,
trix-editor [data-trix-cursor-target]::selection, trix-editor [data-trix-mutable] ::selection {
  background: none; }

trix-editor .attachment__caption-editor:focus[data-trix-mutable]::-moz-selection {
  background: highlight; }

trix-editor .attachment__caption-editor:focus[data-trix-mutable]::selection {
  background: highlight; }

trix-editor [data-trix-mutable].attachment.attachment--file {
  box-shadow: 0 0 0 2px highlight;
  border-color: transparent; }

trix-editor [data-trix-mutable].attachment img {
  box-shadow: 0 0 0 2px highlight; }

trix-editor .attachment {
  position: relative; }
  trix-editor .attachment:hover {
    cursor: default; }

trix-editor .attachment--preview .attachment__caption:hover {
  cursor: text; }

trix-editor .attachment__progress {
  position: absolute;
  z-index: 1;
  height: 20px;
  top: calc(50% - 10px);
  left: 5%;
  width: 90%;
  opacity: 0.9;
  transition: opacity 200ms ease-in; }
  trix-editor .attachment__progress[value="100"] {
    opacity: 0; }

trix-editor .attachment__caption-editor {
  display: inline-block;
  width: 100%;
  margin: 0;
  padding: 0;
  font-size: inherit;
  font-family: inherit;
  line-height: inherit;
  color: inherit;
  text-align: center;
  vertical-align: top;
  border: none;
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none; }

trix-editor .attachment__toolbar {
  position: absolute;
  z-index: 1;
  top: -0.9em;
  left: 0;
  width: 100%;
  text-align: center; }

trix-editor .trix-button-group {
  display: inline-flex; }

trix-editor .trix-button {
  position: relative;
  float: left;
  color: #666;
  white-space: nowrap;
  font-size: 80%;
  padding: 0 0.8em;
  margin: 0;
  outline: none;
  border: none;
  border-radius: 0;
  background: transparent; }
  trix-editor .trix-button:not(:first-child) {
    border-left: 1px solid #ccc; }
  trix-editor .trix-button.trix-active {
    background: #cbeefa; }
  trix-editor .trix-button:not(:disabled) {
    cursor: pointer; }

trix-editor .trix-button--remove {
  text-indent: -9999px;
  display: inline-block;
  padding: 0;
  outline: none;
  width: 1.8em;
  height: 1.8em;
  line-height: 1.8em;
  border-radius: 50%;
  background-color: #fff;
  border: 2px solid highlight;
  box-shadow: 1px 1px 6px rgba(0, 0, 0, 0.25); }
  trix-editor .trix-button--remove::before {
    display: inline-block;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    opacity: 0.7;
    content: "";
    background-image: url("data:image/svg+xml,%3Csvg%20height%3D%2224%22%20width%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M19%206.41%2017.59%205%2012%2010.59%206.41%205%205%206.41%2010.59%2012%205%2017.59%206.41%2019%2012%2013.41%2017.59%2019%2019%2017.59%2013.41%2012z%22%2F%3E%3Cpath%20d%3D%22M0%200h24v24H0z%22%20fill%3D%22none%22%2F%3E%3C%2Fsvg%3E");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 90%; }
  trix-editor .trix-button--remove:hover {
    border-color: #333; }
    trix-editor .trix-button--remove:hover::before {
      opacity: 1; }

trix-editor .attachment__metadata-container {
  position: relative; }

trix-editor .attachment__metadata {
  position: absolute;
  left: 50%;
  top: 2em;
  transform: translate(-50%, 0);
  max-width: 90%;
  padding: 0.1em 0.6em;
  font-size: 0.8em;
  color: #fff;
  background-color: rgba(0, 0, 0, 0.7);
  border-radius: 3px; }
  trix-editor .attachment__metadata .attachment__name {
    display: inline-block;
    max-width: 100%;
    vertical-align: bottom;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap; }
  trix-editor .attachment__metadata .attachment__size {
    margin-left: 0.2em;
    white-space: nowrap; }

.trix-content {
  line-height: 1.5;
  overflow-wrap: break-word;
  word-break: break-word; }
  .trix-content * {
    box-sizing: border-box;
    margin: 0;
    padding: 0; }
  .trix-content h1 {
    font-size: 1.2em;
    line-height: 1.2; }
  .trix-content blockquote {
    border: 0 solid #ccc;
    border-left-width: 0.3em;
    margin-left: 0.3em;
    padding-left: 0.6em; }
  .trix-content [dir=rtl] blockquote,
  .trix-content blockquote[dir=rtl] {
    border-width: 0;
    border-right-width: 0.3em;
    margin-right: 0.3em;
    padding-right: 0.6em; }
  .trix-content li {
    margin-left: 1em; }
  .trix-content [dir=rtl] li {
    margin-right: 1em; }
  .trix-content pre {
    display: inline-block;
    width: 100%;
    vertical-align: top;
    font-family: monospace;
    font-size: 0.9em;
    padding: 0.5em;
    white-space: pre;
    background-color: #eee;
    overflow-x: auto; }
  .trix-content img {
    max-width: 100%;
    height: auto; }
  .trix-content .attachment {
    display: inline-block;
    position: relative;
    max-width: 100%; }
    .trix-content .attachment a {
      color: inherit;
      text-decoration: none; }
      .trix-content .attachment a:hover, .trix-content .attachment a:visited:hover {
        color: inherit; }
  .trix-content .attachment__caption {
    text-align: center; }
    .trix-content .attachment__caption .attachment__name + .attachment__size::before {
      content: ' \2022 '; }
  .trix-content .attachment--preview {
    width: 100%;
    text-align: center; }
    .trix-content .attachment--preview .attachment__caption {
      color: #666;
      font-size: 0.9em;
      line-height: 1.2; }
  .trix-content .attachment--file {
    color: #333;
    line-height: 1;
    margin: 0 2px 2px 2px;
    padding: 0.4em 1em;
    border: 1px solid #bbb;
    border-radius: 5px; }
  .trix-content .attachment-gallery {
    display: flex;
    flex-wrap: wrap;
    position: relative; }
    .trix-content .attachment-gallery .attachment {
      flex: 1 0 33%;
      padding: 0 0.5em;
      max-width: 33%; }
    .trix-content .attachment-gallery.attachment-gallery--2 .attachment, .trix-content .attachment-gallery.attachment-gallery--4 .attachment {
      flex-basis: 50%;
      max-width: 50%; }
/*
 * Provides a drop-in pointer for the default Trix stylesheet that will format the toolbar and
 * the trix-editor content (whether displayed or under editing). Feel free to incorporate this
 * inclusion directly in any other asset bundle and remove this file.
 *

*/

/* Dark theme styling for Trix editor */
trix-toolbar {
  background-color: #374151 !important; /* gray-700 */
  border: 1px solid #4B5563 !important; /* gray-600 */
  border-bottom: none !important;
  border-radius: 0.375rem 0.375rem 0 0 !important; /* rounded-t-md */
}

trix-toolbar .trix-button-group {
  background-color: transparent !important;
  border: none !important;
}

trix-toolbar .trix-button {
  background-color: transparent !important;
  color: #D1D5DB !important; /* gray-300 */
  border: none !important;
  border-radius: 0.25rem !important;
  margin: 2px !important;
}

trix-toolbar .trix-button:hover {
  background-color: #4B5563 !important; /* gray-600 */
  color: #FFFFFF !important;
}

trix-toolbar .trix-button.trix-active {
  background-color: #3B82F6 !important; /* blue-500 */
  color: #FFFFFF !important;
}

trix-toolbar .trix-button--icon {
  opacity: 0.8;
}

trix-toolbar .trix-button--icon:hover {
  opacity: 1;
}

trix-editor {
  background-color: #374151 !important; /* gray-700 */
  color: #FFFFFF !important;
  border: 1px solid #4B5563 !important; /* gray-600 */
  border-top: none !important;
  border-radius: 0 0 0.375rem 0.375rem !important; /* rounded-b-md */
  min-height: 400px !important;
  padding: 1rem !important;
}

trix-editor:focus {
  outline: 2px solid #3B82F6 !important; /* blue-500 */
  outline-offset: -2px !important;
}

/* Content styling inside editor */
.trix-content {
  color: #FFFFFF !important;
  line-height: 1.6 !important;
}

.trix-content h1 {
  color: #FFFFFF !important;
  font-size: 2rem !important;
  font-weight: bold !important;
  margin: 1rem 0 !important;
}

.trix-content h2 {
  color: #FFFFFF !important;
  font-size: 1.5rem !important;
  font-weight: bold !important;
  margin: 0.875rem 0 !important;
}

.trix-content p {
  color: #FFFFFF !important;
  margin: 0.5rem 0 !important;
}

.trix-content a {
  color: #60A5FA !important; /* blue-400 */
  text-decoration: underline !important;
}

.trix-content a:hover {
  color: #93C5FD !important; /* blue-300 */
}

.trix-content blockquote {
  border-left: 4px solid #6B7280 !important; /* gray-500 */
  padding-left: 1rem !important;
  color: #D1D5DB !important; /* gray-300 */
  font-style: italic !important;
  margin: 1rem 0 !important;
}

.trix-content ul, .trix-content ol {
  color: #FFFFFF !important;
  margin: 0.5rem 0 !important;
  padding-left: 2rem !important;
}

.trix-content li {
  color: #FFFFFF !important;
  margin: 0.25rem 0 !important;
}

/* Placeholder styling */
trix-editor:empty:not(:focus)::before {
  color: #9CA3AF !important; /* gray-400 */
}

/*
 * We need to override trix.css's image gallery styles to accommodate the
 * <action-text-attachment> element we wrap around attachments. Otherwise,
 * images in galleries will be squished by the max-width: 33%; rule.
*/
.trix-content .attachment-gallery > action-text-attachment,
.trix-content .attachment-gallery > .attachment {
  flex: 1 0 33%;
  padding: 0 0.5em;
  max-width: 33%;
}

.trix-content .attachment-gallery.attachment-gallery--2 > action-text-attachment,
.trix-content .attachment-gallery.attachment-gallery--2 > .attachment, .trix-content .attachment-gallery.attachment-gallery--4 > action-text-attachment,
.trix-content .attachment-gallery.attachment-gallery--4 > .attachment {
  flex-basis: 50%;
  max-width: 50%;
}

.trix-content action-text-attachment .attachment {
  padding: 0 !important;
  max-width: 100% !important;
}
@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  :root {
    --color-characters: var(--colour-dusk);
    --color-magic:      var(--colour-ember);
    --bg-secondary:     var(--bg-sidebar);
  }

  /* Green Light Theme - Default */
  [data-theme="light"] {
    --bg-primary: #f9f8f3;
    --bg-sidebar: #f2f1e8;
    --sidenav-icons: #e9e8db;
    --bg-card: #fffef9;
    --bg-card-stat-box: #f9f8f3;
    --border-card: rgba(110,125,105,0.24);
    --bg-dropdown-hover: rgba(31, 86, 56, 0.08);
    --bg-input: oklch(98.5% 0.006 82);
    --border-input: rgba(110,125,105,0.24);
    --text-primary: #26302a;
    --text-secondary: #676c64;
    --text-tertiary: #676c64;
    --text-muted: #676c64;
    --sidebar-accent: #e1ebe0;
    --sidebar-accent-foreground: #f0ecf9;
    --shadow-card: #eef3ed;
    --shadow-card-hover: #eef3ed;
    --accent-color: #1f5638;
    --accent-color-text: #ffffff;
    --accent-color-hover: #427358;
    --accent-color-hover-text: 	#1f5638;
    --accent-color-pill: 	#e1ebe0;
    --progress-track: #e5e0db;

    --colour-moss:         #6b7a3d;
    --colour-wine:         #8b3a3a;
    --colour-dusk:         #5a6b88;
    --colour-ember:        #e9844a;
    --colour-amber:        #b8860b;
    --colour-moss-rgb:     107 122 61;
    --colour-wine-rgb:     139 58 58;
    --colour-dusk-rgb:     90 107 136;
    --colour-ember-rgb:    233 132 74;
    --colour-amber-rgb:    184 134 11;

    --highlight-yellow:    #f7eeca;
    --highlight-green:     #dcefdc;
    --highlight-blue:      #d9e8f7;
    --highlight-pink:      #f7dde8;
    --highlight-purple:    #e9ddf7;

    --hero-highlight-from: #1f5638;
    --hero-highlight-to:   #508b6a;

    --alert-success-text: #1f5638;
    --alert-success-bg:   #e8f1ea;
    --alert-success-border: rgba(31, 86, 56, 0.25);
    --alert-error-text:   #a8341f;
    --alert-error-bg:     #f7e9e5;
    --alert-error-border: rgba(168, 52, 31, 0.25);
    --alert-warning-text: #9a6a12;
    --alert-warning-bg:   #f8efde;
    --alert-warning-border: rgba(154, 106, 18, 0.25);
    --alert-info-text:    #3a6a8a;
    --alert-info-bg:      #e7eff5;
    --alert-info-border:  rgba(58, 106, 138, 0.25);

    --mountain-sky: #c5d9c6;
    --mountain-1:   #96b89a;
    --mountain-2:   #769d7a;
    --mountain-3:   #587d5b;
    --mountain-4:   #406045;
    --mountain-5:   #2d4733;
    --mountain-sun: #d4a84a;
    --mountain-eyebrow:      rgba(45, 71, 51, 0.85);
    --mountain-eyebrow-line: rgba(45, 71, 51, 0.35);
  }

    /* Green Dark Theme - Default */
  [data-theme="dark"] {
    --bg-primary: #1a1a19;
    --bg-sidebar: #151514;
    --sidenav-icons: oklch(10.5% 0.022 56);
    --bg-card: #232322;
    --bg-card-stat-box: #1a1a19;
    --border-card: #353533;
    --bg-dropdown-hover: #2a3a2e;
    --bg-input: #262626;
    --border-input: #353533;
    --text-primary: #e3e3e0;
    --text-secondary: #999996;
    --text-tertiary: #8a8a86;
    --text-muted: #8a8a86;
    --sidebar-accent: #1f2c22;
    --sidebar-accent-foreground: #1f1f1f;
    --shadow-card: oklch(22% 0.045 66);
    --shadow-card-hover: oklch(22% 0.045 66);
    --accent-color: #5a9e6f; /* primary accent colour */
    --accent-color-text: #0d120e;
    --accent-color-hover: #71b085;
    --accent-color-hover-text: #5a9e6f;
    --accent-color-pill: 	#1d2a20;
    --progress-track: #1b140d;

    --colour-moss:         #6fb985;
    --colour-wine:         #e08a72;
    --colour-dusk:         #7fb0d4;
    --colour-ember:        #e9844a;
    --colour-amber:        #dab863;
    --colour-moss-rgb:     111 185 133;
    --colour-wine-rgb:     224 138 114;
    --colour-dusk-rgb:     127 176 212;
    --colour-ember-rgb:    233 132 74;
    --colour-amber-rgb:    218 184 99;

    --highlight-yellow:    #6b5d2a;
    --highlight-green:     #33522f;
    --highlight-blue:      #2f4a6b;
    --highlight-pink:      #6b3a4e;
    --highlight-purple:    #4a3a6b;

    --hero-highlight-from: #1f5638;
    --hero-highlight-to:   #508b6a;

    --alert-success-text: #6fb985;
    --alert-success-bg:   #1c2a20;
    --alert-success-border: rgba(111, 185, 133, 0.25);
    --alert-error-text:   #e08a72;
    --alert-error-bg:     #2c1e1a;
    --alert-error-border: rgba(224, 138, 114, 0.25);
    --alert-warning-text: #dab863;
    --alert-warning-bg:   #2a2516;
    --alert-warning-border: rgba(218, 184, 99, 0.25);
    --alert-info-text:    #7fb0d4;
    --alert-info-bg:      #1a242c;
    --alert-info-border:  rgba(127, 176, 212, 0.25);

    --mountain-sky: #2d4433;
    --mountain-1:   #3d5e40;
    --mountain-2:   #2e4d30;
    --mountain-3:   #244026;
    --mountain-4:   #1c3320;
    --mountain-5:   #152618;
    --mountain-sun: #8a7835;
    --mountain-eyebrow:      rgba(255, 255, 255, 0.65);
    --mountain-eyebrow-line: rgba(255, 255, 255, 0.35);
  }

    /* Purple Light Theme */
  [data-theme="purple light"] {
    --bg-primary: #faf9f7;
    --bg-sidebar: #f8f5f2;
    --sidenav-icons: #5d45a0;
    --bg-card: #ffffff;
    --bg-card-stat-box: #f0ebe5;
    --border-card: rgba(139,125,125,0.2);
    --bg-dropdown-hover: rgba(93, 69, 160, 0.08);
    --bg-input: oklch(98.5% 0.006 82);
    --border-input: rgba(139,125,125,0.2);
    --text-primary: #3c3632;
    --text-secondary: #8b7d7d;
    --text-tertiary: #a09490;
    --text-muted: #a09490;
    --sidebar-accent: #ede8f5;
    --sidebar-accent-foreground: #f0ecf9;
    --shadow-card: #eef3ed;
    --shadow-card-hover: #eef3ed;
    --accent-color: #5d45a0;
    --accent-color-text: #ddd5f3;
    --accent-color-hover: #8167CE;
    --accent-color-hover-text: 	#5d45a0;
    --accent-color-pill: 	#2a2533;
    --progress-track: #e5e0db;

    --colour-moss:         #6b7a3d;
    --colour-wine:         #8b3a3a;
    --colour-dusk:         #5a6b88;
    --colour-ember:        #e9844a;
    --colour-amber:        #b8860b;
    --colour-moss-rgb:     107 122 61;
    --colour-wine-rgb:     139 58 58;
    --colour-dusk-rgb:     90 107 136;
    --colour-ember-rgb:    233 132 74;
    --colour-amber-rgb:    184 134 11;

    --highlight-yellow:    #f7eeca;
    --highlight-green:     #dcefdc;
    --highlight-blue:      #d9e8f7;
    --highlight-pink:      #f7dde8;
    --highlight-purple:    #e9ddf7;

    --hero-highlight-from: #5d45a0;
    --hero-highlight-to:   #a994e2;

    --alert-success-text: #1f5638;
    --alert-success-bg:   #e8f1ea;
    --alert-success-border: rgba(31, 86, 56, 0.25);
    --alert-error-text:   #a8341f;
    --alert-error-bg:     #f7e9e5;
    --alert-error-border: rgba(168, 52, 31, 0.25);
    --alert-warning-text: #9a6a12;
    --alert-warning-bg:   #f8efde;
    --alert-warning-border: rgba(154, 106, 18, 0.25);
    --alert-info-text:    #3a6a8a;
    --alert-info-bg:      #e7eff5;
    --alert-info-border:  rgba(58, 106, 138, 0.25);

    --mountain-sky: #ccc4e8;
    --mountain-1:   #a89dd4;
    --mountain-2:   #8c80bc;
    --mountain-3:   #7062a8;
    --mountain-4:   #564b8a;
    --mountain-5:   #3f3570;
    --mountain-sun: #d4a84a;
    --mountain-eyebrow:      rgba(56, 38, 110, 0.85);
    --mountain-eyebrow-line: rgba(56, 38, 110, 0.35);
  }

    /* Purple Dark Theme */
  [data-theme="purple dark"] {
    --bg-primary: #1a1a1a;
    --bg-sidebar: #141414;
    --sidenav-icons: oklch(10.5% 0.022 56);
    --bg-card: #262626;
    --bg-card-stat-box: #1f1f1f;
    --border-card: #404040;
    --bg-dropdown-hover: #302a42;
    --bg-input: #262626;
    --border-input: #404040;
    --text-primary: #e5e5e5;
    --text-secondary: #a3a3a3;
    --text-tertiary: #737373;
    --text-muted: #737373;
    --sidebar-accent: #282330;
    --sidebar-accent-foreground: #1f1f1f;
    --shadow-card: oklch(22% 0.045 66);
    --shadow-card-hover: oklch(22% 0.045 66);
    --accent-color: #7256c6; /* primary accent colour */
    --accent-color-text: #ddd5f3;
    --accent-color-hover: #8167CE;
    --accent-color-hover-text: #5d45a0;
    --accent-color-pill: 	#2a2533;
    --progress-track: #1b140d;

    --colour-moss:         #6b7a3d;
    --colour-wine:         #8b3a3a;
    --colour-dusk:         #5a6b88;
    --colour-ember:        #e9844a;
    --colour-amber:        #b8860b;
    --colour-moss-rgb:     107 122 61;
    --colour-wine-rgb:     139 58 58;
    --colour-dusk-rgb:     90 107 136;
    --colour-ember-rgb:    233 132 74;
    --colour-amber-rgb:    184 134 11;

    --highlight-yellow:    #6b5d2a;
    --highlight-green:     #33522f;
    --highlight-blue:      #2f4a6b;
    --highlight-pink:      #6b3a4e;
    --highlight-purple:    #4a3a6b;

    --hero-highlight-from: #7c5fc9;
    --hero-highlight-to:   #af9ae9;

    --alert-success-text: #6fb985;
    --alert-success-bg:   #1c2a20;
    --alert-success-border: rgba(111, 185, 133, 0.25);
    --alert-error-text:   #e08a72;
    --alert-error-bg:     #2c1e1a;
    --alert-error-border: rgba(224, 138, 114, 0.25);
    --alert-warning-text: #dab863;
    --alert-warning-bg:   #2a2516;
    --alert-warning-border: rgba(218, 184, 99, 0.25);
    --alert-info-text:    #7fb0d4;
    --alert-info-bg:      #1a242c;
    --alert-info-border:  rgba(127, 176, 212, 0.25);

    --mountain-sky: #1c1828;
    --mountain-1:   #28223c;
    --mountain-2:   #1e1930;
    --mountain-3:   #161224;
    --mountain-4:   #0f0d1c;
    --mountain-5:   #090714;
    --mountain-sun: #7256c6;
    --mountain-eyebrow:      rgba(255, 255, 255, 0.65);
    --mountain-eyebrow-line: rgba(255, 255, 255, 0.35);
  }

  /* Amber Light Theme */
  [data-theme="amber-light"] {
    --bg-primary: oklch(96% 0.016 78); 
    --bg-sidebar: oklch(92.5% 0.024 74);
    --sidenav-icons: oklch(90% 0.028 72);
    --bg-card: oklch(98.5% 0.006 82);
    --bg-card-stat-box: oklch(96% 0.016 78);
    --border-card: oklch(83% 0.028 72);
    --bg-dropdown-hover: oklch(93% 0.025 74);
    --bg-input: oklch(98.5% 0.006 82);
    --border-input: oklch(83% 0.028 72);
    --text-primary: oklch(22% 0.022 60);
    --text-secondary: oklch(47% 0.018 62);
    --text-tertiary: oklch(62% 0.015 64);
    --text-muted: oklch(62% 0.015 64);
    --sidebar-accent: oklch(91% 0.042 74);
    --sidebar-accent-foreground: #3c3632;
    --shadow-card: oklch(91% 0.042 74);
    --shadow-card-hover: oklch(91% 0.042 74);
    --accent-color: oklch(54% 0.175 64);
    --accent-color-text: oklch(91% 0.042 74);
    --accent-color-hover: oklch(91% 0.042 74);
    --accent-color-hover-text: oklch(54% 0.175 64);
    --accent-color-pill: 	oklch(91% 0.042 74);
    --progress-track: #e5e0db;

    --colour-moss:         #6b7a3d;
    --colour-wine:         #8b3a3a;
    --colour-dusk:         #5a6b88;
    --colour-ember:        #e9844a;
    --colour-amber:        #b8860b;
    --colour-moss-rgb:     107 122 61;
    --colour-wine-rgb:     139 58 58;
    --colour-dusk-rgb:     90 107 136;
    --colour-ember-rgb:    233 132 74;
    --colour-amber-rgb:    184 134 11;

    --highlight-yellow:    #f7eeca;
    --highlight-green:     #dcefdc;
    --highlight-blue:      #d9e8f7;
    --highlight-pink:      #f7dde8;
    --highlight-purple:    #e9ddf7;

    --hero-highlight-from: #5d45a0;
    --hero-highlight-to:   #8a70d2;

    --alert-success-text: #1f5638;
    --alert-success-bg:   #e8f1ea;
    --alert-success-border: rgba(31, 86, 56, 0.25);
    --alert-error-text:   #a8341f;
    --alert-error-bg:     #f7e9e5;
    --alert-error-border: rgba(168, 52, 31, 0.25);
    --alert-warning-text: #9a6a12;
    --alert-warning-bg:   #f8efde;
    --alert-warning-border: rgba(154, 106, 18, 0.25);
    --alert-info-text:    #3a6a8a;
    --alert-info-bg:      #e7eff5;
    --alert-info-border:  rgba(58, 106, 138, 0.25);

    --mountain-sky: #d9c9a0;
    --mountain-1:   #c0a870;
    --mountain-2:   #a88a50;
    --mountain-3:   #8a6e38;
    --mountain-4:   #6e5428;
    --mountain-5:   #543c14;
    --mountain-sun: #e05c10;
    --mountain-eyebrow:      rgba(84, 60, 20, 0.85);
    --mountain-eyebrow-line: rgba(84, 60, 20, 0.35);
  }

  /* Dark Theme */
  [data-theme="amber-dark"] {
    --bg-primary: #1b140d;
    --bg-sidebar: #14100a;
    --sidenav-icons: oklch(10.5% 0.022 56);
    --bg-card: #241a10;
    --bg-card-stat-box: #2b2014;
    --border-card: rgba(242,224,192,0.10);
    --bg-dropdown-hover: #302418;
    --bg-input: oklch(18.5% 0.026 58);
    --border-input: rgba(242,224,192,0.22);
    --text-primary: #f2e0c0;
    --text-secondary: #d9c49d;
    --text-tertiary: #a28c6b;
    --text-muted: #a28c6b;
    --sidebar-accent: oklch(22% 0.045 66);
    --sidebar-accent-foreground: #e8ddd4;
    --shadow-card: oklch(22% 0.045 66);
    --shadow-card-hover: oklch(22% 0.045 66);
    --accent-color: #e9844a; /* primary accent colour */
    --accent-color-text: rgba(233,132,74,0.22);
    --accent-color-hover: rgba(233,132,74,0.22);
    --accent-color-hover-text: #e9844a;
    --accent-color-pill: 	rgba(233,132,74,0.22);
    --progress-track: #1b140d;

    --colour-moss:         #6b7a3d;
    --colour-wine:         #8b3a3a;
    --colour-dusk:         #5a6b88;
    --colour-ember:        #e9844a;
    --colour-amber:        #b8860b;
    --colour-moss-rgb:     107 122 61;
    --colour-wine-rgb:     139 58 58;
    --colour-dusk-rgb:     90 107 136;
    --colour-ember-rgb:    233 132 74;
    --colour-amber-rgb:    184 134 11;

    --highlight-yellow:    #6b5d2a;
    --highlight-green:     #33522f;
    --highlight-blue:      #2f4a6b;
    --highlight-pink:      #6b3a4e;
    --highlight-purple:    #4a3a6b;

    --hero-highlight-from: #7c5fc9;
    --hero-highlight-to:   #af9ae9;

    --alert-success-text: #6fb985;
    --alert-success-bg:   #1c2a20;
    --alert-success-border: rgba(111, 185, 133, 0.25);
    --alert-error-text:   #e08a72;
    --alert-error-bg:     #2c1e1a;
    --alert-error-border: rgba(224, 138, 114, 0.25);
    --alert-warning-text: #dab863;
    --alert-warning-bg:   #2a2516;
    --alert-warning-border: rgba(218, 184, 99, 0.25);
    --alert-info-text:    #7fb0d4;
    --alert-info-bg:      #1a242c;
    --alert-info-border:  rgba(127, 176, 212, 0.25);

    --mountain-sky: #2d1e08;
    --mountain-1:   #3e2c12;
    --mountain-2:   #2e2008;
    --mountain-3:   #231705;
    --mountain-4:   #1a1003;
    --mountain-5:   #120b01;
    --mountain-sun: #e9844a;
    --mountain-eyebrow:      rgba(255, 255, 255, 0.65);
    --mountain-eyebrow-line: rgba(255, 255, 255, 0.35);
  }
}

@layer utilities {
  .scrollbar-none {
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .scrollbar-none::-webkit-scrollbar {
    display: none;
  }
}

@layer components {
  /* Hero highlight gradient text */
  .text-hero-highlight {
    background: linear-gradient(to right, var(--hero-highlight-from), var(--hero-highlight-to), var(--hero-highlight-from));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: gradient 4s ease-in-out infinite;
  }

  /* Alert / Flash Components */
  .alert-success, .alert-error, .alert-warning, .alert-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    border-width: 1px;
    border-style: solid;
    font-size: 0.875rem;
    font-weight: 500;
  }

  .alert-success {
    color: var(--alert-success-text);
    background-color: var(--alert-success-bg);
    border-color: var(--alert-success-border);
  }

  .alert-error {
    color: var(--alert-error-text);
    background-color: var(--alert-error-bg);
    border-color: var(--alert-error-border);
  }

  .alert-warning {
    color: var(--alert-warning-text);
    background-color: var(--alert-warning-bg);
    border-color: var(--alert-warning-border);
  }

  .alert-info {
    color: var(--alert-info-text);
    background-color: var(--alert-info-bg);
    border-color: var(--alert-info-border);
  }

  /* Button Components */
  .btn-primary {
    background-color: var(--accent-color);
    color: var(--accent-color-text);
    @apply inline-flex items-center px-6 py-3 font-semibold rounded-xl transition-all duration-200 hover:shadow-lg hover:cursor-pointer;
  }

  .btn-primary:hover {
    background-color: var(--accent-color-hover);
  }

  .btn-actions {
    color: var(--accent-color);
    border-color: var(--accent-color);
    @apply hover:text-white font-semibold py-2 px-4 border rounded-lg transition-all duration-200 flex items-center;
  }

  .btn-actions:hover {
    background-color: var(--accent-color);
  }

  /* Actions button with custom color */
  .btn-actions-custom {
    @apply font-semibold py-2 px-4 border rounded-lg transition-all duration-200 flex items-center;
  }

  .btn-warning {
    @apply bg-orange-500/20 hover:bg-orange-500 text-orange-500 hover:text-themed-primary font-semibold py-2 px-4 border border-orange-500 rounded-lg transition-all duration-200;
  }

  .btn-warning-sm {
    @apply bg-orange-500/20 hover:bg-orange-500 text-orange-500 hover:text-themed-primary font-medium py-1.5 px-3 border border-orange-500 rounded-lg transition-all duration-200 flex items-center text-sm;
  }

  .btn-secondary {
    background-color: transparent;
    border-color: var(--accent-color);
    color: var(--accent-color);
    @apply hover:text-white font-semibold py-2 px-4 border rounded-lg transition-all duration-200;
  }

  .btn-secondary:hover {
    background-color: var(--accent-color);
  }

  .btn-secondary-sm {
    background-color: transparent;
    border-color: var(--accent-color);
    color: var(--accent-color);
    @apply hover:text-white font-medium py-1.5 px-3 border rounded-lg transition-all duration-200 flex items-center text-sm;
  }

  .btn-secondary-sm:hover {
    background-color: var(--accent-color);
  }

  /* Form Input Styles */
  .form-input {
    border-color: var(--border-input);
    outline: none;
    @apply block w-full bg-themed-primary border rounded-xl px-4 py-3 text-themed-primary transition-all;
  }

  .form-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-color);
  }

  .form-input::placeholder {
    color: var(--text-muted);
  }

  .form-input:-webkit-autofill,
  .form-input:-webkit-autofill:hover,
  .form-input:-webkit-autofill:focus,
  .form-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--bg-primary) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    caret-color: var(--text-primary) !important;
  }

  .form-textarea {
    border-color: var(--border-input);
    outline: none;
    @apply block w-full bg-themed-primary border rounded-xl px-4 py-3 text-themed-primary transition-all resize-none;
  }

  .form-textarea:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-color);
  }

  .form-checkbox {
    -webkit-appearance: none;
    appearance: none;
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-input) !important;
    @apply h-5 w-5 rounded cursor-pointer transition-all;
  }

  .form-checkbox:focus {
    --tw-ring-color: var(--accent-color);
    @apply ring-2 ring-opacity-50 outline-none;
  }

  .form-checkbox:checked {
    background-color: var(--accent-color) !important;
    border-color: var(--accent-color) !important;
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
  }

  .form-textarea::placeholder {
    color: var(--text-muted);
  }

  /* Form Actions */
  .form-actions-divider {
    border-top: 1px solid var(--border-input);
    @apply flex flex-col sm:flex-row justify-between gap-4 pt-6;
  }

  .btn-cancel {
    color: var(--text-primary);
    border-color: var(--border-input);
    @apply inline-flex items-center justify-center px-6 py-3 border rounded-xl transition-all duration-200;
  }

  /* Pill/Tag Classes */
  .pill {
    background-color: var(--accent-color-pill);
    border-color: var(--accent-color);
    color: var(--accent-color-hover-text);
    @apply inline-flex items-center px-3 py-1 rounded-full text-xs border;
  }

  .pill-moss {
    @apply inline-flex items-center px-3 py-1 rounded-full text-xs border bg-moss/20 border-moss/40 text-moss;
  }

  .pill-wine {
    @apply inline-flex items-center px-3 py-1 rounded-full text-xs border bg-wine/10 border-wine/30 text-wine;
  }

  .pill-dusk {
    @apply inline-flex items-center px-3 py-1 rounded-full text-xs border bg-dusk/10 border-dusk/30 text-dusk;
  }

  .pill-ember {
    @apply inline-flex items-center px-3 py-1 rounded-full text-xs border bg-ember/10 border-ember/30 text-ember;
  }

  .pill-amber {
    @apply inline-flex items-center px-3 py-1 rounded-full text-xs border bg-amber/10 border-amber/30 text-amber;
  }

  .pill-gray {
    @apply inline-flex items-center px-3 py-1 rounded-full text-xs bg-gray-500/20 text-themed-secondary border border-gray-500/30;
  }

  .pill-outline {
    border-color: var(--border-input);
    color: var(--text-secondary);
    @apply inline-flex items-center px-3 py-1 rounded-full text-xs border transition-colors;
  }

  .pill-outline:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
  }

  /* Dropdown Components */
  .dropdown-menu {
    @apply absolute right-0 mt-2 w-48 sm:w-56 rounded-xl shadow-xl py-2 z-50;
    background-color: var(--bg-card);
    border: 1px solid var(--border-card);
  }

  .dropdown-item {
    @apply flex items-center px-4 py-3 text-sm transition-colors;
  }

  .dropdown-item-edit {
    @apply dropdown-item;
    color: var(--accent-color);
  }

  .dropdown-item-edit:hover {
    background-color: var(--bg-dropdown-hover);
  }

  .dropdown-item-create {
    @apply dropdown-item;
    color: var(--accent-color);
  }

  .dropdown-item-create:hover {
    background-color: var(--bg-dropdown-hover);
  }

  .dropdown-item-manage {
    @apply dropdown-item;
    color: var(--accent-color);
  }

  .dropdown-item-manage:hover {
    background-color: var(--bg-dropdown-hover);
  }

  .dropdown-item-link {
    @apply dropdown-item;
    color: var(--accent-color);
  }

  .dropdown-item-link:hover {
    background-color: var(--bg-dropdown-hover);
  }

  .dropdown-item-delete {
    @apply dropdown-item text-wine;
  }

  .dropdown-item-delete:hover {
    @apply bg-wine/10 text-wine;
  }

  .dropdown-item-danger {
    @apply dropdown-item text-wine hover:bg-wine/10;
  }

  .dropdown-icon {
    @apply w-4 h-4 mr-3;
  }

  /* Card Theme System */
  .card {
    @apply bg-gray-800/50 backdrop-blur-sm border border-gray-700/50 rounded-xl p-6 transition-all duration-200;
  }

  .card-interactive {
    @apply card hover:bg-gray-800/60 hover:shadow-xl cursor-pointer;
  }

  .card-nested {
    @apply bg-gray-800/30 backdrop-blur-sm border border-gray-700/50 rounded-xl p-4 transition-all duration-200 hover:bg-gray-800/40;
  }

  /* Semantic theme modifiers for cards */
  .card-plotpoints {
    @apply hover:border-blue-500/50 hover:scale-[1.02] transform;
  }

  .card-characters {
    @apply hover:border-moss/50 hover:scale-[1.02] transform;
  }

  .card-magic {
    @apply hover:border-purple-500/50 hover:scale-[1.02] transform;
  }

  .card-locations {
    @apply hover:border-emerald-500/50 hover:scale-[1.02] transform;
  }

  .card-politics {
    @apply hover:border-indigo-500/50 hover:scale-[1.02] transform;
  }

  .card-history {
    @apply hover:border-amber-500/50 hover:scale-[1.02] transform;
  }

  .card-notes {
    @apply hover:border-yellow-500/50 hover:scale-[1.02] transform;
  }

  .card-books {
    @apply hover:border-purple-500/50 hover:scale-[1.02] transform;
  }

  .card-readbook {
    @apply hover:border-moss/50 hover:scale-[1.02] transform;
  }

  .card-plotstructures {
    @apply hover:border-purple-500/50 hover:scale-[1.02] transform;
  }

  .card-chapters {
    @apply hover:border-purple-500/50 hover:scale-[1.02] transform;
  }

  .card-drafts {
    @apply hover:border-moss/50 hover:scale-[1.02] transform;
  }

  .card-plan {
    @apply hover:border-amber-500/50 hover:scale-[1.02] transform;
  }

  .card-settings {
    @apply hover:border-emerald-500/50 hover:scale-[1.02] transform;
  }

  .card-goals {
    @apply hover:border-rose-500/50 hover:scale-[1.02] transform;
  }

  .card-genres {
    @apply hover:border-indigo-500/50 hover:scale-[1.02] transform;
  }

  .card-progress {
    @apply hover:border-moss/50 hover:scale-[1.02] transform;
  }

  .card-streak {
    @apply hover:border-amber-500/50 hover:scale-[1.02] transform;
  }

  .card-total {
    @apply hover:border-blue-500/50 hover:scale-[1.02] transform;
  }

  .card-stats {
    @apply hover:border-moss/50 hover:scale-[1.01] transform;
  }

  /* Nested card themes (more subtle effects) */
  .card-nested-plotpoints {
    @apply hover:border-blue-500/50 hover:scale-[1.01] transform;
  }

  .card-nested-chapters {
    @apply hover:border-green-500/50 hover:scale-[1.01] transform;
  }

  .card-nested-magic {
    @apply hover:border-purple-500/50 hover:scale-[1.01] transform;
  }

  /* Metadata count styles */
  .metadata-plot-points {
    @apply text-purple-400;
  }

  .metadata-chapter-notes {
    @apply text-yellow-400;
  }

  /* Card Stats */
  .card-stat-number {
    color: var(--accent-color);
    font-weight: 600;
  }

  /* Card Icon */
  .card-icon {
    color: var(--accent-color);
  }

  /* Card Stat Dot */
  .card-stat-dot {
    background-color: var(--accent-color);
  }

  /* Horizontal Divider */
  .horizontal-divider {
    border-top: 1px solid var(--border-input);
  }

  /* View Link Button */
  .btn-view-link {
    color: var(--accent-color);
    @apply text-sm font-medium transition-colors;
  }

  /* Text Link Button - accent colored text link */
  .btn-text-link {
    color: var(--accent-color);
    @apply text-sm hover:underline flex items-center;
  }

  /* Accent Link - for links throughout the site */
  .link-accent {
    color: var(--accent-color);
    @apply transition-colors;
  }

  .link-accent:hover {
    color: var(--accent-color-hover);
  }

  /* Accent Icon - for icons throughout the site */
  .icon-accent {
    color: var(--accent-color);
  }

  /* Themed Card Base Styles */
  .card-themed {
    background-color: var(--bg-card);
    border: 1px solid var(--border-card);
    @apply rounded-2xl p-6;
  }

  .card-interactive-themed {
    @apply card-themed cursor-pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
  }

  .card-interactive-themed:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
  }

  /* Stat Box - for nested stats within cards */
  .stat-box {
    background-color: var(--bg-card-stat-box) !important;
    box-shadow: none !important;
    @apply rounded-xl p-4;
  }

  /* Inner Card - border only, no background */
  .inner-card {
    background-color: transparent;
    border: 1px solid var(--border-card);
    @apply rounded-xl p-6;
  }

  /* Card highlight animation for newly created/updated items */
  .card-highlight {
    animation: card-glow 2s ease-out;
  }

  @keyframes card-glow {
    0% {
      box-shadow: 0 0 15px var(--accent-color), 0 0 30px rgba(114, 86, 198, 0.4);
      border-color: var(--accent-color);
    }
    100% {
      box-shadow: none;
      border-color: var(--border-card);
    }
  }

  /* Themed Text Styles */
  .text-themed-primary {
    color: var(--text-primary);
  }

  .text-themed-secondary {
    color: var(--text-muted);
  }

  .text-themed-tertiary {
    color: var(--text-tertiary);
  }

  .text-accent {
    color: var(--accent-color);
  }

  .bg-accent {
    background-color: var(--accent-color);
  }

  /* Note content - ensure text color is inherited for all elements */
  .note-content,
  .note-content * {
    color: inherit !important;
  }

  /* TipTap Editor Toolbar Styles */
  .tiptap-toolbar {
    background-color: var(--bg-card);
    border: 1px solid var(--border-card);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    @apply rounded-xl p-2 flex gap-1;
  }

  .tiptap-toolbar-btn {
    color: var(--text-secondary);
    @apply w-8 h-8 border-none bg-transparent rounded-lg cursor-pointer flex items-center justify-center font-bold text-sm transition-all duration-150;
  }

  .tiptap-toolbar-btn:hover {
    background-color: var(--accent-color);
    color: white;
  }

  .tiptap-toolbar-btn.active {
    background-color: var(--accent-color);
    color: white;
  }

  .tiptap-toolbar-separator {
    background-color: var(--border-card);
    @apply w-px h-5 mx-1 self-center;
  }

  .tiptap-dropdown {
    background-color: var(--bg-card);
    border: 1px solid var(--border-card);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    @apply rounded-xl p-2 flex gap-1;
  }

  .tiptap-color-btn {
    border: 2px solid var(--border-card);
    @apply w-6 h-6 rounded cursor-pointer transition-transform duration-150;
  }

  .tiptap-color-btn:hover {
    @apply scale-110;
    border-color: var(--text-primary);
  }

  .tiptap-remove-btn {
    border: 1px solid #ef4444;
    color: #ef4444;
    @apply w-full h-7 rounded bg-transparent cursor-pointer text-xs mb-1 transition-colors duration-150;
  }

  .tiptap-remove-btn:hover {
    background-color: #ef4444;
    color: white;
  }

  /* Trix editor wrapper for forms */
  .form-trix-wrapper {
    border: 1px solid var(--border-input);
    border-radius: 0.75rem;
    background-color: var(--bg-input);
    overflow: hidden;
    transition: box-shadow 0.15s ease;
  }

  .form-trix-wrapper:focus-within {
    box-shadow: 0 0 0 2px var(--accent-color);
  }

  .form-trix-wrapper trix-toolbar {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-input);
  }

  .form-trix-wrapper trix-toolbar .trix-button {
    color: var(--text-secondary);
    border-color: var(--border-input);
  }

  .form-trix-wrapper trix-toolbar .trix-button:hover {
    color: var(--text-primary);
    background-color: var(--bg-dropdown-hover);
  }

  .form-trix-wrapper trix-toolbar .trix-button.trix-active {
    color: var(--accent-color);
    background-color: var(--bg-dropdown-hover);
  }

  .form-trix-wrapper trix-editor {
    background-color: var(--bg-input);
    color: var(--text-primary);
    min-height: 18rem;
    padding: 1rem;
    border: none;
    outline: none;
  }

  /* Manuscript scene text — ActionText wraps body in .trix-content; override to themed color */
  .trix-content,
  .trix-content p,
  .trix-content li,
  .trix-content h1,
  .trix-content h2,
  .trix-content h3,
  .trix-content h4,
  .trix-content blockquote,
  .trix-content strong,
  .trix-content em {
    color: var(--text-primary);
  }

  /* TipTap editor text color */
  .tiptap-editor {
    color: var(--text-primary);
  }

  /* Comment popover textarea */
  .comment-textarea {
    display: block;
    width: 100%;
    box-sizing: border-box;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-input);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    padding: 6px 8px;
    resize: none;
    outline: none;
    font-family: inherit;
    transition: box-shadow 0.15s ease;
  }

  .comment-textarea:focus {
    box-shadow: 0 0 0 2px var(--accent-color);
  }

  .comment-textarea::placeholder {
    color: var(--text-muted);
  }

  /* TipTap inline comment marks */
  span[data-comment-id] {
    background-color: var(--highlight-yellow);
    border-bottom: 2px solid var(--colour-amber, #b8860b);
    border-radius: 2px;
    padding: 1px 0;
    cursor: pointer;
    transition: background-color 0.15s ease;
  }

  span[data-comment-id]:hover {
    background-color: rgba(184, 134, 11, 0.4);
  }

  /* TipTap Placeholder */
  .tiptap p.is-editor-empty:first-child::before {
    content: attr(data-placeholder);
    color: var(--text-muted);
    pointer-events: none;
    float: left;
    height: 0;
    font-style: italic;
  }

  /* Themed Background */
  .bg-themed-primary {
    background-color: var(--bg-primary);
  }

  /* Border colour for internal dividers within cards */
  .border-themed {
    border-color: var(--border-card);
  }

  /* Accent border */
  .border-accent {
    border-color: var(--accent-color);
  }

  /* Mountain illustration sky background */
  .bg-mountain-sky {
    background-color: var(--mountain-sky);
  }

  /* Banner eyebrow text and divider lines — dark on light skies, white on dark skies */
  .text-mountain-eyebrow {
    color: var(--mountain-eyebrow);
  }

  .bg-mountain-eyebrow {
    background-color: var(--mountain-eyebrow-line);
  }

  /* Accent-tinted badge (e.g. "Featured" label) */
  .badge-accent {
    background-color: color-mix(in srgb, var(--accent-color) 12%, transparent);
    color: var(--accent-color);
    border: 1px solid color-mix(in srgb, var(--accent-color) 25%, transparent);
  }

  /* Accent-tinted avatar circle */
  .avatar-accent {
    background-color: color-mix(in srgb, var(--accent-color) 15%, transparent);
    color: var(--accent-color);
    border: 1px solid color-mix(in srgb, var(--accent-color) 30%, transparent);
  }

  /* Sidebar active state */
  .sidebar-active {
    background-color: var(--sidebar-accent);
    color: var(--accent-color);
    border-radius: 0.5rem;
    border-left: 2px solid var(--accent-color);
  }

  .sidebar-collapse-tab {
    position: absolute;
    right: 0;
    top: 24px;
    transform: translateX(100%);
    width: 18px;
    height: 48px;
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-card);
    border-left: 1px solid var(--border-card);
    border-radius: 0 8px 8px 0;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-tertiary);
    transition: background-color 0.2s ease, color 0.2s ease;
    z-index: 10;
  }

  @media (min-width: 1024px) {
    .sidebar-collapse-tab {
      display: flex;
    }
  }

  .sidebar-collapse-tab:hover {
    background-color: var(--sidebar-accent);
    color: var(--text-secondary);
  }

  .sidebar-collapse-chevron-closed {
    display: none;
  }

  [data-controller="collapsible-sidebar"].sidebar-collapsed .sidebar-collapse-chevron-open {
    display: none;
  }

  [data-controller="collapsible-sidebar"].sidebar-collapsed .sidebar-collapse-chevron-closed {
    display: block;
  }

  /* Manuscript TOC sidebar collapse */
  .manuscript-toc-sidebar {
    width: 256px;
    transition: width 0.3s ease;
  }

  .manuscript-notes-sidebar {
    width: 288px;
    transition: width 0.3s ease;
  }

  @media (min-width: 1280px) {
    .manuscript-notes-sidebar {
      width: 360px;
    }
  }

  .manuscript-toc-sidebar.toc-collapsed,
  .manuscript-notes-sidebar.toc-collapsed {
    width: 0;
  }

  /* ── Comment Popover ─────────────────────────────────────────────────── */

  #comment-popover {
    position: fixed;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 14px;
    width: 360px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.35);
    z-index: 1002;
    max-height: 520px;
    overflow: hidden;
    display: flex !important;
    flex-direction: column !important;
    font-family: inherit;
  }

  .cp-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-card);
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px;
    flex-shrink: 0;
  }

  .cp-header-left {
    display: flex !important;
    align-items: center !important;
    gap: 8px;
  }

  .cp-header-right {
    display: flex !important;
    align-items: center !important;
    gap: 4px;
  }

  .cp-scroll-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
  }

  .cp-quote {
    border-left: 3px solid var(--accent-color);
    padding: 8px 12px;
    margin-bottom: 14px;
    background: color-mix(in srgb, var(--accent-color) 8%, transparent);
    border-radius: 0 6px 6px 0;
  }

  .cp-quote p {
    font-size: 13px;
    font-style: italic;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
  }

  .cp-thread-body {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px;
  }

  .cp-replies {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px;
    padding-left: 14px;
    border-left: 2px solid var(--border-card);
  }

  .cp-comment {
    display: flex !important;
    gap: 10px;
    align-items: flex-start !important;
  }

  .cp-avatar {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #fff !important;
  }

  .cp-comment-content { flex: 1; min-width: 0; }

  .cp-meta {
    display: flex !important;
    align-items: center !important;
    gap: 6px;
    margin-bottom: 3px;
    flex-wrap: wrap;
  }

  .cp-author { font-size: 13px; font-weight: 600; color: var(--text-primary); }

  .cp-role {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-color);
    background: color-mix(in srgb, var(--accent-color) 12%, transparent);
    padding: 1px 6px;
    border-radius: 10px;
  }

  .cp-time { font-size: 11px; color: var(--text-secondary); }

  .cp-inline-more {
    margin-left: auto;
    background: none !important;
    border: none !important;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0 2px;
    font-size: 14px;
    opacity: 0.5;
    line-height: 1;
  }
  .cp-inline-more:hover { opacity: 1; }

  .cp-body-text { font-size: 13px; color: var(--text-primary); line-height: 1.55; margin: 0; }

  .cp-body-view { display: block; }
  .cp-edit-view { display: none !important; }
  .cp-edit-view.active { display: block !important; }
  .cp-comment-content:has(.cp-edit-view.active) .cp-body-view { display: none !important; }

  .cp-edit-view textarea {
    width: 100%;
    background: var(--bg-secondary, var(--bg-primary));
    border: 1px solid var(--border-card);
    border-radius: 8px;
    padding: 8px;
    font-size: 13px;
    color: var(--text-primary);
    font-family: inherit;
    resize: none;
    outline: none;
    box-sizing: border-box;
    margin-bottom: 4px;
  }

  .cp-edit-actions {
    display: flex !important;
    gap: 6px;
    justify-content: space-between !important;
    align-items: center !important;
  }

  .cp-reply-section {
    padding: 12px 16px;
    border-top: 1px solid var(--border-card);
    display: flex !important;
    align-items: center !important;
    gap: 10px;
    flex-shrink: 0;
  }

  .cp-reply-pill {
    flex: 1;
    background: var(--bg-secondary, var(--bg-primary));
    border: 1px solid var(--border-card);
    border-radius: 20px;
    display: flex !important;
    align-items: center !important;
    padding: 0 6px 0 14px;
    gap: 6px;
  }

  .cp-reply-pill input {
    flex: 1;
    background: none !important;
    border: none !important;
    outline: none !important;
    font-size: 13px;
    color: var(--text-primary);
    padding: 8px 0;
    font-family: inherit;
  }

  .cp-send-btn {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    border-radius: 50% !important;
    background: var(--accent-color) !important;
    border: none !important;
    cursor: pointer;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .cp-icon-btn {
    background: none !important;
    border: none !important;
    cursor: pointer;
    padding: 4px;
    color: var(--text-secondary);
    display: flex !important;
    align-items: center !important;
    border-radius: 6px;
  }
  .cp-icon-btn:hover { color: var(--text-primary); background: var(--bg-secondary, rgba(255,255,255,0.05)) !important; }

  #cp-more-menu {
    position: fixed;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    z-index: 1003;
    min-width: 120px;
  }

  .cp-menu-btn {
    display: block !important;
    width: 100%;
    text-align: left;
    background: none !important;
    border: none !important;
    cursor: pointer;
    padding: 7px 12px;
    font-size: 13px;
    border-radius: 6px;
    color: var(--text-primary);
    font-family: inherit;
  }
  .cp-menu-btn:hover { background: var(--bg-secondary, rgba(255,255,255,0.05)) !important; }
  .cp-menu-btn.danger { color: var(--color-wine, #c0392b); }

  /* ── End Comment Popover ──────────────────────────────────────────────── */

  .toc-collapse-tab {
    position: absolute;
    right: 0;
    top: 24px;
    transform: translateX(100%);
    width: 18px;
    height: 48px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-card);
    border-left: none;
    border-radius: 0 8px 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-tertiary);
    transition: background-color 0.2s ease, color 0.2s ease;
    z-index: 10;
  }

  .toc-collapse-tab:hover {
    background-color: var(--bg-card-stat-box);
    color: var(--text-secondary);
  }

  .toc-collapse-chevron-closed {
    display: none;
  }

  .toc-is-collapsed .toc-collapse-chevron-open {
    display: none;
  }

  .toc-is-collapsed .toc-collapse-chevron-closed {
    display: block;
  }

  /* Notes sidebar collapse tab (left edge of right sidebar) */
  .notes-collapse-tab {
    position: absolute;
    left: 0;
    top: 24px;
    transform: translateX(-100%);
    width: 18px;
    height: 48px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-card);
    border-right: none;
    border-radius: 8px 0 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-tertiary);
    transition: background-color 0.2s ease, color 0.2s ease;
    z-index: 10;
  }

  .notes-collapse-tab:hover {
    background-color: var(--bg-card-stat-box);
    color: var(--text-secondary);
  }

  .notes-collapse-chevron-closed {
    display: none;
  }

  .toc-is-collapsed .notes-collapse-chevron-open {
    display: none;
  }

  .toc-is-collapsed .notes-collapse-chevron-closed {
    display: block;
  }

  /* Chapter panel title turns accent when expanded */
  [data-controller~="sidebar-accordion"]:has(> [data-sidebar-accordion-target="content"]:not(.hidden)) > button {
    color: var(--accent-color) !important;
  }

  [data-controller="collapsible-sidebar"] nav a:not(.sidebar-active):hover,
  [data-controller="collapsible-sidebar"] .sidebar-footer a:hover,
  [data-controller="collapsible-sidebar"] .sidebar-footer button:hover {
    background-color: var(--sidebar-accent);
    border-radius: 0.5rem;
    transition: background-color 0.2s ease;
  }

  /* Dashboard card styles */
  .card-dashboard-projects {
    @apply transition-all duration-200;
    border: 1px solid var(--border-card);
  }

  .card-dashboard-projects:hover {
    border-color: var(--caccent-color);
    background-color: var(--bg-card);
  }

  .card-dashboard-projects:hover svg:first-child {
    opacity: 1;
  }

  /* Project card theme */
  .card-themed-projects {
    @apply transition-all duration-200;
    border: 1px solid var(--border-card);
  }

  .card-themed-projects:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-color);
    background-color: var(--bg-card);
  }

  .card-dashboard-community {
    @apply transition-all duration-200;
    border: 1px solid var(--border-card);
  }

  .card-dashboard-community:hover {
    border-color: var(--accent-color);
    background-color: var(--bg-card);
  }

  .card-dashboard-community:hover svg:first-child {
    opacity: 1;
  }

  .card-dashboard-profile {
    @apply transition-all duration-200;
    border: 1px solid var(--border-card);
  }

  .card-dashboard-profile:hover {
    border-color: var(--accent-color);
    background-color: var(--bg-card);
  }

  .card-dashboard-profile:hover svg:first-child {
    opacity: 1;
  }

  /* Tab styling */
  .tab-active {
    border-bottom-color: var(--accent-color) !important;
    color: var(--accent-color) !important;
  }

  .tab-count {
    color: var(--text-secondary);
    @apply ml-1.5 text-xs;
  }

  button.tab-active .tab-count {
    color: var(--accent-color);
  }

  /* Progress Bar Components */
  .progress-bar-track {
    background-color: var(--progress-track);
    @apply w-full rounded-full h-3 mb-2;
  }

  .progress-bar-fill {
    background-color: var(--accent-color);
    @apply h-3 rounded-full transition-all duration-300;
  }

  /* Sidebar backgrounds */
  .bg-sidebar { background-color: var(--bg-sidebar); }
  .bg-sidebar-accent { background-color: var(--sidebar-accent); }

  /* Border-card colour used as a background or text colour (e.g. scene separators) */
  .bg-border-card   { background-color: var(--border-card); }
  .text-border-card { color: var(--border-card); }

  /* Slow pulse used on status indicators */
  .pulse-slow { animation-duration: 3s; }

  /* Card background without full card-themed padding/border */
  .bg-themed-card { background-color: var(--bg-card); }

  /* Input border */
  .border-input-themed { border-color: var(--border-input); }

  /* Left-only accent border — for card highlight strips */
  .border-l-accent { border-left-color: var(--accent-color); }

  /* divide-y children themed dividers */
  .divide-themed > :not([hidden]) ~ :not([hidden]) {
    border-color: var(--border-card);
  }

  /* Accent-tinted backgrounds */
  .bg-accent-light    { background-color: color-mix(in srgb, var(--accent-color) 15%, transparent); }
  .bg-accent-muted-20 { background-color: color-mix(in srgb, var(--accent-color) 20%, transparent); }
  .bg-accent-card-20  { background: color-mix(in srgb, var(--accent-color) 20%, var(--bg-card)); }
  .bg-accent-card-25  { background: color-mix(in srgb, var(--accent-color) 25%, var(--bg-card)); }

  /* Solid accent avatar */
  .avatar-accent-filled {
    background-color: var(--accent-color);
    color: var(--accent-color-text);
  }

  /* Wine-tinted avatar */
  .avatar-wine {
    background-color: color-mix(in srgb, var(--colour-wine) 15%, transparent);
    border: 1px solid color-mix(in srgb, var(--colour-wine) 30%, transparent);
  }

  /* Success-tinted avatar */
  .avatar-success {
    background-color: color-mix(in srgb, #22c55e 15%, transparent);
    border: 1px solid color-mix(in srgb, #22c55e 30%, transparent);
  }

  /* Fade gradient to transparent (right-edge overflow indicator) */
  .bg-fade-primary-right {
    background: linear-gradient(to left, var(--bg-primary), transparent);
  }

  /* Section-colour classes — resolve via --color-characters / --color-magic aliases */
  .text-color-characters    { color: var(--color-characters); }
  .bg-color-characters      { background-color: var(--color-characters); }
  .bg-color-characters-20   { background-color: color-mix(in srgb, var(--color-characters) 20%, transparent); }
  .bg-color-characters-30   { background-color: color-mix(in srgb, var(--color-characters) 30%, transparent); }
  .bg-color-characters-80   { background-color: color-mix(in srgb, var(--color-characters) 80%, transparent); }
  .bg-color-magic-20        { background-color: color-mix(in srgb, var(--color-magic) 20%, transparent); }

  /* Vertical divider line (outline board column separator) */
  .vertical-divider {
    width: 1px;
    align-self: stretch;
    background-color: var(--border-card);
  }

  /* Map / relationship canvas layout helpers */
  .map-canvas-grab {
    position: relative;
    cursor: grab;
  }

  .map-canvas-transform-layer {
    position: absolute;
    inset: 0;
    transform: translate(0, 0);
    transform-origin: 0 0;
    will-change: transform;
  }

  .map-canvas-svg-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
  }

  .map-node {
    position: absolute;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 10;
    user-select: none;
    transition: opacity 0.15s ease;
  }

  .node-avatar-default {
    background: color-mix(in srgb, var(--accent-color) 25%, var(--bg-card));
    border: 2px solid color-mix(in srgb, var(--accent-color) 60%, transparent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-color) 10%, transparent), 0 4px 12px rgba(0, 0, 0, 0.3);
    color: var(--accent-color);
  }

  /* Relationship map — active node ring */
  .node-avatar.ring-active {
    border-color: var(--accent-color) !important;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-color) 30%, transparent),
                0 0 20px color-mix(in srgb, var(--accent-color) 40%, transparent),
                0 4px 12px rgba(0, 0, 0, 0.3) !important;
  }

  /* Sortable drag states (used by beat reordering in plot structures) */
  .sortable-ghost { opacity: 0.4; }
  .sortable-drag  { transform: rotate(2deg); }

  /* Kanban drag states */
  .kanban-ghost   { opacity: 0.35; border: 2px dashed var(--accent-color) !important; background: color-mix(in srgb, var(--accent-color) 10%, transparent) !important; }
  .kanban-dragging { opacity: 0.9; transform: rotate(1deg); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }

  /* Map generator page */
  #mapGeneratorFrame { border: none; overflow: hidden; }
  .map-container     { height: calc(100vh - 3rem); }

  /* Map viewer page */
  .map-viewer-container { height: calc(100vh - 3rem); }
  .map-viewer-content   { height: 100%; }

  .map-display-area {
    flex: 1;
    min-width: 0;
    height: 100%;
  }

  #mapSvgContainer {
    position: relative;
    background: #1f2937;
    height: 100%;
    width: 100%;
  }

  #mapSvgContainer svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }

  .location-marker {
    position: absolute;
    width: 20px;
    height: 20px;
    background: #ef4444;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transform: translate(-50%, -100%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
  }

  .location-marker:hover {
    background: #dc2626;
    transform: translate(-50%, -100%) scale(1.1);
  }

  .location-marker.has-location { background: #10b981; }
  .location-marker.has-location:hover { background: #059669; }

  .location-label {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 4px;
    padding: 4px 8px;
    color: white;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
  }

  .sidebar-panel {
    width: 320px;
    flex-shrink: 0;
    background: #1f2937;
    border-left: 1px solid #374151;
    overflow-y: auto;
  }

  .modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
  }

  .modal-content {
    background: #1f2937;
    border-radius: 12px;
    border: 1px solid #374151;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
  }

  .marker-shape-option {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #4b5563;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
  }

  .marker-shape-option:hover      { border-color: #8b5cf6; }
  .marker-shape-option.selected   { border-color: #8b5cf6; background: #8b5cf620; }

  .marker-shape-preview           { width: 24px; height: 24px; }
  .marker-shape-preview.circle    { border-radius: 50%; }
  .marker-shape-preview.square    { border-radius: 4px; }
  .marker-shape-preview.diamond   { transform: rotate(45deg); }
  .marker-shape-preview.star      { clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }

  .color-option {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
  }

  .color-option:hover   { transform: scale(1.1); }
  .color-option.selected { border-color: white; box-shadow: 0 0 0 2px #8b5cf6; }

  /* ── Tension chart SVG elements ────────────────────────────────── */
  .chart-grid  { stroke: var(--border-card); stroke-width: 1; }
  .chart-tick  { stroke: var(--border-card); stroke-width: 1; }
  .chart-axis  { stroke: var(--border-card); stroke-width: 1.5; }
  .chart-label { font-size: 14px; fill: var(--text-secondary); font-family: inherit; }
  .chart-hatch-line    { stroke: var(--text-secondary); stroke-width: 1.5; stroke-opacity: 0.22; }
  .chart-unwritten-label { font-size: 14px; fill: var(--text-secondary); opacity: 0.65; font-style: italic; font-family: inherit; }
  .chart-unwritten-boundary { stroke: var(--text-secondary); stroke-width: 1.5; stroke-dasharray: 5 3; stroke-opacity: 0.35; }
  .tension-dot { transition: r 0.15s ease; }
  .tension-dot:hover { r: 9; }

  /* ── Thread badge chips on chapter cards ────────────────────────── */
  .thread-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 7px 1px 5px;
    border-radius: 9999px;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.4;
    border: 1px solid;
    white-space: nowrap;
    color: var(--tc);
    border-color: color-mix(in srgb, var(--tc) 35%, transparent);
    background: color-mix(in srgb, var(--tc) 10%, transparent);
  }
  .thread-badge-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--tc);
    flex-shrink: 0;
  }
}
@import 'actiontext.css';
.drag-over {
  background-color: rgba(147, 51, 234, 0.1) !important;
  border-color: rgba(147, 51, 234, 0.5) !important;
}

.dragging {
  opacity: 0.5 !important;
}

[data-manuscript-drag-drop-target="chapter"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.drag-placeholder {
  background: rgba(107, 114, 128, 0.2);
  border: 2px dashed rgba(107, 114, 128, 0.5);
  border-radius: 0.5rem;
  padding: 1rem;
  text-align: center;
  color: rgba(107, 114, 128, 0.8);
  font-size: 0.875rem;
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */

/* Animated gradient for premium feel */
@keyframes gradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.animate-gradient {
  animation: gradient 4s ease-in-out infinite;
}

/* Collapsible Sidebar Styles */
[data-controller="collapsible-sidebar"] {
  transition: width 0.3s ease-in-out;
}

[data-controller="collapsible-sidebar"].no-transition {
  transition: none !important;
}

[data-controller="collapsible-sidebar"].sidebar-collapsed {
  width: 80px !important;
}

/* Navigation adjustments for collapsed state */
[data-controller="collapsible-sidebar"].sidebar-collapsed nav {
  padding-left: 8px !important;
  padding-right: 8px !important;
}

[data-controller="collapsible-sidebar"].sidebar-collapsed nav a,
[data-controller="collapsible-sidebar"].sidebar-collapsed nav .group {
  justify-content: center !important;
  padding-left: 12px !important;
  padding-right: 12px !important;
}

/* Header adjustments for collapsed state */
[data-controller="collapsible-sidebar"].sidebar-collapsed .flex.items-center.justify-between {
  justify-content: center !important;
  padding-left: 16px !important;
  padding-right: 16px !important;
}

/* Footer adjustments for collapsed state */
[data-controller="collapsible-sidebar"].sidebar-collapsed .border-t.border-gray-700\/50 {
  padding-left: 16px !important;
  padding-right: 16px !important;
}

[data-controller="collapsible-sidebar"].sidebar-collapsed .sidebar-footer {
  padding-left: 8px !important;
  padding-right: 8px !important;
}

[data-controller="collapsible-sidebar"].sidebar-collapsed .sidebar-footer a,
[data-controller="collapsible-sidebar"].sidebar-collapsed .sidebar-footer button {
  justify-content: center !important;
  padding-left: 12px !important;
  padding-right: 12px !important;
}

/* Main content transitions */
#main-content {
  transition: margin-left 0.3s ease-in-out;
}

#main-content.no-transition {
  transition: none !important;
}

@media (min-width: 1024px) {
  #main-content.main-content-collapsed {
    margin-left: 80px !important;
  }
}


/* Scene reading view — trix-content wrapper must use themed color */
.trix-content,
.trix-content p,
.trix-content li,
.trix-content h1,
.trix-content h2,
.trix-content h3,
.trix-content h4,
.trix-content blockquote,
.trix-content strong,
.trix-content em {
  color: var(--text-primary) !important;
}

/* TipTap Editor Styles */
.tiptap-editor {
  outline: none !important;
  color: var(--text-primary) !important;
  min-height: 1.5em;
  padding: 16px;
  border: none !important;
  background: transparent;
  box-shadow: none !important;
}

.tiptap-editor:focus {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
  ring: none !important;
}

/* Remove focus styles from TipTap container and all children */
[data-controller*="tiptap-editor"],
[data-controller*="tiptap-editor"] *,
[data-tiptap-editor-target="editor"],
.tiptap-editor {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
  --tw-ring-shadow: none !important;
  --tw-ring-color: transparent !important;
}

[data-controller*="tiptap-editor"]:focus,
[data-controller*="tiptap-editor"] *:focus,
[data-tiptap-editor-target="editor"]:focus,
.tiptap-editor:focus {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
  --tw-ring-shadow: none !important;
  --tw-ring-color: transparent !important;
  ring: none !important;
}

.tiptap-editor p {
  margin: 1em 0;
}

.tiptap-editor h1, .tiptap-editor h2, .tiptap-editor h3 {
  color: var(--text-primary);
  font-weight: bold;
  margin: 1.5em 0 0.5em 0;
}

.tiptap-editor h1 { font-size: 2em; }
.tiptap-editor h2 { font-size: 1.5em; }
.tiptap-editor h3 { font-size: 1.25em; }

.tiptap-editor strong {
  font-weight: bold;
  color: var(--text-primary);
}

.tiptap-editor em {
  font-style: italic;
  color: var(--text-primary);
}

.tiptap-editor u {
  text-decoration: underline;
}

.tiptap-editor s {
  text-decoration: line-through;
}

.tiptap-editor a {
  color: #60a5fa;
  text-decoration: underline;
}

.tiptap-editor a:hover {
  color: #93c5fd;
}

/* TipTap Highlight Styles */
.tiptap-editor mark,
.trix-content mark {
  padding: 2px 4px;
  border-radius: 3px;
  color: inherit;
}

.tiptap-editor mark[data-color="yellow"],
.trix-content mark[data-color="yellow"] { background-color: var(--highlight-yellow) !important; }

.tiptap-editor mark[data-color="green"],
.trix-content mark[data-color="green"] { background-color: var(--highlight-green) !important; }

.tiptap-editor mark[data-color="blue"],
.trix-content mark[data-color="blue"] { background-color: var(--highlight-blue) !important; }

.tiptap-editor mark[data-color="pink"],
.trix-content mark[data-color="pink"] { background-color: var(--highlight-pink) !important; }

.tiptap-editor mark[data-color="purple"],
.trix-content mark[data-color="purple"] { background-color: var(--highlight-purple) !important; }



/* TipTap Floating Toolbar */
.tiptap-floating-toolbar {
  background: var(--bg-primary) !important;
  border: 1px solid var(--border-card) !important;
  border-radius: 8px !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3) !important;
  z-index: 10000 !important;
}

.tiptap-toolbar-btn:hover {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
}

.tiptap-toolbar-btn:active {
  background: var(--bg-card) !important;
}

/* Editable area — text cursor across the full container, not just over characters */
[data-inline-edit-target="content"],
[data-inline-edit-target="content"] *:not(a):not(button) {
  cursor: text !important;
}

[data-act-inline-editor-target="nameDisplay"],
[data-act-inline-editor-target="descriptionDisplay"] {
  cursor: text !important;
}

/* Chapter Navigation Underline */
.chapter-active-underline {
  border-bottom: 2px solid #3b82f6;
}
