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.
 *

*/

/*
 * 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;
}
.attachment--image {
  margin-bottom: 0.5rem !important;
}

.trix-content .attachment--image.expandable-image {
  cursor: pointer;
}

.trix-content .file-details {
  box-sizing: border-box;
  margin: 0;
  margin-left: .5rem !important;
  padding: 0;
  padding-right: .5rem !important;
}

.trix-content .link-preview-image {
  height: 100% !important;
}

.trix-content .link-preview-description {
  margin-left: 0.5rem !important;
}

.trix-content .other-attachments {
  border-top-width: 1px;
  margin-top: .5rem;
  padding-top: .5rem;
}

/* Composer: show image attachments as compact chips (icon area + filename), not large previews */
trix-editor figure.attachment--preview {
  display: inline-flex !important;
  align-items: center;
  max-width: 16rem;
  margin: 0.25rem 0 !important;
  padding: 0.5rem 0.75rem !important;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  background: #f9fafb;
  cursor: default;
}

trix-editor figure.attachment--preview img {
  display: none !important;
}

trix-editor figure.attachment--preview .attachment__caption {
  margin: 0 !important;
  padding: 0 !important;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: #374151;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

trix-editor figure.attachment--preview .attachment__caption::before {
  content: "\f03e";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  margin-right: 0.5rem;
  color: #6b7280;
}

trix-editor figure.attachment--preview .attachment__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  top: auto;
  width: 100%;
  height: 3px;
  border-radius: 0 0 0.75rem 0.75rem;
  opacity: 1;
  appearance: none;
  border: none;
  background: #e5e7eb;
}

trix-editor figure.attachment--preview .attachment__progress::-webkit-progress-bar {
  background: #e5e7eb;
  border-radius: 0 0 0.75rem 0.75rem;
}

trix-editor figure.attachment--preview .attachment__progress::-webkit-progress-value {
  background: #3b82f6;
  border-radius: 0 0 0 0.75rem;
  transition: width 100ms ease;
}

trix-editor figure.attachment--preview .attachment__progress::-moz-progress-bar {
  background: #3b82f6;
  border-radius: 0 0 0 0.75rem;
}

trix-editor img:not(figure.attachment--preview img) {
  max-height: 40vh !important;
  width: auto !important;
}

trix-editor a {
  text-align: center;
  color: #1D4ED8;
  cursor: pointer;
}

.trix-content a {
  text-align: center;
  color: #1D4ED8;
  cursor: pointer;
}

.trix-content ul {
  margin-top: 0.25rem !important;
  max-width: 28rem !important;
  list-style-type: disc !important;
  list-style-position: inside !important;
}

.trix-content ol {
  padding-left: 0;
  margin-top: 0.5rem !important;
  margin-top: 0.25rem !important;
  list-style-type: decimal !important;
  list-style-position: inside !important;
}

trix-editor ol {
  all: revert;
  padding-left: 0;
  margin-top: 0.5rem !important;
  margin-top: 0.25rem !important;
  list-style-type: decimal !important;
  list-style-position: inside !important;
}

trix-editor li {
  all: revert;
  padding-left: 1rem;
}

trix-editor ul {
  all: revert;
  padding-left: 0;
  margin-top: 0.25rem !important;
  max-width: 28rem !important;
  list-style-type: disc !important;
  list-style-position: inside !important;
}

trix-editor 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-editor h1 {
  font-size: 1.2em;
  line-height: 1.2;
}

/*
 * Bounded editor (modals / narrow columns): keep Trix from growing past the viewport
 * and overlapping fields below. Use wrapper_html: { class: "rich-text-area--bounded" } on the input.
 */
.rich-text-area--bounded {
  min-width: 0;
  max-width: 100%;
}

.rich-text-area--bounded trix-editor {
  min-height: 8rem;
  max-height: min(40vh, 22rem);
  overflow-y: auto;
  overflow-x: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
}

trix-editor {
  min-height: 8rem;
  max-height: min(40vh, 22rem);
  overflow-y: auto;
}

/* Notes: roomier editor so long notes can be pasted and reviewed in the Add/Edit Note modal (TECHSUPP-2498).
 * Comes after the bounded rule above so it wins at equal specificity. height: auto undoes the h-10 that
 * .input-input puts on trix-editor, so the editor grows with its content up to max-height instead of
 * staying at min-height; resize lets users drag it taller. */
.notes-body-editor trix-editor {
  height: auto;
  min-height: min(18rem, 40vh);
  max-height: min(65vh, 40rem);
  resize: vertical;
}

/* Notes: minimal Trix toolbar – only Bold, Bullets, Numbers, Attachment, Undo, Redo */
.notes-trix-toolbar--minimal trix-toolbar .trix-button--icon-italic,
.notes-trix-toolbar--minimal trix-toolbar .trix-button--icon-strike,
.notes-trix-toolbar--minimal trix-toolbar .trix-button--icon-link,
.notes-trix-toolbar--minimal trix-toolbar .trix-button--icon-quote,
.notes-trix-toolbar--minimal trix-toolbar .trix-button--icon-code,
.notes-trix-toolbar--minimal trix-toolbar .trix-button--icon-heading-1,
.notes-trix-toolbar--minimal trix-toolbar .trix-button--icon-decrease-nesting-level,
.notes-trix-toolbar--minimal trix-toolbar .trix-button--icon-increase-nesting-level {
  display: none;
}

/* Read view: contained thumbnails; ignore stored Trix width/height metadata */
.trix-content .expandable-image {
  display: inline-block;
  max-width: 100%;
}

.trix-content .expandable-image img,
.trix-content .attachment--image img {
  display: block;
  width: auto !important;
  height: auto !important;
  max-height: 12rem;
  max-width: 100%;
  object-fit: contain;
  border-radius: 0.375rem;
  border: 1px solid #e5e7eb;
}

/* Chat: compact Slack-style thumbnails */
.msg-bubble .trix-content {
  margin: 0 !important;
  padding: 0 !important;
  max-width: 100%;
  line-height: 1.5;
}

.msg-bubble:has(.attachment--image) .trix-content {
  width: fit-content;
}

.msg-bubble action-text-attachment {
  display: block;
  width: fit-content !important;
  max-width: 10rem !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  box-sizing: border-box;
}

.msg-bubble .attachment--image,
.msg-bubble .trix-content .attachment--image {
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 10rem;
  max-height: 7.5rem;
  margin: 0 !important;
  padding: 0 !important;
  cursor: pointer;
  overflow: hidden;
  box-sizing: border-box;
}

.msg-bubble .attachment--image img,
.msg-bubble .trix-content .expandable-image img,
.msg-bubble .trix-content .attachment--image img {
  display: block;
  max-width: 100%;
  max-height: 7.5rem;
  width: auto !important;
  height: auto !important;
  margin: 0 auto;
  border: 0 !important;
  border-radius: 0.375rem;
  object-fit: contain;
}
/* AI Assistant Floating Button */
.ai-fab-button {
  animation: ai-fab-pulse 2s ease-in-out infinite;
}

@keyframes ai-fab-pulse {
  0%, 100% {
    box-shadow: 0 4px 15px rgba(109, 40, 217, 0.4);
  }
  50% {
    box-shadow: 0 4px 25px rgba(109, 40, 217, 0.6);
  }
}

/* AI Assistant Modal */
#ai-assistant-modal[data-ai-assistant-modal-target="modal"]:not(.hidden) {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Message animations */
.ai-message-enter {
  animation: ai-message-slide-in 0.3s ease-out forwards;
}

@keyframes ai-message-slide-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Typing indicator animation */
.ai-typing-dot {
  animation: ai-typing-bounce 1.4s ease-in-out infinite both;
}

.ai-typing-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.ai-typing-dot:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes ai-typing-bounce {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

/* Tool call styling */
.ai-tool-call {
  position: relative;
  overflow: hidden;
}

.ai-tool-call::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: ai-tool-shimmer 1.5s infinite;
}

@keyframes ai-tool-shimmer {
  100% {
    left: 100%;
  }
}

/* Prose styling for AI responses */
.prose-ai p {
  margin-bottom: 0.5rem;
}

.prose-ai p:last-child {
  margin-bottom: 0;
}

.prose-ai code {
  background-color: #f3f4f6;
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
}

.prose-ai pre {
  background-color: #1f2937;
  color: #4ade80;
  padding: 0.75rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  font-size: 0.75rem;
  margin: 0.5rem 0;
}

/* Scrollbar styling for messages container */
[data-ai-assistant-modal-target="messagesContainer"]::-webkit-scrollbar {
  width: 6px;
}

[data-ai-assistant-modal-target="messagesContainer"]::-webkit-scrollbar-track {
  background: transparent;
}

[data-ai-assistant-modal-target="messagesContainer"]::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

[data-ai-assistant-modal-target="messagesContainer"]::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 0, 0, 0.3);
}
@keyframes cpFadeUp    { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
@keyframes cpTickPulse { 0%,100% { opacity:1; } 50% { opacity:.38; } }

.fade-up { animation: cpFadeUp .45s ease-out .05s both; }
@layer rfb;

@import './sidebar.tailwind.css';
@import './preview.tailwind.css';
@import './components.tailwind.css';
@import "./charts.tailwind.css";
@import "./pagination.tailwind.css";
@import "./toast.tailwind.css";
@import "./select2.tailwind.css";
@import "./file_picker.tailwind.css";
@import "./scroll.tailwind.css";
@import "./date_range.tailwind.css";
@import "./breadcrumbs.tailwind.css";
@import "./form_builder.tailwind.css";
@import "./form_builder_toolbar.tailwind.css";
@import "./tabs.tailwind.css";
@import "./calendar.tailwind.css";
@import "./mobile.tailwind.css";
@import "./ai_assistant.tailwind.css";
@import "./template.tailwind.css";
@import "./conversation.tailwind.css";
@import "./buttons.tailwind.css";
@import "./icons.tailwind.css";
@import "./mobile_template.tailwind.css";
@import "./page_light_layer.tailwind.css";
@import "./client_portal_home.tailwind.css";

@import "./layout/auth.tailwind.css";
@import "./layout/mobile.tailwind.css";

@import "./animations.tailwind.css";

@tailwind base;
@tailwind components;
@tailwind utilities;
@import 'actiontext.css';

.bg-background {
  @apply bg-sand-100
}

/*
 * TECHSUPP-3267: printing (and "Save as PDF") from the browser prints only the page's main content.
 * Layout::ViewWithSidebarLayout puts the page in .layout-main > #content. Nothing else in the document
 * prints: not the sidebar, the nav bar with its breadcrumbs, toasts, modals or popups. Inside the content,
 * navigation (tabs, pagination) and actions are hidden too; mark any other control with .print-hidden.
 */
@media print {
  body:has(> .layout-main) > :not(.layout-main),
  .layout-main > :not(#content),
  .print-hidden,
  .pagy-nav,
  .sidebar,
  .sidebar-container,
  .mobile-bottom-navigation,
  [data-controller="mobile-home"],
  [data-controller="modal-frame"],
  [data-controller="print"],
  .nav-bar,
  .header-actions,
  [data-testid="breadcrumbs"],
  .icon-base {
    display: none !important;
  }
  /* An open modal (e.g. the note pop-up on a client's Notes tab) prints instead of the page behind it.
     [class~="hidden"], not .hidden: Tailwind copies any rule naming .hidden into every `@apply hidden`
     site with .hidden swapped out, and those copies hid the page on every print (TECHSUPP-3631). */
  body:has(> .modal-frame-container:not([class~="hidden"])) > .layout-main,
  .modal-frame-container .header-actions,
  .modal-frame-actions-container {
    display: none !important;
  }
  body:has(> .modal-frame-container:not([class~="hidden"])) > .modal-frame-container:not([class~="hidden"]) {
    display: block !important;
    position: static !important;
    height: auto !important;
    background: white !important;
    backdrop-filter: none !important;
  }
  .modal-frame-container .modal-frame-content,
  .modal-frame-container .modal-frame-body-container {
    min-width: 0 !important;
    max-width: none !important;
    max-height: none !important;
    overflow: visible !important;
    box-shadow: none !important;
    background: white !important;
  }
  /* The layout scrolls inside fixed-height panes; let them grow so every page of the content prints. */
  html,
  body,
  .layout-main,
  #content,
  #content .h-full,
  #content .h-screen,
  #content .min-h-0,
  #content .overflow-y-auto {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
  }
  html,
  body,
  .layout-main,
  #content,
  #content .overflow-y-auto {
    overflow: visible !important;
  }
  .layout-main,
  #content > * {
    border: 0 !important;
    padding-left: 0 !important;
  }
  body,
  .layout-main {
    background: white !important;
  }
  table {
    width: 100% !important;
    table-layout: auto !important;
  }
  .overflow-hidden,
  .overflow-x-auto {
    overflow: visible !important;
  }
  td, th {
    white-space: normal !important;
    overflow-wrap: break-word !important;
  }
  .pl-16 {
    padding-left: 0 !important;
  }
  /* Print the finished page: a print fired on arrival (Print Notes) caught the cards' fade-in at opacity 0. */
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  /* Paper is narrower than md (768px), which put one field per row, and Chrome won't split a grid row across
     pages, which pushed a long note whole onto the next page and left a blank one. So attribute cards print
     their fields as inline blocks in the md column count (a page break never cuts through one), and a
     full-width field (a note's text) as a plain block that runs onto the next page. */
  .attributes > [class*="md:grid-cols-"] {
    display: block !important;
  }
  .attributes > [class*="md:grid-cols-"] > .attribute-item {
    display: inline-block;
    vertical-align: top;
    padding: 0 24px 24px 0;
  }
  .attributes > [class~="md:grid-cols-2"] > .attribute-item { width: 50%; }
  .attributes > [class~="md:grid-cols-3"] > .attribute-item { width: 33.333%; }
  .attributes > [class~="md:grid-cols-4"] > .attribute-item { width: 25%; }
  .attributes > [class~="md:grid-cols-5"] > .attribute-item { width: 20%; }
  .attributes > [class~="md:grid-cols-6"] > .attribute-item { width: 16.666%; }
  .attributes > [class*="md:grid-cols-"] > .attribute-item.col-span-full {
    display: block;
    width: auto;
    padding: 0;
  }
  /* Keep a full-width field's label with its first lines instead of alone at the bottom of a page. */
  .attribute-item.col-span-full > .field-label {
    display: block;
    break-after: avoid;
  }
  /* Shadows print as broken boxes and backgrounds are off by default, so outline cards and badges instead. */
  .card-glow {
    box-shadow: none !important;
  }
  .attributes.card-glow,
  .badge {
    border: 1px solid theme('colors.sand.300') !important;
  }
  /* A badge's icon (BadgeComponent's .mr-2 slot) prints as a blank gap before the label; drop it. */
  .badge > .mr-2 {
    display: none !important;
  }
}

/*
 * TECHSUPP-3694: compact print of a form submission (browser print and the "Download PDF" render, which
 * prints the same view). On screen every answer is a label above a boxed value; on paper that put one
 * short answer per row and turned a 6-page OS1 application into 22 pages. Print keeps one column but
 * shows "Label  answer" on one line, and drops OS1-migrated LineBreak dividers (headers already
 * separate the sections).
 */
@media print {
  .answered-questions {
    font-size: 10.5px;
    line-height: 1.35;
  }
  .answered-questions .text-sm,
  .answered-questions .text-xs {
    font-size: inherit !important;
    line-height: inherit !important;
  }
  .answered-item--linebreak {
    display: none !important;
  }
  .answered-item {
    display: block;
    margin: 0 0 3px;
    break-inside: avoid;
  }
  .answered-item .mb-4,
  .answered-item .mb-2 {
    margin-bottom: 0 !important;
  }
  /* A field's label runs into its answer on the same line. */
  .answered-item label.block,
  .answered-item b.block {
    display: inline !important;
    margin: 0 6px 0 0 !important;
    font-weight: 400 !important;
    color: theme('colors.sand.600') !important;
  }
  .answered-item p.border {
    display: inline !important;
    border: 0 !important;
    padding: 0 !important;
    background: none !important;
    min-height: 0 !important;
    font-family: inherit !important;
    color: theme('colors.sand.900');
    font-weight: 600;
  }
  /* A long answer (text area) starts on its own line under the label and may run onto the next page. */
  .answered-item--textarea > div {
    break-inside: auto !important;
  }
  .answered-item--textarea p.border {
    display: block !important;
    padding-left: 10px !important;
  }
  /* Selected options print as one comma-separated line, not a bulleted list. */
  .answered-item ul {
    display: inline !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
  }
  .answered-item ul > li {
    display: inline !important;
    margin: 0 !important;
  }
  .answered-item ul > li + li::before {
    content: ", ";
  }
  .answered-item--header h1 {
    margin: 10px 0 4px !important;
    padding-bottom: 2px;
    font-size: 13px !important;
    border-bottom: 1px solid theme('colors.sand.300');
    break-after: avoid;
  }
  .answered-item--paragraph > div,
  .answered-item--label > div {
    margin: 4px 0 !important;
  }
  /* A signature's label sits above it, not beside its bottom edge, and the two never split across pages. */
  .answered-item--signature b.block {
    display: block !important;
    margin-bottom: 2px !important;
  }
  .answered-item--signature img {
    max-height: 90px !important;
  }
  /* An unsigned signature prints as one line of text, not a large empty box. */
  .answered-item--signature .p-8 {
    padding: 0 !important;
    border: 0 !important;
    background: none !important;
    text-align: left !important;
  }
  .answered-item--signature .fa-signature {
    display: none !important;
  }
}
@layer breadcrumbs {
    .mobile-sidebar-button {
        @apply hidden;
    }

    @media (max-width: 1000px) {
        .mobile-sidebar-button {
            @apply block;
        }
    }
}
.btn-base {
  @apply active:scale-[0.97] rounded-[10px] font-medium cursor-pointer transition-all duration-150;
}

/* Busy / disabled state. Driven by form_busy_controller (and Turbo's own submitter
   disabling) so every modal inherits it without per-screen work. */
.btn-base:disabled,
.btn-base[aria-disabled="true"] {
  @apply opacity-50 cursor-not-allowed active:scale-100;
}

.btn-base .btn-spinner {
  @apply hidden shrink-0 h-3.5 w-3.5 rounded-full border-2 border-current border-t-transparent;
}

.btn-base[aria-busy="true"] .btn-spinner {
  @apply inline-block animate-spin;
}

.btn-sand {
  @apply bg-sand-900 text-sand-50 hover:bg-sand-800;
}

.btn-danger {
  @apply text-status-danger border border-status-danger/30 hover:bg-status-danger-bg font-medium cursor-pointer transition-all;
}

.btn-accent-green {
  @apply bg-accent-green text-white hover:brightness-90;
}

.btn-accent-blue {
  @apply bg-accent-blue text-white hover:brightness-90;
}

.btn-accent-amber {
  @apply bg-accent-amber text-white hover:brightness-90;
}

.btn-accent-orange {
  @apply bg-accent-orange text-white hover:brightness-90;
}

.btn-accent-lime {
  @apply bg-accent-lime text-white hover:brightness-90;
}

.btn-accent-pink {
  @apply bg-accent-pink text-white hover:brightness-90;
}

.btn-accent-red {
  @apply bg-accent-red text-white hover:brightness-90;
}

.btn-accent-purple {
  @apply bg-accent-purple text-white hover:brightness-90;
}

.btn-accent-indigo {
  @apply bg-accent-indigo text-white hover:brightness-90;
}
@tailwind base;
@tailwind components;
@tailwind utilities;

/* ═══ FullCalendar Theme Override ═══ */

.fc {
  --fc-border-color: #E0DDD8;
  --fc-today-bg-color: #FFFCF0;
  --fc-neutral-bg-color: #FAFAF8;
  --fc-page-bg-color: #ffffff;
  --fc-button-bg-color: transparent;
  --fc-button-border-color: #E0DDD8;
  --fc-button-text-color: #555250;
  --fc-button-hover-bg-color: #F5F4F0;
  --fc-button-hover-border-color: #C4C0B8;
  --fc-button-active-bg-color: #1A1918;
  --fc-button-active-border-color: #1A1918;
  --fc-button-active-text-color: #FAFAF8;
  --fc-event-border-color: transparent;
  font-family: 'Inter var', sans-serif;
}

.fc-day-today {
  @apply !bg-sand-50;
}

.fc .fc-toolbar-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: #1A1918;
}

.fc .fc-button {
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  box-shadow: none !important;
  transition: all 0.15s;
}
.fc .fc-button:focus { box-shadow: none !important; }
.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
  background: #1A1918;
  border-color: #1A1918;
  color: #FAFAF8;
}

.fc .fc-prev-button,
.fc .fc-next-button {
  padding: 6px 10px;
}

.fc .fc-col-header-cell {
  padding: 10px 0;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #A09C94;
  background: #FAFAF8;
  border-bottom: 1px solid #EEECE8;
}

.fc-timeGridDay-view .fc-col-header {
  display: none;
}
.fc .fc-col-header-cell.fc-day-today {
  color: theme('colors.menu.sky-blue'); /* TECHSUPP-1264: agenda module colour */
}

.fc .fc-timegrid-slot-label {
  font-size: 11px;
  color: #555250;
  font-weight: 500;
  vertical-align: top;
  padding-top: 2px;
}

.fc .fc-timegrid-axis-cushion {
  font-size: 11px;
  padding: 4px 6px;
}

.fc .fc-timegrid-slot {
  height: 28px;
}

.fc .fc-scrollgrid {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #EEECE8;
}

.fc-timeGridDay-view .fc-scrollgrid {
  border-radius: 0;
  border: none;
}

.fc .fc-scrollgrid td,
.fc .fc-scrollgrid th {
  border-color: #E0DDD8;
}

/* custom event content */
.fc-timegrid-event .fc-event-main {
  height: 100%;
  overflow: hidden;
}

.calendar-event-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  overflow: hidden;
  height: 100%;
  min-height: 0;
  width: 100%;
}

.calendar-event-title-row {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  min-width: 0;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.calendar-event-content i {
  font-size: 10px;
  flex-shrink: 0;
  opacity: 0.85;
  margin-top: 2px;
}

.event-title {
  font-size: 12px;
  font-weight: 600;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow: hidden;
  line-height: 1.3;
  flex: 1 1 auto;
  min-width: 0;
}

/* event pills */
.fc .fc-event {
  border-radius: 10px;
  border: none;
  border-left: 3px solid;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.15s;
  overflow: hidden;
}
.fc .fc-event:hover {
  transform: scale(1.005);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.fc .fc-event .fc-event-time {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.7;
  flex-shrink: 0;
  line-height: 1.2;
  width: 100%;
}

.fc .fc-event .fc-event-time--hidden {
  display: none;
}

.fc .fc-event .fc-event-time::after {
  content: none;
}

/* now indicator */
.fc .fc-timegrid-now-indicator-line {
  border-color: #E24B4A;
  border-width: 2px;
}
.fc .fc-timegrid-now-indicator-arrow {
  border-color: #E24B4A;
  border-top-color: transparent;
  border-bottom-color: transparent;
}

.fc .fc-day-today .fc-col-header-cell-cushion {
  color: theme('colors.accent.purple');
}

.fc .fc-toolbar {
  margin-bottom: 12px;
  gap: 8px;
}
.fc .fc-toolbar-chunk { display: flex; align-items: center; gap: 6px; }

.fc .fc-button-group { gap: 4px; }
.fc .fc-button-group > .fc-button { border-radius: 10px !important; }

/* ═══ Week Strip (mobile day view) ═══ */

.fc-week-strip {
  display: flex;
  justify-content: space-between;
  padding-bottom: 12px;
}

.fc-week-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  background: none;
  border: none;
  padding: 6px 4px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.12s;
}

.fc-week-day-label {
  font-size: 11px;
  font-weight: 600;
  color: theme('colors.sand.700');
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fc-week-day-num {
  font-size: 15px;
  font-weight: 700;
  color: theme('colors.sand.700');
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.fc-week-day--today .fc-week-day-label {
  color: theme('colors.accent.purple');
}

.fc-week-day--today .fc-week-day-num {
  color: theme('colors.accent.purple');
}

.fc-week-day--active .fc-week-day-num {
  background: theme('colors.accent.purple');
  color: #fff;
}

.fc-week-day--active.fc-week-day--today .fc-week-day-num {
  background: theme('colors.accent.purple');
  color: #fff;
}

/* ═══ Month view (dayGridMonth) — keep busy cells tidy ═══ */

/* Cap how tall a day cell grows; overflow collapses into "+N more". */
.fc .fc-daygrid-day-frame {
  min-height: 92px;
}

/* Compact single-line pills so many events don't blow up a cell. */
.fc-daygrid .fc-daygrid-event {
  padding: 2px 6px;
  margin-top: 1px;
  font-size: 11px;
  line-height: 1.25;
}

.fc-daygrid .fc-daygrid-event .calendar-event-content {
  display: flex;
  align-items: center;
  min-width: 0;
}

.fc-daygrid .fc-daygrid-event .calendar-event-title-row {
  min-width: 0;
}

.fc-daygrid .fc-daygrid-event .event-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* No room for a separate time row in a month cell — title carries the meaning. */
.fc-daygrid .fc-daygrid-event .fc-event-time {
  display: none;
}

/* "+N more" overflow trigger. */
.fc .fc-daygrid-more-link {
  font-size: 11px;
  font-weight: 600;
  color: theme('colors.accent.purple');
  padding: 1px 6px;
}

.fc .fc-daygrid-more-link:hover {
  text-decoration: underline;
}

/* Events inside the "+N more" popover get full titles + times. */
.fc .fc-popover .fc-daygrid-event .fc-event-time {
  display: inline;
}

.fc .fc-popover .fc-daygrid-event .event-title {
  white-space: normal;
}

/* ═══ List Day / List Week — one readable row per event (TECHSUPP-3808) ═══ */

.fc-list .fc-list-event .calendar-event-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.fc-list .fc-list-event .calendar-event-title-row {
  min-width: 0;
  flex: 1 1 auto;
}

.fc-list .fc-list-event .fc-event-time {
  display: none;
}

.fc-list .fc-list-event .event-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fc-list .fc-list-event td {
  cursor: pointer;
}
.chart-card {
  @apply bg-white rounded-2xl card-glow p-5 h-[280px] flex flex-col;
}

.chart-header {
  @apply text-left mb-1;
}

.chart-title {
  @apply text-sm font-semibold text-sand-900 mb-0.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  line-clamp: 1;
}

.chart-description {
  @apply text-xs text-sand-500;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.chart-content {
  @apply mb-2 flex-1 min-h-0 flex items-center justify-center overflow-hidden;
}

.chart-line-wrapper {
  @apply relative w-full h-full flex items-center justify-center;
}

.chart-line-canvas {
  @apply block max-w-full max-h-full;
}

.chart-pie-wrapper {
  @apply relative w-full h-full flex items-center gap-3;
}

.chart-pie-canvas-wrapper {
  @apply relative h-full flex-shrink-0 flex items-center justify-center;
  width: 45%;
}

.chart-pie-canvas {
  @apply block max-w-full max-h-full;
}

.chart-pie-legend {
  @apply flex-1 h-full min-w-0 overflow-y-auto pr-1;
}

.chart-pie-legend-item {
  @apply flex items-center gap-2 py-1 text-xs text-sand-700;
}

.chart-pie-legend-swatch {
  @apply inline-block w-2.5 h-2.5 rounded-full flex-shrink-0;
}

.chart-pie-legend-text {
  @apply truncate;
}

.chart-number-wrapper {
  @apply flex items-center justify-center h-full min-h-[150px];
}

.chart-number {
  @apply text-center;
}

.chart-number-value {
  @apply text-2xl font-semibold text-sand-900;
}

.chart-action {
  @apply flex justify-center;
}
/* ─── Client Portal Home ─────────────────────────────────────────────────── */

@keyframes cpFadeUp    { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
@keyframes cpTickPulse { 0%,100% { opacity:1; } 50% { opacity:.38; } }

.cp-a1 { animation: cpFadeUp .45s ease-out .05s both; }
.cp-a2 { animation: cpFadeUp .45s ease-out .18s both; }
.cp-a3 { animation: cpFadeUp .45s ease-out .30s both; }
.cp-tick { animation: cpTickPulse 1s ease-in-out infinite; }

/* Welcome */
.cp-welcome {
  padding: 8px 24px 20px;
}
.cp-welcome-line {
  font-size: 22px;
  font-weight: 600;
  color: #1A1918;
  letter-spacing: -.02em;
  line-height: 1.3;
}

/* Motivation + sobriety (single wave card) */
.cp-wave-card {
  margin: 0 24px 18px;
  background: white;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.04), 0 12px 36px rgba(0,0,0,.09);
}
.cp-motivation-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: #8B97A8;
  margin: 14px 18px 12px;
}
.cp-wave-img {
  height: 200px;
  margin: 0 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, #C07038 0%, #DC9260 28%, #F5BC78 62%, #E09A50 100%);
  position: relative;
  overflow: hidden;
}
.cp-wave-img > img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.cp-wave-img-bar {
  position: absolute; inset: 0;
  display: flex; align-items: flex-start; justify-content: flex-end;
  padding: 12px;
  pointer-events: none;
}
.cp-wave-img-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}
.cp-wave-add-img {
  display: flex;
  justify-content: center;
  margin: 0 14px;
  padding: 28px 12px;
  background: #F7F5F1;
  border-radius: 14px;
}

.cp-wave-img-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(90, 98, 110, .55); backdrop-filter: blur(8px);
  border: none; border-radius: 999px;
  padding: 7px 12px; font-size: 12px; font-weight: 500; color: white; cursor: pointer;
  text-decoration: none;
}
.cp-wave-img-btn--danger {
  background: rgba(239,68,68,.55);
  padding: 7px 10px;
}

/* Quote of the day */
.cp-quote {
  margin: 0 24px 18px; background: white; border-radius: 20px; padding: 18px 20px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 20px rgba(0,0,0,.04);
}
.cp-quote-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .09em; color: #8B97A8; margin-bottom: 10px;
}
.cp-quote-text {
  font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
  font-size: 18px; font-weight: 500; font-style: normal;
  color: #1A1918; line-height: 1.35;
}

/* Agenda */
.cp-agenda {
  margin: 0 24px 28px; background: white; border-radius: 20px; padding: 18px 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 20px rgba(0,0,0,.04);
}
.cp-agenda-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.cp-agenda-heading { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cp-agenda-title { font-size: 16px; font-weight: 700; color: #1A1918; letter-spacing: -.01em; }
.cp-agenda-eyeline { font-size: 13px; color: #8A8680; line-height: 1.35; }
.cp-agenda-link {
  /* TECHSUPP-1264: match the Agenda module colour (sky-blue) instead of a generic purple accent. */
  @apply bg-menu-sky-blue-bg text-menu-sky-blue;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600;
  border-radius: 8px;
  padding: 6px 12px; text-decoration: none; cursor: pointer;
  transition: opacity .15s ease;
  flex-shrink: 0;
}
.cp-agenda-link:hover { opacity: .8; }
.cp-agenda-list {
  display: flex;
  flex-direction: column;
  max-height: 22rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.cp-agenda-item {
  display: flex; align-items: center; gap: 12px; text-decoration: none;
  padding: 14px 4px; border-radius: 0; transition: background-color .15s ease;
  width: 100%; text-align: left; background: transparent; border: 0; cursor: pointer;
}
.cp-agenda-item:hover { background: rgba(160,140,120,.06); }
.cp-agenda-item + .cp-agenda-item { border-top: 1px solid #EEECE8; }
.cp-agenda-item-icon {
  width: 40px; height: 40px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
}
.cp-agenda-item-body { flex: 1; min-width: 0; overflow: hidden; }
.cp-agenda-item-type {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: #8A8680; margin-bottom: 2px;
}
.cp-agenda-item-title {
  font-size: 14px; font-weight: 700; color: #1A1918; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cp-agenda-item-time {
  font-size: 12px; color: #8A8680;
  flex: 0 1 auto; min-width: 0; max-width: 42%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-align: right;
}
.cp-agenda-item-chevron {
  flex-shrink: 0; color: #C4C0B8; display: flex; align-items: center;
}
.cp-agenda-empty { font-size: 13px; color: #8A8680; padding: 8px 4px 4px; }

.cp-wv-wave { position: relative; margin-top: -32px; z-index: 2; pointer-events: none; }

/* Tracker */
.cp-wv-body { padding: 16px 18px 16px; background: white; }
.cp-wv-eyebrow {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .09em; color: #8B97A8; margin-bottom: 10px;
}
.cp-wv-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.cp-wv-unit { text-align: center; padding: 9px 6px; }
.cp-wv-unit.br { border-right: 1px solid #EEECE8; }
.cp-wv-unit.bb { border-bottom: 1px solid #EEECE8; }
.cp-wv-num {
  font-family: 'Fraunces', serif;
  font-size: 24px; font-weight: 600; color: #1A1918;
  letter-spacing: -.03em; line-height: 1;
}
.cp-wv-lbl {
  font-size: 9px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .07em; color: #C4C0B8; margin-top: 4px;
}

/* Action cards — horizontal quick actions */
.cp-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 24px 16px; }
.cp-act-card {
  background: white; border-radius: 18px; padding: 14px 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 20px rgba(0,0,0,.04);
  cursor: pointer;
  display: flex; flex-direction: row; align-items: center; gap: 10px;
  text-decoration: none;
  border: 0; width: 100%; text-align: left;
}
.cp-act-icon {
  width: 36px; height: 36px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0; margin-bottom: 0;
}
.cp-act-icon--blue   { @apply bg-accent-blue-bg; }
.cp-act-icon--green  { @apply bg-accent-green-bg; }
.cp-act-icon--red    { @apply bg-accent-red-bg; }
.cp-act-icon--amber  { @apply bg-accent-amber-bg; }
.cp-act-icon--orange { @apply bg-accent-orange-bg; }
.cp-act-icon--lime   { @apply bg-accent-lime-bg; }
.cp-act-icon--pink   { @apply bg-accent-pink-bg; }
.cp-act-icon--purple { @apply bg-accent-purple-bg; }
.cp-act-icon--indigo { @apply bg-accent-indigo-bg; }
.cp-act-copy { flex: 1; min-width: 0; }
.cp-act-title { font-size: 14px; font-weight: 700; color: #1A1918; margin-bottom: 2px; line-height: 1.2; }
.cp-act-sub   { font-size: 11px; color: #8A8680; line-height: 1.3; }
.cp-act-arrow { margin-top: 0; align-self: center; color: #C4C0B8; flex-shrink: 0; }

/* Left column ordering: wave before quote on mobile, quote before wave on desktop */
.cp-col-left { display: flex; flex-direction: column; }
.cp-wave-card { order: 1; }
.cp-quote { order: 2; }

/* Desktop 2-column: Image | Cards */
@media (min-width: 768px) {
  .cp-welcome {
    padding: 26px 0 20px !important;
  }
  .cp-welcome-line {
    font-size: 28px;
  }

  .cp-wave-img { height: 280px; }

  .template--home {
    padding: 0 42px !important;
  }
  .cp-desktop-cols {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 42px;
    padding-bottom: 68px;
    align-items: start;
  }
  .cp-wave-card { margin: 0 !important; order: 2; }
  .cp-quote { order: 1; }

  .cp-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 0 0 16px !important;
  }
  .cp-act-card {
    padding: 16px;
  }
  .cp-act-icon {
    width: 42px; height: 42px;
  }
  .cp-wv-body {
    padding: 18px 26px 26px;
  }
  .cp-wv-num { font-size: 28px; }

  .cp-quote { margin: 0 0 24px !important; }
  .cp-agenda { margin: 0 !important; }
}

@media (min-width: 1400px) {
  .template--home {
    padding: 0 68px !important;
    max-width: 1300px;
  }
  .cp-desktop-cols { gap: 42px; }
  .cp-actions { gap: 16px; }
}
@tailwind base;
@tailwind components;
@tailwind utilities;

@layer components {
  .btn-primary {
    @apply py-2 px-4 bg-blue-700 text-white text-center decoration-transparent cursor-pointer rounded-xl inline-block
    hover:bg-blue-800 active:bg-blue-900;
  }

  .btn-secondary {
    @apply py-2 px-4 bg-black/10 text-black decoration-transparent cursor-pointer rounded-xl font-medium inline-block
    hover:bg-black/10 active:bg-black/10 text-center;
  }

  .btn-info {
    @apply py-2 px-4 bg-blue-600 text-white text-center decoration-transparent cursor-pointer rounded-xl inline-block
    hover:bg-blue-700 active:bg-blue-800;
  }

  .btn-light {
    @apply py-2 px-4 text-black decoration-transparent cursor-pointer rounded font-medium inline-block
    hover:bg-black/10 active:bg-black/10 text-center;
  }

  .btn-success {
    @apply py-2 px-4 bg-green-600 text-white text-center decoration-transparent cursor-pointer rounded-xl inline-block
    hover:bg-green-700 active:bg-green-800;
  }
  .btn-warning {
    @apply py-2 px-4 bg-yellow-600 text-white text-center decoration-transparent cursor-pointer rounded-xl inline-block
    hover:bg-yellow-700 active:bg-yellow-800;
  }

  .btn-link {
    @apply py-2 px-4 text-black decoration-transparent cursor-pointer rounded font-medium inline-block
    hover:bg-black/10 active:bg-black/10 text-center;
  }

  .btn-link-light {
    @apply py-2 px-4 text-white decoration-transparent cursor-pointer rounded font-medium inline-block
    hover:bg-black/10 active:bg-black/10 text-center;
  }

  .btn-link-danger {
    @apply py-2 px-4 text-red-600 decoration-transparent cursor-pointer rounded font-medium inline-block
    hover:bg-red-600 hover:text-white active:bg-red-600 active:text-white text-center;
  }

  .btn-outline-primary {
    @apply py-2 px-4 border-2 border-black text-black decoration-transparent cursor-pointer rounded font-medium inline-block
    hover:bg-black hover:text-white active:bg-black active:text-white text-center;
  }

  .btn-outline-secondary {
    @apply py-2 px-4 border-2 border-black/10 text-black decoration-transparent cursor-pointer rounded font-medium inline-block
    hover:bg-black/10 hover:text-black active:bg-black/10 active:text-black text-center;
  }

  .btn-outline-info {
    @apply py-2 px-4 border-2 border-blue-600 text-blue-600 decoration-transparent cursor-pointer rounded font-medium inline-block
    hover:bg-blue-600 hover:text-white active:bg-blue-600 active:text-white text-center;
  }

  .btn-outline-light {
    @apply py-2 px-4 border-2 border-black/10 text-black decoration-transparent cursor-pointer rounded font-medium inline-block
    hover:bg-black/10 hover:text-black active:bg-black/10 active:text-black text-center;
  }

  .btn-outline-success {
    @apply py-2 px-4 border-2 border-green-600 text-green-600 decoration-transparent cursor-pointer rounded font-medium inline-block
    hover:bg-green-600 hover:text-white active:bg-green-600 active:text-white text-center;
  }

  .btn-outline-danger {
    @apply py-2 px-4 border-2 border-red-600 text-red-600 decoration-transparent cursor-pointer rounded font-medium inline-block
    hover:bg-red-600 hover:text-white active:bg-red-600 active:text-white text-center;
  }

  .btn-outline-warning {
    @apply py-2 px-4 border-2 border-yellow-600 text-yellow-600 decoration-transparent cursor-pointer rounded font-medium inline-block
    hover:bg-yellow-600 hover:text-white active:bg-yellow-600 active:text-white text-center;
  }

  .badge-primary {
    @apply bg-blue-800 text-white font-medium;
  }

  .badge-secondary {
    @apply bg-gray-100 text-gray-800 font-medium;
  }

  .badge-dark {
    @apply bg-gray-100 text-gray-800 font-medium;
  }

  .badge-danger {
    @apply bg-red-100 text-red-800 font-medium;
  }

  .badge-success {
    @apply bg-green-100 text-green-800 font-medium;
  }

  .badge-warning {
    @apply bg-yellow-100 text-yellow-800 font-medium;
  }

  .input-grid {
    @apply flex flex-col gap-6 w-full
  }

  .input-label {
    @apply block text-[11px] font-semibold uppercase tracking-wider text-sand-500 mb-1.5 cursor-default leading-none;
  }
  .input-hint {
    @apply text-sm text-sand-400 mt-1;
  }
  .input-input {
    @apply w-full h-10 px-3 rounded-lg border border-sand-300 text-sm text-sand-800 bg-sand-50 focus:outline-none focus:border-brand-500 focus:ring-2 focus:ring-brand-100 transition-all block;
  }
  /* SimpleForm appends this modifier to inputs that fail validation (config/initializers/simple_form.rb).
     The compound selector outranks the base `.input-input` border so the error state always wins. */
  .input-input.input-input--with-errors {
    @apply border-red-500 focus:border-red-500 focus:ring-red-100;
  }
  select.input-input {
    padding-right: 1.75rem !important;
  }
  .input-placeholder {
    @apply text-sand-400 w-full whitespace-nowrap overflow-hidden text-ellipsis;
  }
  .input-input-prepend {
    @apply absolute top-0 left-0 h-full px-3 inline-flex items-center;
  }
  .input-input-append {
    @apply absolute top-0 right-0 h-full px-3 inline-flex items-center;
  }

  .input-input[disabled="disabled"] {
    @apply bg-sand-200 cursor-not-allowed opacity-75;
  }

  .date-range {
    @apply bg-white m-0;
  }

  .input-button {
    @apply btn-primary;
  }

  input[type="submit"] {
    @apply input-button;
  }

  input[type="checkbox"] {
    @apply rounded border-sand-300 text-brand-500 focus:ring-2 focus:ring-brand-100 cursor-pointer;
  }

  .input-checkbox {
    @apply rounded border-sand-300 text-brand-500 focus:ring-2 focus:ring-brand-100 cursor-pointer mr-2;
  }

  .input-delete {
    @apply input-button bg-red-400 hover:bg-red-500;
  }

  .input-error {
    @apply text-sm text-red-500 pt-1;
  }

  .filter-input-clear-btn {
    @apply absolute right-2 top-1/2 -translate-y-1/2 cursor-pointer text-sand-500;
  }

  .pac-container {
    @apply rounded-lg border border-sand-200 shadow-lg mt-1 bg-white text-sm;
  }
  .pac-item {
    @apply px-3 py-2 cursor-pointer border-t border-sand-100 first:border-t-0;
  }
  .pac-item:hover {
    @apply bg-sand-50;
  }
  .pac-item-query {
    @apply text-sm text-black;
  }
  .pac-icon {
    display: none;
  }

  .wizard-stepper {
    @apply sticky top-16 bg-white;
  }

  turbo-frame[data-modal-frame-target="frame"]:has(.wizard-stepper) {
    .wizard-stepper {
      @apply top-0;
    }
  }

  turbo-frame[data-modal-frame-target="frame"]:has(.sticky-modal-form-button) {
    .sticky-modal-form-button {
      @apply sticky right-0 w-full bottom-0 bg-sand-50 mt-auto z-[99];
    }
  }

  /* Public form page (empty layout): sticky header + sticky bottom buttons */
  .public-form-page {
    /* Inner wrapper must fill the scroll container so sticky has room to stick */
    > div {
      @apply min-h-full flex flex-col;
    }

    /* Background + horizontal padding so questions scrolling underneath the
       sticky header are masked, not bleeding through behind the title. */
    .header--main {
      @apply sticky top-0 z-10 bg-sand-100 py-2;
    }

    /* Form container and its children stretch to fill remaining height */
    > div > div:last-child {
      @apply flex-1 flex flex-col;
    }

    > div > div:last-child form {
      @apply flex-1 flex flex-col;
    }

    > div > div:last-child form > div {
      @apply flex-1;
    }

    .sticky-modal-form-button {
      @apply sticky right-0 w-full bottom-0 bg-sand-100 pt-3 pb-3 mt-auto z-10 border-t border-gray-200;
    }
  }

  .modal-frame-content .sticky-modal-form-button {
    @apply static right-auto bottom-auto w-full mt-auto bg-transparent z-[12];
  }

  .modal-frame-content .modal-frame-body-container .sticky-modal-form-button {
    @apply hidden;
  }

  /* Permission editor: use a tall modal so JS can fit panes to the footer. */
  .modal-frame-content:has([data-controller*="switch-group-tabs"]) {
    height: 90vh;
    max-height: 90vh;
  }

  .modal-frame-content .modal-frame-body-container:has([data-controller*="switch-group-tabs"]) {
    overflow-x: hidden;
    overflow-y: auto;
    flex: 1 1 0%;
    min-height: 0;
  }

  .modal-frame-content .modal-frame-body-container:has([data-controller*="switch-group-tabs"]) [data-switch-group-tabs-target="panel"] {
    min-height: 45vh;
  }

  .modal-frame-content .wizard-stepper-modal {
    @apply flex flex-col h-full;
  }

  /* Stepped modals (TECHSUPP-688): keep the popup a consistent size across steps (its width and
     height otherwise follow each step's content — e.g. the short Reviews step shrinks it), and pin
     the step indicator so it stays visible as the form scrolls. Mobile (<=700px) keeps its full-width
     behaviour; the fixed width is still capped by the modal's max-w-[80vw]. */
  .modal-frame-content:has(.wizard-stepper-modal) {
    min-height: 30rem;
  }

  @media (min-width: 701px) {
    .modal-frame-content:has(.wizard-stepper-modal) {
      width: 40rem;
    }
  }

  .modal-frame-content .wizard-stepper-modal .wizzard-stepper {
    @apply sticky top-0 z-10 bg-white pt-2;
  }

  /* The stepper's full-page gaps (mx-6, mx-10 from xl) overflow the 40rem popup once three steps carry their
     checkmark, which cut the last label, "Reminders" (TECHSUPP-2541). */
  .modal-frame-content .wizard-stepper-modal .wizzard-stepper li::after {
    margin-left: 0.75rem;
    margin-right: 0.75rem;
  }

  /* Mobile bottom sheet: a tall wizard step (Schedule → Custom) could not be scrolled while the sheet's
     height came only from its content (TECHSUPP-3458). A fixed height gives the form a definite box to
     scroll in; short steps keep Cancel / Next at the bottom of the sheet. */
  [data-mobile-sheet-target="panel"]:has(.wizard-stepper-modal) {
    height: 85vh;
  }

}

/* ─── New design-system components (Session 0) ─── */

@layer components {
  .card-glow { box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 8px 32px rgba(0,0,0,0.03); }

  .badge {
    @apply inline-flex items-center w-fit px-3 py-[3px] rounded-full
           text-xs font-semibold tracking-[0.02em];
  }

  .chip {
    @apply inline-flex items-center px-[10px] py-1 rounded-[6px]
           text-xs font-medium bg-sand-100 text-sand-700;
  }

  .naked-btn {
    @apply flex items-center justify-center !px-2
          text-sand-700 cursor-pointer transition-all duration-150;
  }
  .naked-btn:hover {
    @apply border-sand-400 text-sand-800 bg-sand-50;
  }

  .field-label {
    @apply text-[11px] font-semibold uppercase tracking-[0.05em] text-sand-500 mb-1;
  }
  .field-value {
    @apply text-sm font-medium text-sand-800;
  }
  .field-value img {
    @apply max-w-full max-h-[40vh] w-auto h-auto object-contain;
  }
  .field-value img.emoji {
    @apply w-[25px] h-[25px] max-w-none max-h-none object-contain;
  }

  .ch-item {
    @apply flex items-center gap-[10px] px-[14px] py-[10px] rounded-[10px] cursor-pointer transition-all duration-[120ms];
  }
  .ch-item:hover { @apply bg-sand-200; }
  .ch-item.sel { @apply bg-sand-900 text-white; }
  .ch-item.sel .ch-sub { color: rgba(255,255,255,0.5); }
  .ch-item.sel .ch-badge { @apply bg-white text-sand-900; }

  .ch-sub { @apply text-sand-500 text-[12px]; }

  .ch-badge {
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    @apply bg-[#E24B4A] text-white text-[10px] font-bold flex items-center justify-center px-[6px];
  }

  .msg-bubble {
    max-width: 75%;
    @apply px-[14px] py-[10px] rounded-2xl text-sm leading-[1.5] relative;
  }
  .msg-bubble.them {
    @apply bg-white border border-sand-200;
    border-top-left-radius: 4px;
  }
  .msg-bubble.me {
    @apply text-white;
    border-top-right-radius: 4px;
  }

  .wizard-modal { animation: wizardIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both; }

  .wiz-input { @apply transition-all duration-200; }
  .wiz-input:focus {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 141, 240, 0.08);
  }
  .wiz-input.error { border-color: #E24B4A !important; background: #FFF5F5 !important; }

  .status-opt { @apply transition-all duration-200; }
  .status-opt:hover:not(.selected) { transform: translateY(-1px); }

  .animate-in { animation: fadeUp 0.35s ease-out both; }
  .anim       { animation: fadeUp 0.3s ease-out both; }
  .shake      { animation: shake 0.4s ease; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes wizardIn {
  from { opacity: 0; transform: translate(-50%, -48%) scale(0.97); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%,60% { transform: translateX(-4px); }
  40%,80% { transform: translateX(4px); }
}

.gm-style-iw-chr {
  position: absolute;
  top: -6px;
  right: 0;
  height: 0;
}

.gm-style-iw-d {
  overflow: visible !important;
  max-width: none !important;
}

.gm-style-iw-c {
  padding-top: 12px !important;
  padding-right: 28px !important;
}

/* Wrapper for a hint that describes the control ABOVE it, rather than the one below it where
   SimpleForm puts hints by default. Without this, .input-grid's gap-6 leaves the text floating
   midway between two fields and it reads as a label for the wrong one.

   Deliberately plain CSS rather than a @layer components rule: its only consumer is a form
   builder view under application/**, and config/tailwind.config.js does not scan that tree, so
   anything layered would get purged. Same reason the menu-icon palette needs a safelist entry. */
.input-hint-attached {
  margin-top: -1.25rem; /* cancels .input-grid's 1.5rem gap down to ~0.5rem with .input-hint's mt-1 */
}

/* Square is derived from width (padding percentage), so a wider viewport that adds grid
   columns cannot squash the portrait into an oval. The avatar's fixed w-40/h-40 is overridden
   because it would otherwise keep a 160px height after the width shrinks. */
.id-badge__frame {
  width: 100%;
  max-width: 10rem;
  align-self: center;
  flex: 0 0 auto;
}

.id-badge__square {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 100%;
}

.id-badge__circle {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 9999px;
  border: 4px solid #fff;
  box-sizing: border-box;
}

.id-badge__circle :is(span, div, img) {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  min-height: 0 !important;
  flex-shrink: 1 !important;
}

.id-badge__circle img {
  object-fit: cover;
  transform: scale(1.25);
}
.conversation-template {
  @apply flex-1 flex flex-col h-full overflow-hidden bg-sand-50;
}

.conversation-template--input-container {
  @apply px-6 pb-5 pt-2 flex-shrink-0 pr-24;
}

.conversation-template--input {
  @apply bg-white rounded-2xl border border-sand-200 p-2 pl-4;
}

/* Overrides */
.conversation-template .input-input {
  @apply border-0 bg-white;
}

/* Messages */
.conversation-message {
  @apply mb-1 mt-4;
}

.conversation-message--mine {
  @apply flex flex-col items-end;
}

.conversation-message__sender-header {
  @apply flex items-center gap-2 mb-1.5;
}

.conversation-message__sender-name {
  @apply text-[12px] font-semibold text-sand-700;
}

.conversation-message__sender-time {
  @apply text-[10px] text-sand-400;
}

.conversation-message__row {
  @apply flex items-end gap-2;
}

.conversation-message__row--mine {
  @apply flex-row-reverse;
}

.conversation-message__actions {
  @apply pb-1 transition-opacity flex-shrink-0 w-10;
  @media (min-width: 768px) { opacity: 0; }
}

.conversation-message:hover .conversation-message__actions {
  @media (min-width: 768px) { opacity: 1; }
}

.conversation-message__bubble-time {
  @apply text-[10px] mt-1 opacity-60;
}

/* Image-only bubbles: shrink-wrap thumbnail with even padding */
.msg-bubble:has(.attachment--image) {
  @apply w-fit max-w-[75%] min-w-0 overflow-hidden;
  box-sizing: border-box;
}

.msg-bubble:has(.attachment--image) .conversation-message__bubble-time {
  @apply mt-1.5 leading-tight;
}
.flatpickr-calendar.custom-calendar {
  @apply shadow-lg rounded-md overflow-hidden;
}

.flatpickr-current-month {
  @apply text-base;
}

.flatpickr-day {
  @apply rounded-none;
}

.flatpickr-day.selected {
  @apply bg-blue-600 text-white border-blue-600;
}

.flatpickr-day.selected.startRange,
.flatpickr-day.selected.endRange {
  @apply bg-blue-600 text-white;
}

.flatpickr-day.inRange {
  @apply !bg-blue-100 text-gray-900 !border-transparent;
  -webkit-box-shadow: -5px 0 0 rgb(219 234 254 / var(--tw-bg-opacity, 1)),
  5px 0 0 rgb(219 234 254 / var(--tw-bg-opacity, 1)) !important;
  box-shadow: -5px 0 0 rgb(219 234 254 / var(--tw-bg-opacity, 1)),
  5px 0 0 rgb(219 234 254 / var(--tw-bg-opacity, 1)) !important;
}

.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
  @apply text-gray-300 cursor-not-allowed;
}

.flatpickr-day.today {
  @apply border-blue-500;
}

.flatpickr-day.today:hover,
.flatpickr-day.today:focus {
  @apply bg-blue-100 text-gray-900;
}

.flatpickr-day:hover {
  @apply bg-blue-200;
}

.date-part.text-blue-600 {
  @apply font-medium;
}

/* Custom range styling */
.flatpickr-day.startRange.endRange.selected {
  border-radius: 5px !important;
}

.flatpickr-day.startRange {
  border-radius: 5px 0 0 5px !important;
}

.flatpickr-day.endRange {
  border-radius: 0 5px 5px 0 !important;
}

/* Filter forms: clear (×) sits in .input-input-append beside the daterange control (same pattern as select2) */
[data-controller="daterange"]:has(+ .input-input-append) [data-daterange-target="display"] {
  padding-right: 3rem !important;
}
@media all and (max-width: 450px) {
  .file-picker-container {
    @apply !block;
  }
  .file-picker-information-container {
    @apply pt-4
  }
  .file-picker-preview-image {
    @apply w-full m-auto
  }
}
/* Override library's float layout with grid (Bootstrap grid classes aren't loaded) */
.react-form-builder > div {
  display: grid !important;
  grid-template-columns: 3fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.react-form-builder .react-form-builder-preview {
  float: none !important;
  width: 100% !important;
  grid-column: 1;
  grid-row: 1;
  margin-top: 0 !important;
  @apply bg-sand-50 rounded-2xl p-8 pt-10 mb-5 border border-sand-600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 8px 32px rgba(0,0,0,0.03); /* card-glow */
}

.react-form-builder .react-form-builder-toolbar {
  float: none !important;
  width: 100% !important;
  grid-column: 2;
  grid-row: 1;
  margin-top: 0 !important;
  top: 0 !important;
}

.react-form-builder-toolbar {
  max-height: 75vh;
  overflow-y: auto;
  position: sticky !important;
  top: 0;
  z-index: 100;
  background-color: #fff;
  border: none;
  border-radius: 1rem; /* rounded-2xl */
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 8px 32px rgba(0,0,0,0.03); /* card-glow */

  /* toolbar title */
  h4 {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #A09C94; /* sand-500 */
    padding: 0.25rem 0.375rem;
    margin: 0 0 0.125rem;
    border-bottom: 1px solid #F5F4F0; /* sand-100 */
  }

  /* toolbar list reset */
  ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
  }

  /* toolbar items */
  ul > li {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.3125rem 0.375rem;
    border-radius: 0.375rem;
    font-size: 0.875rem; /* 14px */
    font-weight: 500;
    color: #555250; /* sand-700 */
    cursor: move;
    transition: background-color 0.15s ease;
    user-select: none;
  }

  ul > li:not(:has(.toolbar-group-item)):hover {
    background-color: #F5F4F0; /* sand-100 */
    color: #1A1918; /* sand-900 */
  }

  ul > li:not(:has(.toolbar-group-item)):active {
    background-color: #EEECE8; /* sand-200 */
  }

  /* Group wrapper li should not look like a draggable item */
  ul > li:has(.toolbar-group-item) {
    padding: 0;
    cursor: default;
  }

  /* icons */
  ul > li i {
    width: 1rem;
    text-align: center;
    font-size: 0.75rem;
    color: #A09C94; /* sand-500 */
    flex-shrink: 0;
  }

  ul > li:hover i {
    color: #555250; /* sand-700 */
  }

  /* group item — always-open sections with a plain title */
  .toolbar-group-item {
    margin-top: 0.5rem;
    border-top: 1px solid #EEECE8; /* sand-200 */
    padding-top: 0.25rem;
  }

  .toolbar-group-item .btn {
    font-size: 0.75rem;
    font-weight: 600;
    color: #777370; /* sand-600 */
    text-transform: uppercase;
    letter-spacing: 0.025em;
    padding: 0.25rem 0.375rem;
    pointer-events: none;
    cursor: default;
    text-align: center;
    display: block;
    width: 100%;
  }

  /* Force groups always visible — library uses .collapse which Tailwind
     overrides with visibility:collapse, so we must reset both */
  .toolbar-group-item .collapse {
    display: block !important;
    visibility: visible !important;
    height: auto !important;
    overflow: visible !important;
  }

  .toolbar-group-item ul {
    padding-left: 0;
  }

  /* slim scrollbar */
  &::-webkit-scrollbar {
    width: 4px;
  }

  &::-webkit-scrollbar-track {
    background: transparent;
  }

  &::-webkit-scrollbar-thumb {
    background-color: #C4C0B8; /* sand-400 */
    border-radius: 2px;
  }
}

.react-form-builder-toolbar.is-fixed {
  background-color: white !important;
  position: fixed !important;
  width: 280px !important;
  right: 0;
  border-left: none;
  border-radius: 1rem;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.06);
}

/* Edit-form panel: backdrop + centered modal when open (.react-form-builder-preview.is-editing).
   Rendered as a centered modal (not a left-edge drawer) so the hover-expanding
   sidebar can't cover the field-edit controls. */
.react-form-builder-preview.is-editing::before {
  content: "";
  position: fixed !important;
  inset: 0 !important;
  z-index: 1999 !important;
  background: rgba(26, 25, 24, 0.3) !important; /* sand-900/30 — matches app modal backdrop */
  backdrop-filter: blur(4px) !important;
  pointer-events: auto;
}

/* Hide the empty .edit-form wrapper that RFB2 renders even when nothing is
   being edited — without this the centered-modal styles below would show an
   empty box on initial page load. */
.react-form-builder .react-form-builder-preview .edit-form {
  background: #FAFAF8 !important; /* sand-50 — matches app modal bg */
  border: none !important;
  padding: 1.5rem 1.75rem !important;
  overflow-y: auto !important;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.04),
    0 8px 16px -4px rgba(0, 0, 0, 0.08),
    0 32px 64px -16px rgba(0, 0, 0, 0.12) !important;
  border-top-right-radius: 1rem !important; /* rounded-2xl */
  border-bottom-right-radius: 1rem !important;
  z-index: 2000 !important;
}

.react-form-builder .react-form-builder-preview .edit-form h4,
.react-form-builder .react-form-builder-preview .edit-form .dismiss-edit {
  margin-bottom: 1rem !important;
}

.react-form-builder .react-form-builder-preview .edit-form .clearfix {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 0.5rem !important;
  margin-bottom: 1.5rem !important;
  padding-bottom: 1rem !important;
  border-bottom: 1px solid #EEECE8 !important; /* sand-200 */
}

.react-form-builder .react-form-builder-preview .edit-form .clearfix h4 {
  margin: 0 !important;
  padding: 0 !important;
  font-size: 1.125rem !important;
  font-weight: 600 !important;
  color: #1A1918 !important; /* sand-900 */
  float: none !important;
}

/* Close button — matches the app's naked-btn / btn-base variant */
.react-form-builder .react-form-builder-preview .edit-form .clearfix .dismiss-edit {
  margin: 0 !important;
  padding: 0.4rem 0.5rem !important;
  border-radius: 10px !important; /* rounded-[10px] — btn-base */
  color: #555250 !important; /* sand-700 — naked-btn */
  float: none !important;
  font-size: 1rem !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

.react-form-builder .react-form-builder-preview .edit-form .clearfix .dismiss-edit:hover {
  color: #333130 !important; /* sand-800 — naked-btn hover */
  background-color: #FAFAF8 !important; /* sand-50 — naked-btn hover */
}

.react-form-builder .react-form-builder-preview .edit-form .clearfix .dismiss-edit:active {
  transform: scale(0.97) !important;
}

/* Base layout classes that Bootstrap would normally provide */
.react-form-builder-form .form-group {
  @apply mb-4;
}

.react-form-builder-form .form-check {
  @apply flex items-start gap-2 mb-1;
}

.react-form-builder-form .form-check-input {
  margin-top: 0.125rem;
  @apply w-4 h-4 flex-shrink-0 cursor-pointer;
}

.react-form-builder-form .form-check-label {
  @apply text-sm text-sand-700 cursor-pointer;
}

/* Style form generator inputs to match the app's design system */
.react-form-builder-form .form-group label,
.react-form-builder-form .form-label,
.react-form-builder-form .control-label {
  @apply block text-[11px] font-semibold uppercase tracking-wider text-sand-500 mb-1.5 cursor-default;
  background: none;
}

.react-form-builder-form .form-group input[type="text"],
.react-form-builder-form .form-group input[type="email"],
.react-form-builder-form .form-group input[type="number"],
.react-form-builder-form .form-group input[type="tel"],
.react-form-builder-form .form-group input[type="date"],
.react-form-builder-form .form-group textarea,
.react-form-builder-form .form-group select {
  @apply px-3 py-2.5 rounded-lg border border-sand-300 bg-sand-50 text-sm text-sand-800 block w-full;
  @apply focus:border-sand-500 focus:bg-white focus:outline-none focus:ring-2 focus:ring-sand-100;
}

.react-form-builder-form .form-group .form-control,
.react-form-builder-form .form-control {
  @apply px-3 py-2.5 rounded-lg border border-sand-300 bg-sand-50 text-sm text-sand-800 block w-full;
  @apply focus:border-sand-500 focus:bg-white focus:outline-none focus:ring-2 focus:ring-sand-100;
  height: auto;
}

.react-form-builder-form .rfb-item {
  @apply mb-4;
}

/* Filled forms: library wraps label + "Required" in Bootstrap .row; without builder card
   overrides, negative row margins and inline flow can let the badge sit on the first radio. */
.react-form-builder-form .SortableItem .row,
.react-form-builder-form .rfb-item .row {
  margin-left: 0;
  margin-right: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  column-gap: 0.5rem;
  row-gap: 0.25rem;
}

.react-form-builder-form .SortableItem .row > [class*="col"],
.react-form-builder-form .rfb-item .row > [class*="col"] {
  padding-left: 0;
  padding-right: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.form-builder-survey-edit {
  @apply mt-4 rounded-xl border border-sand-200 bg-sand-50 p-4;
}

.form-builder-survey-edit__divider {
  @apply mb-4 border-sand-200;
}

.form-builder-survey-edit__title {
  @apply mb-3 text-sm font-semibold text-sand-900;
}

.form-builder-survey-edit__checkbox {
  @apply mb-4 flex items-center gap-2 text-sm text-sand-700;
}

.form-builder-survey-edit__checkbox input {
  @apply h-4 w-4;
  accent-color: #333130; /* sand-800 */
}

.form-builder-survey-edit__checkbox input:disabled {
  @apply cursor-not-allowed opacity-60;
}

.form-builder-survey-edit__hint {
  @apply mb-3 text-xs text-sand-500;
}

/* Survey client name fields: hide delete button so they cannot be removed.
   Target the builder wrapper (.react-form-builder), not the generator (.react-form-builder-form).
   The trash icon lives inside a .btn.is-isolated parent — hide that entire container. */
.react-form-builder .rfb-item:has(input[id="survey_client_first_name"]) .btn.is-isolated,
.react-form-builder .rfb-item:has(input[id="survey_client_last_name"]) .btn.is-isolated,
.react-form-builder .rfb-item:has(input[name="survey_client[first_name]"]) .btn.is-isolated,
.react-form-builder .rfb-item:has(input[name="survey_client[last_name]"]) .btn.is-isolated {
  display: none !important;
}

/* Bootstrap 4 custom-checkbox reset — the library hides the native checkbox
   (opacity:0, position:absolute) and relies on label pseudo-elements that
   require Bootstrap CSS.  Scope to .custom-checkbox so radios are unaffected. */
.react-form-builder-form .custom-checkbox,
.react-form-builder .custom-checkbox {
  @apply flex items-start gap-1 mb-1;
}

.react-form-builder-form .custom-checkbox .custom-control-input,
.react-form-builder .custom-checkbox .custom-control-input {
  position: static !important;
  opacity: 1 !important;
  appearance: auto !important;
  accent-color: #333130 !important; /* sand-800 */
  margin-top: 0.125rem;
  @apply w-4 h-4 flex-shrink-0 cursor-pointer;
}

.react-form-builder-form .custom-checkbox .custom-control-label,
.react-form-builder .custom-checkbox .custom-control-label {
  @apply text-sm text-sand-800 cursor-pointer;
  padding-bottom: 0 !important;
}

.react-form-builder-form .custom-checkbox .custom-control-label::before,
.react-form-builder-form .custom-checkbox .custom-control-label::after,
.react-form-builder .custom-checkbox .custom-control-label::before,
.react-form-builder .custom-checkbox .custom-control-label::after {
  display: none !important;
}

/* Bootstrap 4 custom-radio reset — same Bootstrap hide trick as custom-checkbox.
   Radio options flow horizontally (inline-flex) within the form-group block. */
.react-form-builder-form .custom-radio,
.react-form-builder .custom-radio {
  display: flex !important;
  align-items: flex-start !important;
  gap: 0.375rem;
  margin-right: 0.75rem;
  margin-bottom: 0.25rem;
}

.react-form-builder-form .custom-radio .custom-control-input,
.react-form-builder .custom-radio .custom-control-input {
  position: static !important;
  opacity: 1 !important;
  appearance: auto !important;
  accent-color: #333130 !important; /* sand-800 */
  margin-top: 0.125rem;
  @apply w-4 h-4 flex-shrink-0 cursor-pointer;
}

.react-form-builder-form .custom-radio .custom-control-label,
.react-form-builder .custom-radio .custom-control-label {
  @apply text-sm text-sand-800 cursor-pointer;
  padding-left: 0 !important;
  padding-bottom: 0 !important;
}

.react-form-builder-form .custom-radio .custom-control-label::before,
.react-form-builder-form .custom-radio .custom-control-label::after,
.react-form-builder .custom-radio .custom-control-label::before,
.react-form-builder .custom-radio .custom-control-label::after {
  display: none !important;
}

/* Read-only form styling for preview */
.react-form-builder-form .form-group input[disabled],
.react-form-builder-form .form-group input[readonly],
.react-form-builder-form .form-group textarea[disabled],
.react-form-builder-form .form-group textarea[readonly],
.react-form-builder-form .form-group select[disabled],
.react-form-builder-form .form-group select[readonly],
.react-form-builder-form .form-group .form-control[disabled],
.react-form-builder-form .form-group .form-control[readonly] {
  @apply bg-sand-100 text-sand-500 cursor-not-allowed;
}

/* react-datepicker overrides — unlayered so they beat Tailwind preflight */
.react-datepicker-popper {
  @apply z-50;
}

.react-datepicker {
  @apply bg-white border border-sand-200 rounded-xl shadow-lg text-sm font-sans inline-block;
}

.react-datepicker__header {
  @apply bg-sand-50 border-b border-sand-200 rounded-t-xl pt-2 pb-1 text-center;
}

.react-datepicker__current-month {
  @apply text-sm font-medium text-sand-900 pb-1;
}

.react-datepicker__day-names {
  @apply flex justify-around;
}

.react-datepicker__day-name {
  @apply w-8 h-8 leading-8 text-center text-xs text-sand-500 font-medium;
}

.react-datepicker__month {
  @apply p-1;
}

.react-datepicker__week {
  @apply flex justify-around;
}

.react-datepicker__day {
  @apply w-8 h-8 leading-8 text-center text-sm rounded-lg cursor-pointer;
  @apply hover:bg-sand-100;
}

.react-datepicker__day--selected,
.react-datepicker__day--keyboard-selected {
  @apply bg-sand-500 text-white rounded-lg;
  @apply hover:bg-sand-600;
}

.react-datepicker__day--today {
  @apply font-semibold;
}

.react-datepicker__day--outside-month {
  @apply text-sand-300;
}

.react-datepicker__day--disabled {
  @apply text-sand-300 cursor-not-allowed;
  @apply hover:bg-transparent;
}

.react-datepicker__navigation {
  @apply absolute top-2.5 w-8 h-8 flex items-center justify-center cursor-pointer border-none bg-transparent;
}

.react-datepicker__navigation--previous {
  @apply left-1;
}

.react-datepicker__navigation--next {
  @apply right-1;
}

.react-datepicker__navigation-icon::before {
  @apply border-sand-400 border-t-2 border-r-2;
  content: "";
  display: block;
  width: 8px;
  height: 8px;
}

.react-datepicker__navigation-icon--previous::before {
  transform: rotate(225deg);
}

.react-datepicker__navigation-icon--next::before {
  transform: rotate(45deg);
}

.react-datepicker__sr-only {
  @apply sr-only;
}

.form-builder-image-upload {
  @apply mb-4;
}

.form-builder-image-upload__file-input {
  @apply sr-only;
}

.form-builder-image-upload__choose-btn {
  @apply mt-2 inline-flex items-center rounded-lg border border-sand-300 bg-white px-3 py-2 text-sm font-medium text-sand-800;
  @apply hover:border-sand-400 hover:bg-sand-50;
  @apply disabled:cursor-not-allowed disabled:opacity-60;
}

.form-builder-image-upload__hint {
  @apply mt-2 text-sm text-sand-600;
}

.form-builder-image-upload__error {
  @apply mt-2 text-sm text-red-600;
}

.form-builder-image-upload__preview {
  @apply mt-3 mb-4;

  img {
    @apply max-h-48 rounded-lg border border-sand-200;
  }
}

.form-builder-preset-options-locked .dynamic-option-list:not(.form-builder-preset-options) {
  display: none !important;
}

.form-builder-preset-options input[readonly] {
  @apply bg-sand-100 text-sand-700 cursor-default;
}

.react-form-builder .edit-form .form-builder-preset-options.dynamic-option-list .row {
  grid-template-columns: 6fr 3fr !important;
}

/* Tailwind preflight resets anchors; keep links visible in answered-form / preview HTML */
.rich-static-content a {
  color: #2563eb;
  text-decoration: underline;
}

.rich-static-content a:hover {
  color: #1d4ed8;
}

.react-form-builder .SortableItem h3.static ul {
  list-style: disc outside;
  padding-left: 1.5rem;
  margin: 0.25rem 0;
}

.react-form-builder .SortableItem h3.static ol {
  list-style: decimal outside;
  padding-left: 1.5rem;
  margin: 0.25rem 0;
}

.react-form-builder .SortableItem h3.static li {
  display: list-item;
}

h1.rich-static-content :is(p, li, span) {
  font-weight: 400;
}

h1.rich-static-content :is(strong, b),
h1.rich-static-content :is(strong, b) span {
  font-weight: 700;
}

h1.rich-static-content ul {
  list-style: disc outside;
  padding-left: 1.5rem;
  margin: 0.25rem 0;
}

h1.rich-static-content ol {
  list-style: decimal outside;
  padding-left: 1.5rem;
  margin: 0.25rem 0;
}

h1.rich-static-content li {
  display: list-item;
}

/* Multi-select dropdown CustomElement — closed like a Dropdown, opens Select2-style options */
.multi-select-dropdown-container {
  @apply relative w-full;
}

/* form-control sets display:block (higher specificity) — force a flex row so the
   caret stays on the right instead of dropping under the first chip. */
.react-form-builder-form .multi-select-dropdown-trigger.form-control,
.react-form-builder .multi-select-dropdown-trigger.form-control,
.multi-select-dropdown-trigger.form-control,
.multi-select-dropdown-trigger {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  text-align: left;
  cursor: pointer;
  min-height: 2.75rem;
}

.multi-select-dropdown-trigger:disabled {
  @apply cursor-not-allowed;
}

.multi-select-dropdown-summary {
  @apply flex flex-wrap items-center gap-1.5 min-w-0 text-sm text-sand-800;
  flex: 1 1 auto;
}

.multi-select-dropdown-summary.is-placeholder {
  @apply text-sand-400;
}

.multi-select-dropdown-chip {
  @apply inline-flex items-center gap-1 max-w-full rounded-md bg-sand-200 px-2 py-0.5 text-xs text-sand-800;
}

.multi-select-dropdown-chip-text {
  @apply truncate;
}

.multi-select-dropdown-chip-remove {
  @apply inline-flex items-center justify-center rounded text-sand-600 hover:text-sand-900;
  width: 1rem;
  height: 1rem;
  line-height: 1;
  font-size: 0.875rem;
}

.multi-select-dropdown-caret {
  flex: 0 0 auto;
  align-self: center;
  margin-left: 0.25rem;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 5px 4px 0 4px;
  border-color: #6b7280 transparent transparent transparent;
  opacity: 0.85;
  pointer-events: none;
}

.multi-select-dropdown-container.is-open .multi-select-dropdown-caret {
  border-width: 0 4px 5px 4px;
  border-color: transparent transparent #6b7280 transparent;
}

.multi-select-dropdown-menu {
  @apply absolute left-0 right-0 z-50 mt-1 max-h-60 overflow-y-auto rounded-lg border border-sand-300 bg-white py-1 shadow-lg;
  list-style: none;
  padding-left: 0;
}

.multi-select-dropdown-option {
  @apply block px-3 py-2 text-sm text-sand-800 cursor-pointer transition-colors duration-150;
}

.multi-select-dropdown-option:hover {
  @apply bg-sand-100;
}

/* Match Select2 selected option treatment (select2.tailwind.css) */
.multi-select-dropdown-option.is-selected,
.multi-select-dropdown-option.is-selected:hover {
  @apply bg-sand-200;
}

.multi-select-dropdown-empty {
  @apply px-3 py-2 text-sm text-sand-500;
}

.multi-select-dropdown-container.is-open .multi-select-dropdown-trigger {
  @apply border-brand-500 ring-2 ring-brand-100;
}

.multi-select-dropdown-container.is-disabled .multi-select-dropdown-trigger {
  @apply bg-sand-100 text-sand-500;
}
/* Builder-only theme: provides Bootstrap-like class names for react-form-builder2
   builder UI (toolbar, preview pane, edit form) using Tailwind / app design system.
   Scoped under .react-form-builder so it does not affect the rest of the app. */

.react-form-builder .form-group {
  @apply mb-4;
}

.react-form-builder .form-group label,
.react-form-builder .form-label,
.react-form-builder .control-label {
  @apply block text-[11px] font-semibold uppercase tracking-wider text-sand-500 mb-1.5 cursor-default;
  background: none;
}

.react-form-builder .custom-checkbox .custom-control-label,
.react-form-builder .custom-radio .custom-control-label {
  @apply font-normal m-0 text-sand-600;
}

.react-form-builder .form-group input[type="text"],
.react-form-builder .form-group input[type="email"],
.react-form-builder .form-group input[type="number"],
.react-form-builder .form-group input[type="tel"],
.react-form-builder .form-group input[type="date"],
.react-form-builder .form-group textarea,
.react-form-builder .form-group select,
.react-form-builder .form-control {
  @apply px-3 py-2.5 rounded-lg border border-sand-300 bg-sand-50 text-sm text-sand-800 block w-full;
  @apply focus:border-sand-500 focus:bg-white focus:outline-none focus:ring-2 focus:ring-sand-100;
  height: auto;
}

.react-form-builder .form-control[type="checkbox"] {
  @apply w-4 h-4 inline-block;
  height: auto;
  accent-color: #333130; /* sand-800 */
}

/* Buttons: match components.tailwind.css so builder actions look like the rest of the app */
.react-form-builder .btn {
  @apply py-2 px-4 text-center cursor-pointer rounded-xl inline-block font-medium border-0;
}

.react-form-builder .btn-primary {
  @apply py-2 px-4 bg-sand-600 text-white text-center decoration-transparent cursor-pointer rounded-xl inline-block
    hover:bg-sand-700 active:bg-sand-800;
}

.react-form-builder .btn-secondary {
  @apply py-2 px-4 bg-sand-100 text-sand-800 decoration-transparent cursor-pointer rounded-xl font-medium inline-block
    hover:bg-sand-200 active:bg-sand-200 text-center;
}

.react-form-builder .btn-danger {
  @apply py-2 px-4 bg-red-600 text-white text-center decoration-transparent cursor-pointer rounded-xl inline-block
    hover:bg-red-700 active:bg-red-800;
}

.react-form-builder .btn-light {
  @apply py-2 px-4 text-sand-800 decoration-transparent cursor-pointer rounded-xl font-medium inline-block
    hover:bg-sand-100 active:bg-sand-200 text-center;
}

/* Layout: row/col used in edit form and rfb-item */
.react-form-builder .row {
  @apply flex flex-wrap -mx-2;
}

.react-form-builder .row > [class*="col-"] {
  @apply px-2 box-border;
}

.react-form-builder .col-12 {
  @apply w-full;
}

.react-form-builder .col-6 {
  @apply w-1/2;
}

.react-form-builder .col-4 {
  @apply w-1/3;
}

.react-form-builder .col-8 {
  @apply w-2/3;
}

/* Edit form slide-out and dynamic option list */
.react-form-builder .edit-form .dynamic-option-list ul {
  @apply list-none m-0 p-0;
}

.react-form-builder .edit-form .dynamic-option-list ul li {
  @apply mt-2;
}

/* Header labels — match input-label pattern */
.react-form-builder .edit-form .dynamic-option-list ul li:first-child b {
  @apply text-[11px] font-semibold uppercase tracking-wider text-sand-500;
}

/* Subtle divider between option rows */
.react-form-builder .edit-form .dynamic-option-list ul li.clearfix {
  @apply pt-2 border-t border-sand-100;
}

/* Shared 4-column grid so header (Options, Value, Correct) lines up with data rows (input, input, checkbox, buttons) */
.react-form-builder .edit-form .dynamic-option-list .row {
  display: grid !important;
  grid-template-columns: 6fr 3fr 1fr 1fr;
  gap: 0.5rem 0.75rem;
  align-items: center;
}

/* Header row: first li has no .clearfix, 3 cells — place them in columns 1, 2, 3 so "Correct" is above the checkbox */
.react-form-builder .edit-form .dynamic-option-list ul li:first-child .col-sm-6 {
  grid-column: 1;
  width: auto !important;
}

.react-form-builder .edit-form .dynamic-option-list ul li:first-child .col-sm-2 {
  grid-column: 2;
  width: auto !important;
}

.react-form-builder .edit-form .dynamic-option-list ul li:first-child .col-sm-4 {
  grid-column: 3;
  text-align: center;
  width: auto !important;
}

/* Data rows: 4 cells map to columns 1–4; checkbox stays in column 3 and is centered.
   Grid items must be width:auto so they fill their tracks — the col-sm-* percentage
   widths (1/2, 1/6, etc.) resolve against the track, not the row, making them tiny. */
.react-form-builder .edit-form .dynamic-option-list .row > [class*="col-sm"] {
  width: auto !important;
  min-width: 0;
}

.react-form-builder .edit-form .dynamic-option-list ul li.clearfix .row .col-sm-1 {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
  padding-left: 0;
  padding-right: 0;
}

.react-form-builder .edit-form .dynamic-option-list ul li.clearfix .row .col-sm-1 input[type="checkbox"],
.react-form-builder .edit-form .dynamic-option-list ul li.clearfix .row .col-sm-1 input[type="radio"] {
  width: 1rem !important;
  height: 1rem !important;
  max-width: 1rem !important;
  min-width: 1rem !important;
  flex-shrink: 0;
  margin: 0 !important;
  padding: 0 !important;
  cursor: pointer;
  accent-color: #333130; /* sand-800 */
  display: inline-block;
  border-radius: 0.25rem;
}

.react-form-builder .edit-form .dynamic-option-list ul li.clearfix .row .col-sm-3 {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

/* Only text inputs in option rows get full width; exclude checkbox/radio so they stay narrow */
.react-form-builder .edit-form .dynamic-option-list ul li input.form-control:not([type="checkbox"]):not([type="radio"]) {
  @apply min-w-0 w-full;
}

.react-form-builder .edit-form .dismiss-edit {
  @apply cursor-pointer text-sand-500 hover:text-sand-900;
}

.react-form-builder .edit-form textarea {
  @apply w-full;
}

/* Paragraph Text editor (TECHSUPP-3890): rich-text area so stored HTML shows formatted, not as code */
.react-form-builder .edit-form .form-builder-paragraph-editor__toolbar {
  @apply flex gap-1 mb-1;
}

.react-form-builder .edit-form .form-builder-paragraph-editor__button {
  @apply py-1 px-3 text-sm;
}

.react-form-builder .edit-form .form-builder-paragraph-editor__input {
  @apply min-h-32 max-h-96 overflow-y-auto resize-y;
}

.react-form-builder .edit-form .form-builder-paragraph-editor__input:empty::before {
  @apply text-sand-400;
  content: attr(data-placeholder);
}

/* Rich text editor (Display Label): visible boundary so it's clear where the editor is */
.react-form-builder .edit-form .rdw-editor-wrapper {
  border: 1px solid #EEECE8 !important; /* sand-300 */
  border-radius: 0.5rem !important;
  background-color: #FAFAF8 !important; /* sand-50 */
  overflow: visible !important;
}

.react-form-builder .edit-form .rdw-editor-toolbar {
  border-bottom: 1px solid #EEECE8 !important; /* sand-200 */
  background-color: #fff !important;
  border-top-left-radius: 0.5rem !important;
  border-top-right-radius: 0.5rem !important;
}

.react-form-builder .edit-form .rdw-editor-main {
  border-left: 1px solid #EEECE8 !important; /* sand-200 */
  border-right: 1px solid #EEECE8 !important;
  border-bottom: 1px solid #EEECE8 !important;
  border-bottom-left-radius: 0.5rem !important;
  border-bottom-right-radius: 0.5rem !important;
  background-color: #fff !important;
  min-height: 5rem !important;
  padding: 0.5rem 0.75rem !important;
}

/* Edit form: custom-control checkboxes (library markup) — visible, match app design */
.react-form-builder .edit-form .custom-control {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  margin-bottom: 0.75rem !important;
}

.react-form-builder .edit-form .custom-control-input {
  width: 1rem !important;
  height: 1rem !important;
  min-width: 1rem !important;
  margin: 0 !important;
  cursor: pointer !important;
  accent-color: #333130; /* sand-800 */
}

.react-form-builder .edit-form .custom-control-label {
  font-size: 0.875rem !important;
  color: #333130 !important; /* sand-800 */
  cursor: pointer !important;
  font-weight: 500 !important;
  margin-bottom: 0 !important;
}

/* Section labels that sit above a checkbox (e.g. "Print options", "Alternate/Signature Page") */
.react-form-builder .edit-form .form-group > .control-label {
  display: block !important;
  margin-bottom: 0.5rem !important;
}

/* Hide library options we don't use, that cause crashes, or that don't work in our rendering */
.react-form-builder .edit-form .form-group:has(#display-on-alternate),
.react-form-builder .edit-form .form-group:has(#optionsApiUrl),
.react-form-builder .edit-form .form-group:has(#is-read-only),
.react-form-builder .edit-form .form-group:has(#page-break-before-element),
.react-form-builder .edit-form .form-group:has(#do-bold),
.react-form-builder .edit-form .form-group:has(#print-options) {
  display: none !important;
}


/* Edit form: col-sm-* so API URL row and dynamic option list layout work */
.react-form-builder .edit-form .col-sm-6 {
  @apply w-full sm:w-1/2;
}

.react-form-builder .edit-form .col-sm-2 {
  @apply w-1/6 min-w-0;
}

.react-form-builder .edit-form .col-sm-4 {
  @apply w-1/3 min-w-0;
}

.react-form-builder .edit-form .col-sm-1 {
  @apply w-auto min-w-0 flex-shrink-0;
}

.react-form-builder .edit-form .col-sm-3 {
  @apply w-1/4 min-w-0 flex-shrink-0;
}

.react-form-builder .edit-form .dynamic-options-actions-buttons {
  display: flex !important;
  align-items: center !important;
  gap: 0.375rem !important;
}

/* Compact square icon buttons for add/remove options */
.react-form-builder .edit-form .dynamic-options-actions-buttons .btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 1.75rem !important;
  height: 1.75rem !important;
  padding: 0 !important;
  border-radius: 0.5rem !important;
  font-size: 0.75rem !important;
  border: none !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

/* Plus button — sand blue */
.react-form-builder .edit-form .dynamic-options-actions-buttons .btn-success {
  background-color: #EEF6FF !important; /* sand-50 */
  color: #2570CC !important; /* sand-600 */
}

.react-form-builder .edit-form .dynamic-options-actions-buttons .btn-success:hover {
  background-color: #D9EBFF !important; /* sand-100 */
}

/* Minus button — status danger red from tailwind config */
.react-form-builder .edit-form .dynamic-options-actions-buttons .btn-danger {
  background-color: #FCEBEB !important; /* status.danger-bg */
  color: #E24B4A !important; /* status.danger */
}

.react-form-builder .edit-form .dynamic-options-actions-buttons .btn-danger:hover {
  background-color: #E24B4A !important; /* status.danger */
  color: #fff !important;
}

/* Form group range (min/max inputs in edit form) */
.react-form-builder .form-group-range label {
  @apply block;
}

.react-form-builder .form-group-range input {
  @apply inline-block;
}

.react-form-builder .form-group-range input:first-of-type {
  @apply w-[21%] ml-0;
}

.react-form-builder .form-group-range input:last-of-type {
  @apply w-[78%] ml-[1%];
}

/* rfb-item .row (label span wrapper in preview) — library uses padding/border.
   The builder DOM is: .react-form-builder > .react-form-builder-preview > .Sortable > .SortableItem.rfb-item
   (there is NO .react-form-builder-form wrapper in builder mode — that only exists in the generator). */
.react-form-builder .rfb-item .row {
  @apply p-3 border border-sand-200 rounded-xl mt-[-18px] bg-white/60;
}

/* Override library inline styles on SortableItem — the library sets border, padding,
   margin, background-color, and cursor as inline styles, so every override needs !important */
.react-form-builder .SortableItem.rfb-item,
.react-form-builder .rfb-item {
  border: 1px solid #C4C0B8 !important; /* sand-400 */
  border-radius: 1rem !important; /* rounded-2xl — matches app card style */
  padding: 1.25rem !important;
  margin-bottom: 0.75rem !important;
  background-color: white !important; /* sand-50 */
  cursor: pointer !important;
  opacity: 1 !important;
  box-shadow: none !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease !important;
}

.react-form-builder-form .rfb-item label span {
  padding: 0 !important;
}

.react-form-builder .SortableItem.rfb-item:hover,
.react-form-builder .rfb-item:hover {
  border-color: #E0DDD8 !important; /* sand-300 */
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.03),
    0 4px 8px -2px rgba(0, 0, 0, 0.06),
    0 16px 32px -8px rgba(0, 0, 0, 0.08) !important;
  transform: translateY(-2px);
  cursor: grab !important;
}

.react-form-builder .SortableItem.rfb-item:active,
.react-form-builder .rfb-item:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
  cursor: grabbing !important;
}

/* Hide the element type badge (e.g. "Client Last Name") inside .toolbar-header —
   it duplicates the label and can confuse users */
.react-form-builder .rfb-item .toolbar-header > .badge.badge-secondary {
  @apply hidden;
}

/* The library positions .toolbar-header-buttons absolutely inside .toolbar-header
   (which is position:relative). Override right/margin-top to keep buttons inside the card. */
.react-form-builder .rfb-item .toolbar-header {
  display: block !important;
}

.react-form-builder .rfb-item .toolbar-header-buttons {
  position: absolute !important;
  right: 0 !important;
  top: -1rem !important;
  margin-top: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.25rem !important;
}

/* Action buttons (edit, delete, drag handle) inside preview items.
   Library renders: <div class="btn is-isolated"> <i class="is-isolated fas fa-edit|fa-trash"> </div>
   and a drag handle with <i class="is-isolated fas fa-grip-vertical"> */
.react-form-builder .rfb-item .btn.is-isolated {
  @apply inline-flex items-center justify-center w-7 h-7 rounded-lg text-sand-500
    opacity-0 transition-all duration-150 cursor-pointer;
}

.react-form-builder .rfb-item .btn.is-isolated:hover {
  @apply bg-sand-200 text-sand-700;
}

/* Delete button gets a red tint on hover */
.react-form-builder .rfb-item .btn.is-isolated:has(.fa-trash):hover {
  @apply bg-red-50 text-red-500;
}

/* Drag handle icon — wrapped in a consistent button-sized hit area */
.react-form-builder .rfb-item .fa-grip-vertical {
  @apply inline-flex items-center justify-center w-7 h-7 text-sand-300 cursor-grab opacity-0 transition-all duration-150;
}

/* Reveal all action buttons on item hover */
.react-form-builder .rfb-item:hover .btn.is-isolated,
.react-form-builder .rfb-item:hover .fa-grip-vertical {
  @apply opacity-100;
}

/* Fix signature canvas cursor offset — disable hover transforms on signature items
   and ensure canvas coordinates are not affected by CSS transforms */
.react-form-builder .rfb-item:has(canvas):hover {
  transform: none !important;
}

.react-form-builder canvas {
  touch-action: none;
  cursor: crosshair;
}

/* Nested input: radio group and option alignment */
.nested-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  align-items: center;
  padding-top: 0.25rem;
}

.nested-radio-option {
  display: flex !important;
  align-items: center !important;
  gap: 0.375rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 400;
  color: #555250; /* sand-700 */
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 0;
}

.nested-radio-option input[type="radio"] {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  margin: 0;
  cursor: pointer;
  accent-color: #A09C94; /* sand-500 */
}

.nested-radio-option span {
  line-height: 1;
}

/* "Required" badge — library renders <span class="label-required badge badge-danger">Required</span>.
   Replace the word with a red asterisk (the original text is hidden but kept in the DOM
   for the accessibility tree via the surrounding badge title). */
.react-form-builder .rfb-item .label-required.badge.badge-danger {
  @apply ml-1 inline-block bg-transparent p-0 align-middle text-transparent;
}
.react-form-builder .rfb-item .label-required.badge.badge-danger::before {
  content: "*";
  @apply text-base font-bold leading-none text-red-600;
}

/* Image element centering — react-form-builder2 sets text-align as an inline style
   on the image wrapper when the user chooses "center". Ensure <img> respects it. */
.react-form-builder .rfb-item img {
  display: inline-block;
  max-width: 100%;
  height: auto;
}
.icon-base {
  @apply w-10 h-10 rounded-xl flex items-center justify-center text-2xl;
}

.icon-primary {
  @apply text-sand-900;
}

.icon-accent-green {
  @apply text-accent-green;
}

.icon-accent-blue {
  @apply text-accent-blue;
}

.icon-accent-amber {
  @apply text-accent-amber;
}

.icon-accent-orange {
  @apply text-accent-orange;
}

.icon-accent-lime {
  @apply text-accent-lime;
}

.icon-accent-pink {
  @apply text-accent-pink;
}

.icon-accent-red {
  @apply text-accent-red;
}

.icon-accent-purple {
  @apply text-accent-purple;
}

.icon-accent-indigo {
  @apply text-accent-indigo;
}

.joined-mobile-app-icon {
  @apply inline-flex items-center text-accent-green;
  font-size: 1.125rem;
  line-height: 1;
}

.joined-mobile-app-icon .fa {
  line-height: 1;
  vertical-align: -0.05em;
}

.web-portal-only-icon {
  @apply inline-flex items-center text-accent-green;
  font-size: 1.125rem;
  line-height: 1;
}

.web-portal-only-icon .fa {
  line-height: 1;
  vertical-align: -0.05em;
}

.invited-not-signed-up-icon {
  @apply inline-flex items-center text-accent-green;
  font-size: 1.125rem;
  line-height: 1;
}

.invited-not-signed-up-icon .fa {
  line-height: 1;
  vertical-align: -0.05em;
}
.auth-page {
  @apply flex h-screen justify-center items-center page-light-layer-bg;
}

.auth-card {
  @apply bg-white rounded-2xl card-glow px-8 py-6 mb-5 w-full md:w-[480px];
}

.auth-card-mobile {
  @apply w-full p-6;
}

.auth-logo-wrapper {
  @apply flex justify-center items-center gap-3 my-2;
}

.auth-logo {
  @apply flex-shrink-0 h-[62px] w-auto;
  filter: brightness(0) invert(33%) sepia(8%);
}

.auth-logo-name {
  @apply font-display text-[55px] font-normal text-sand-700 tracking-[-0.035em] whitespace-nowrap leading-none;
}

.auth-content {
  @apply pt-7;
}
.mobile-layout {
  @apply flex flex-col h-dvh overflow-hidden;
}

.mobile-layout--content {
  @apply flex-1 min-h-0 overflow-hidden flex flex-col;
}

.mobile-layout--bottom-bar {
  @apply flex-shrink-0 relative z-20;
  @apply flex items-center justify-center;
  padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
}
.chart-wrapper {
  position: relative;
  overflow-x: auto;
  box-sizing: border-box;
}

.chart-wrapper canvas {
  background: transparent;
  display: block;
}
.btn-mobile-action {
  @apply !flex items-center gap-3 !px-3.5 !py-[11px] w-full
         no-underline cursor-pointer text-left
         border-b border-[#f0ece5] !justify-between !rounded-none;
  -webkit-tap-highlight-color: transparent;
}

.btn-mobile-action i {
  @apply w-5 h-5 flex items-center justify-center flex-shrink-0 text-[#1c1a17];
}

.btn-mobile-action #button-body {
  @apply flex-1 text-[13px] font-medium text-[#1c1a17];
}

.btn-mobile-action #button-body div {
  @apply text-[#1c1a17];
}

.btn-mobile-action::after {
  content: "›";
  font-size: 25px;
  line-height: 1;
  color: #ccc8c0;
  flex-shrink: 0;
}

/* Danger variant — red icon + title */
.btn-mobile-action.mobile-action-danger i {
  @apply text-status-danger;
}

.btn-mobile-action.mobile-action-danger #button-body {
  @apply text-status-danger;
}

.btn-mobile-action.mobile-action-danger #button-body div {
  @apply text-status-danger;
}

.btn-mobile-naked {
  @apply flex items-center justify-center !px-2
        text-sand-700 cursor-pointer transition-all duration-150;
}

.mobile-filter-form {
  @apply px-5 py-3;
}

.mobile-filter-form .filter-form {
  @apply !flex !flex-col;
}

.mobile-filter-form .col-span-6 {
  @apply !justify-stretch;
}

.mobile-filter-form button[type='submit'] {
  @apply !block !w-full;
}
/* Template Base */
.mobile-template--root-body {
  @apply bg-background flex-1 overflow-y-auto p-4;
}

.mobile-template--root {
  @apply flex flex-col h-[83dvh];
}

/* A page loaded into another page's body (a Settings section with its own sub-tabs) brings its own sticky
   top bar. At the same z-index it painted over the outer page's tab dropdown, so taps on the dropdown's first
   items opened the inner dropdown instead (TECHSUPP-3337). Keep the inner bar one layer below the outer one. */
.mobile-template--root-body .mobile-template--top-bar {
  z-index: 37;
}

.mobile-template--root-body:not(:has([data-section-id])):has(.mobile-template--root),
.mobile-template--root-body:not(:has([data-section-id])) :is(div, section, turbo-frame):has(.mobile-template--root) {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.mobile-template--root-body:not(:has([data-section-id])) :is(div, section, turbo-frame):has(.mobile-template--root) {
  flex: 1 1 auto;
}

.mobile-template--root-body:not(:has([data-section-id])) .mobile-template--root {
  height: auto;
  flex: 1 1 0;
  min-height: 0;
}

.mobile-template--root-body:not(:has([data-section-id])) .mobile-template--root-body .mobile-template--root:not(:has(.mobile-template--root)) {
  display: block;
  overflow-y: auto;
}

.mobile-template--root-body:not(:has([data-section-id])) .mobile-template--root-body .mobile-template--root:not(:has(.mobile-template--root)) > .mobile-template--top-bar {
  position: static;
}

.mobile-template--root-body:not(:has([data-section-id])) .mobile-template--root-body .mobile-template--root:not(:has(.mobile-template--root)) > .mobile-template--root-body {
  overflow: visible;
}
/* Client profile "All Client Profile Sections": each stacked section is `section#inline-section-*`.
   Kept here, not in the section markup, so the shared components stay untouched. */

/* A section that renders its own header (title + actions) needs no card label above it. */
section[id^="inline-section-"]:has(.header--main) > h3 {
  display: none;
}

/* The section markup hides each page's whole top bar. Show it again without its nav row (back button, title,
   parent tabs, "…" actions), which the section header replaces, so the sub-tab strip (Forms: Submissions /
   Drafts / Requests) stays. [class~="hidden"] leaves alone a bar that its own page hides (skip_layout), and
   is used instead of `.hidden`, which would make Tailwind copy this rule into every `@apply hidden`. */
section[id^="inline-section-"] .mobile-template--top-bar:not([class~="hidden"]) {
  display: block;
  position: static;
  padding-top: 0 !important; /* overrides the inline safe-area padding */
}

section[id^="inline-section-"] .mobile-template--nav {
  display: none;
}

/* Messenger Template Overrides */

.mobile-messenger-template .mobile-template--root {
  @apply h-full min-h-0 flex flex-col;
}

.mobile-messenger-template .mobile-template--root-body {
  @apply overflow-hidden flex flex-col flex-1 min-h-0;
}

.mobile-messenger-template,
.mobile-messenger-template .mobile-template,
.mobile-messenger-template .mobile-template--page,
.mobile-messenger-template .mobile-template--nested,
.mobile-messenger-template .mobile-template--nested-body {
  @apply h-full min-h-0 flex flex-col overflow-hidden;
}

.mobile-messenger-template #tabs_messenger {
  @apply flex flex-col flex-1 min-h-0 overflow-hidden h-full;
}

/* Matched by attribute rather than as `.h-full`: naming a utility class in a
   selector makes Tailwind treat this rule as part of that utility's definition,
   which turns every `@apply h-full` in the build into a circular dependency. */
.mobile-messenger-template .mobile-template--root-body > [class~="h-full"],
.mobile-messenger-template .mobile-template--nested-body > [class~="h-full"] {
  @apply flex-1 min-h-0 overflow-hidden;
}

html.conversation-keyboard-lock,
html.conversation-keyboard-lock body {
  overflow: hidden;
  overscroll-behavior: none;
  height: 100%;
  max-height: 100%;
}

html.conversation-keyboard-open .mobile-layout--bottom-bar {
  display: none;
}

/* Drop the spacing that sits under the composer so it rests on the keyboard.
   `[class~="m-2"]` is the page template's trailing content wrapper, which is
   empty in a conversation but still contributes its margins. */
html.conversation-keyboard-open .mobile-messenger-template .mobile-template--root-body {
  padding-bottom: 0;
}

html.conversation-keyboard-open .mobile-messenger-template .mobile-template--root-body > [class~="m-2"] {
  margin: 0;
}

html.conversation-keyboard-open .mobile-messenger-template .conversation-composer {
  padding-bottom: 0;
}

.mobile-messenger-template .conversation-composer {
  @apply relative flex-shrink-0 z-10 bg-background pb-2;
}

.mobile-messenger-template [data-messages-container] {
  @apply flex-1 min-h-0 overflow-y-auto;
  -webkit-overflow-scrolling: touch;
}

/* Wizard Template Overrides */
/* Hacky - need to refactor */
.wizard-stepper-form .mobile-template--root-body {
  @apply flex-none p-0;
}

.wizard-stepper-form .mobile-template--root {
  @apply flex-none h-auto;
}

.wizard-stepper-form .mobile-template--bottom-bar {
  @apply hidden;
}

.wizard-stepper-form .mobile-template--top-bar {
  @apply hidden;
}
/* Mobile message composer: a rich text editor (so files can be attached) styled
   as the single-line chat input. The paperclip button replaces the Trix toolbar. */
.conversation-composer trix-toolbar {
  display: none;
}

.conversation-composer .conversation-composer--editor trix-editor {
  @apply bg-white w-full text-sm text-sand-800 border-0 shadow-none py-2 px-0 leading-relaxed;
  min-height: 2.25rem;
  max-height: 150px;
  overflow-y: auto;
  outline: none;
}

.conversation-composer .conversation-composer--editor trix-editor:empty:not(:focus)::before {
  @apply text-sand-400;
}

.conversation-composer .conversation-composer--editor trix-editor figure.attachment--preview img {
  max-height: 6rem;
}
.modal-frame-container .header-title {
  max-width: 90%;
  word-break: break-all;
}

@media all and (max-width: 700px) {
  .modal-frame-container {
    position: fixed;
    width: 100vw;
    height: 100vh;
  }
  .modal-frame-container > .modal-frame-content {
    min-width: unset;
    max-width: none;
    max-height: unset;
    border-radius: 0;
    width: 100%;
    height: 100%;
  }
  /* The popup is full-screen here, and the fixed left menu (z-index 100, above the popup's z-50)
     would still cover its left edge. Hide the menu while a popup is open (TECHSUPP-2672). */
  body:has(.modal-frame-container:not(.hidden)) .sidebar-container {
    display: none;
  }
}

.modal-frame-container .modal-frame-body-container {
  min-width: 150px;
  padding: 0 1rem;
}

/* Select2 leaves the original <select> in the DOM as an absolutely positioned
   .select2-hidden-accessible element. With no positioned ancestor inside the scroller it
   anchors to .modal-frame-content instead, so it never scrolls with the form and stretches
   the panel's own (overflow: hidden, scrollbar-less) scroll box hundreds of pixels past its
   height. The browser can then scroll the whole modal to "reveal" it, with nothing on screen
   to show it happening (TECHSUPP-2406). Both variants need this, so it stays unscoped. */
.modal-frame-body-container {
  position: relative;
}

.modal-frame-body-container .input-grid {
  min-width: 0;
  max-width: 100%;
}
/* ─── Page Light Layer ──────────────────────────────────────────────────────── */

@keyframes lightLayerBreath { 0%,100% { opacity:.36; } 50% { opacity:.55; } }
@keyframes lightRayShimmer  { 0%,100% { opacity:.3; } 50% { opacity:.5; } }

.page-light-layer-bg {
  position: relative;
  background:
    radial-gradient(ellipse 78% 58% at 102% -2%,
      rgba(255,255,232,.36) 0%,
      rgba(255,218,95,.18)  17%,
      rgba(238,168,58,.06)  38%,
      transparent           60%),
    #F5F4F0;
}

.page-light-layer-bg .mobile-template--root-body {
  background: transparent;
}

.page-light-layer {
  position: absolute; top: 0; left: 0; width: 100%;
  height: 100%; pointer-events: none; z-index: -1;
}
@tailwind base;
@tailwind components;
@tailwind utilities;

.pagy-nav.pagination {
  @apply flex gap-1.5 items-center;
}

.page.next a, .page.prev a {
  @apply w-16 h-9 flex items-center justify-center rounded-[10px] border border-sand-300 text-sand-600 bg-white hover:bg-sand-50 hover:border-sand-400 hover:text-sand-800 transition-all font-medium text-sm cursor-pointer;
}

.page.next.disabled, .page.prev.disabled {
  @apply w-16 h-9 flex items-center justify-center rounded-[10px] border border-sand-200 text-sand-400 bg-sand-50 font-medium text-sm cursor-default;
}

.page a, .page.gap {
  @apply w-9 h-9 flex items-center justify-center rounded-[10px] border border-sand-200 text-sand-500 bg-white hover:bg-sand-50 hover:text-sand-700 text-sm font-medium transition-all cursor-pointer;
}

.page.active {
  @apply w-9 h-9 flex items-center justify-center rounded-[10px] bg-sand-900 text-white text-sm font-medium cursor-default border-0;
}

@media (max-width: 450px) {
  .pagy-nav.pagination .page:not(.prev):not(.next):not(.active) { @apply hidden; }
  .pagy-nav.pagination .page.prev, .pagy-nav.pagination .page.next, .pagy-nav.pagination .page.active { @apply inline-flex; }
}
@tailwind base;
@tailwind components;
@tailwind utilities;

@layer preview {
  .push__container {
    @apply m-auto
  }
  .push__wrapper {
    @apply mt-[6px]
  }
  .push__box {
    @apply bg-slate-200 hidden relative shadow-[0_0_20px_rgba(0,0,0,0.3)] z-[1] mx-0 my-2 px-3 py-2.5 rounded-xl last:block before:content-[''] before:absolute before:shadow-[inset_0_0_100px_rgba(255,255,255,0.6)] before:backdrop-blur-[20px] before:z-[-1] before:rounded-xl before:inset-0
  }
  .push__top {
    @apply flex justify-between mb-[5px]
  }
  .push__top .col {
    @apply flex items-center
  }
  .push__imgwrap {
    @apply ml-0 mr-[5px] mt-0.5 mb-0
  }
  .push__icon {
    @apply max-w-[25px] w-auto
  }
  .push__title {
    @apply text-[#bf201c] uppercase
  }
  .push__time {
    @apply text-sm
  }
  .push__person {
    @apply font-bold mb-0.5
  }
}
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #E0DDD8;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #C4C0B8;
}
/* App Select2 theme: match .input-input in components.tailwind.css */
/* Vendor select2.min.css is loaded *before* Tailwind in layout so these rules win. */

div[multiple] {
  @apply border-0 p-0;
}

/* Container: no extra chrome (selection carries border/background like .input-input) */
.select2.select2-container.select2-container--default {
  @apply block w-full bg-transparent shadow-none outline-none;
}

/* Single + multiple: same shell as .input-input */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
  @apply min-h-10 w-full rounded-lg border border-sand-300 bg-sand-50 text-sm text-sand-800 shadow-none outline-none transition-all !important;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--multiple {
  @apply border-brand-500 ring-2 ring-brand-100 !important;
}

/* Validation error: SimpleForm puts `.input-input--with-errors` on the (now hidden) native <select>,
   which sits just before its select2 widget — so paint the visible selection box red to match the
   text-input error border in components.tailwind.css. Higher specificity than the rules above so it
   wins among the !important declarations, focused or not. */
.input-input--with-errors ~ .select2-container--default .select2-selection--single,
.input-input--with-errors ~ .select2-container--default .select2-selection--multiple {
  @apply border-red-500 !important;
}

.input-input--with-errors ~ .select2-container--default.select2-container--focus .select2-selection--single,
.input-input--with-errors ~ .select2-container--default.select2-container--focus .select2-selection--multiple,
.input-input--with-errors ~ .select2-container--default.select2-container--open .select2-selection--single,
.input-input--with-errors ~ .select2-container--default.select2-container--open .select2-selection--multiple {
  @apply border-red-500 ring-2 ring-red-100 !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  @apply pl-3 pr-8 leading-10 text-sand-800 !important;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
  @apply text-sand-400 !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__rendered {
  @apply flex flex-wrap items-center gap-1 px-2 py-1 !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__placeholder {
  @apply text-sand-400 !important;
}

.select2-container--default .select2-selection--multiple .select2-search--inline .select2-search__field {
  @apply mt-0 text-sm text-sand-800 placeholder:text-sand-400 !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  @apply absolute top-0 right-1 flex h-10 w-8 items-center justify-center !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
  @apply absolute top-1/2 left-1/2 h-0 w-0 border-t-[5px] border-x-[4px] border-b-0 border-solid border-t-sand-500 border-x-transparent !important;
  margin-top: -2px;
  margin-left: -4px;
}

.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
  @apply border-t-0 border-b-[5px] border-b-sand-500 border-x-[4px] border-x-transparent !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__arrow {
  @apply h-9 absolute top-1/2 right-1 w-5 -translate-y-1/2 !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__arrow b {
  @apply absolute top-1/2 left-1/2 h-0 w-0 border-t-[5px] border-x-[4px] border-b-0 border-solid border-t-sand-500 border-x-transparent !important;
  margin-top: -2px;
  margin-left: -4px;
}

.select2-container--default.select2-container--open .select2-selection--multiple .select2-selection__arrow b {
  @apply border-t-0 border-b-[5px] border-b-sand-500 border-x-[4px] border-x-transparent !important;
}

/* Legacy generic selector — keep multiple choice layout */
.select2-selection {
  @apply z-[1];
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
  width: calc(100% - 20px);
}

.select2-selection__choice[title=''] {
  @apply hidden !important;
}

.select2-selection__choice {
  @apply !inline-block !w-fit !pr-2;
}

.select2-dropdown .select-dropdown-hint {
  @apply border-t border-sand-200 px-3 py-2 text-sm leading-snug text-sand-500;
}

.select2-dropdown .select-dropdown-hint__action {
  @apply !inline h-auto min-w-0 align-baseline text-sm font-medium underline;
}

.select2-results__option:not(:has(.select2-results__group)):not([aria-disabled="true"]):hover {
  @apply cursor-pointer bg-sand-100 transition-colors duration-150;
}

/* Select2 4.0.3 marks a disabled <option> with aria-disabled but does not style it, so an
   unselectable entry would otherwise look identical to a selectable one. */
.select2-results__option[aria-disabled="true"] {
  @apply cursor-not-allowed text-sand-400;
}

.select2-results__group {
  @apply block px-3 py-1.5 text-xs font-semibold uppercase tracking-wide text-sand-500;
}

.select2-container .select2-dropdown:not(:has(.select2-search)) .select2-results .select2-results__option[aria-selected="true"],
.select2-container .select2-dropdown:not(:has(.select2-search)) .select2-results .select2-results__option[aria-selected="true"]:hover {
  @apply bg-sand-200 !important;
}

.settings-select-container .input-container {
  @apply w-[250px];
}

.select2:has(+ .input-input-append) .select2-selection--single {
  @apply pr-4;
}

.select2.has-visible-clear .select2-selection__arrow {
  @apply hidden !important;
}

.select2-container--default.select2-container--focus .select2-selection--multiple {
  @apply pr-6;
}

.select2-container--default.select2-container--disabled .select2-selection {
  @apply bg-gray-200 opacity-75 cursor-not-allowed;
}
@tailwind base;
@tailwind components;
@tailwind utilities;

.sidebar-container {
  @apply fixed left-0 top-0 bottom-0 px-3 pb-3 flex flex-col transition-all duration-300 ease-in-out overflow-hidden bg-white overflow-y-scroll
}

.layout-main.layout-main--sidebar-pinned {
  padding-left: 14rem;
  transition: padding-left 300ms ease-in-out;
}

/* Notion-style: quiet << / >> control in the sidebar header */
.sidebar-header {
  @apply flex items-center gap-1 min-w-0;
}

.sidebar-container--collapsed .sidebar-header {
  @apply justify-center;
}

.sidebar-container--expanded .sidebar-header {
  @apply justify-between;
}

.sidebar-header .sidebar-logo-container {
  @apply min-w-0 flex-1;
}

.sidebar-pin-button {
  @apply hidden shrink-0 w-7 h-7 mt-3 items-center justify-center rounded-md text-sand-400
         hover:bg-sand-100 hover:text-sand-700 transition-colors duration-150
         cursor-pointer border-0 bg-transparent p-0;
}

.sidebar-container--expanded .sidebar-pin-button {
  @apply inline-flex;
}

.sidebar-pin-button--pinned {
  @apply text-sand-600;
}

.sidebar-pin-icon {
  @apply text-xs leading-none;
}

.sidebar-container--collapsed {
  @apply w-16;

  /* Default mark: icon when collapsed; custom branding keeps its own sizing rules */
  .sidebar-logo-container:not(.sidebar-logo-container--custom-branding) .sidebar-logo {
    @apply block;
  }

  .sidebar-logo-name {
    @apply hidden;
  }
}

.sidebar-container--expanded {
  @apply w-[14rem] bg-white border-r border-sand-200;

  /* Wordmark when expanded — scope so custom uploaded logos stay visible */
  .sidebar-logo-container:not(.sidebar-logo-container--custom-branding) {
    @apply justify-center;
  }

  .sidebar-logo-container:not(.sidebar-logo-container--custom-branding) .sidebar-logo {
    @apply hidden;
  }

  /* Drop the collapsed-state nudge so the wordmark centers cleanly */
  .sidebar-logo-name {
    @apply block ml-0;
  }
}

.sidebar-logo-container {
  @apply pb-2 pt-3.5 flex items-center;
}

.sidebar-logo {
  @apply flex-shrink-0 h-[35px] w-auto ml-0.5;
}

/* Default OneStep mark: monochrome in sidebar; do not apply to custom uploads */
.sidebar-logo:not(.sidebar-logo--custom-branding) {
  @apply brightness-0;
}

/* Client portal custom branding: full color, natural aspect ratio */
.sidebar-logo-container--custom-branding {
  @apply flex w-full min-w-0 items-center justify-center;
}

.sidebar-logo-container--custom-branding .sidebar-logo--custom-branding {
  @apply mx-auto h-auto max-h-[3rem] w-auto max-w-[12rem] object-contain object-center transition-all duration-300 ease-in-out;
  filter: none;
}

.sidebar-container--collapsed .sidebar-logo-container {
  @apply min-w-0 justify-center;
}

.sidebar-container--collapsed .sidebar-logo-container:not(.sidebar-logo-container--custom-branding) .sidebar-logo {
  @apply h-8 w-auto max-w-[2.5rem] object-contain object-center;
}

.sidebar-container--collapsed .sidebar-logo-container--custom-branding .sidebar-logo--custom-branding {
  @apply max-h-[2.25rem] max-w-full;
}

.sidebar-container--expanded .sidebar-logo-container--custom-branding .sidebar-logo--custom-branding {
  @apply max-h-[3rem] max-w-[12rem];
}

.sidebar-logo-name {
  @apply font-display text-[31.4px] font-normal text-sand-700 p-0 ml-0.5 tracking-[-0.035em] whitespace-nowrap h-[35px] leading-none;
}

.sidebar-items-container {
  @apply flex flex-col justify-between grow pt-2
}

.sidebar-items-section-container {
  @apply flex flex-col w-full
}

.sidebar-item {
  @apply w-full h-[38px] min-w-[38px] text-sm rounded-[10px] flex items-center whitespace-nowrap no-underline transition-all duration-150 cursor-pointer
}

.sidebar-item-icon {
  @apply text-sm w-10 flex items-center justify-center text-center flex-shrink-0
}

.sidebar-item-label {
  @apply text-sm tracking-tighter
}

.sidebar-container--expanded {
  .sidebar-item:not(.sidebar-item--current) {
    @apply text-sand-600
  }

  .sidebar-item--current {
    @apply text-white
  }

  .sidebar-item--current .sidebar-item-label {
    @apply text-white
  }

  .sidebar-item-label {
    @apply text-sm font-medium
  }
}

.sidebar-container--collapsed {
  .sidebar-item:not(.sidebar-item--current) {
    @apply text-sand-500 rounded-[10px]
  }

  .sidebar-item--current {
    @apply text-white rounded-[10px]
  }

  .sidebar-item-label {
    @apply text-transparent
  }
}

.nav-item {
  @apply flex items-center gap-[10px] px-[14px] py-[9px] rounded-[10px]
         text-sm font-medium text-sand-600 cursor-pointer transition-all duration-150;
}
.nav-item:hover { @apply bg-sand-200 text-sand-700; }
.nav-item.active { @apply text-white; }
.nav-item.active svg { stroke: white !important; }
@tailwind base;
@tailwind components;
@tailwind utilities;

/* legacy */
.tab-active-vertical {
  @apply inline-flex items-center px-4 py-3 text-white rounded-lg w-full bg-blue-700 dark:bg-blue-600;
}

/* legacy */
.tab-inactive-vertical {
  @apply inline-flex items-center px-4 py-3 rounded-lg hover:text-gray-900 hover:bg-gray-100 w-full bg-gray-50;
}

.vertical-tab-active {
  @apply rounded-[10px] px-[14px] py-[9px] text-sm font-semibold text-white;
}

.vertical-tab-active .tab-icon {
  @apply text-white;
}

.vertical-tab-inactive {
  @apply rounded-[10px] px-[14px] py-[9px] text-sm text-sand-600 hover:bg-sand-200 hover:text-sand-700;
}

.horizontal-tab-active {
  @apply text-sm font-medium text-sand-900 border-b-2 border-sand-900 transition-all cursor-pointer block;
}

.horizontal-tab-active a,
.horizontal-tab-inactive a {
  @apply inline-block px-5 py-2.5
}

.horizontal-tab-inactive {
  @apply text-sm font-medium text-sand-500 border-b-2 border-transparent hover:text-sand-700 transition-all cursor-pointer block;
}

.pill-tab-active,
.pill-tab-inactive {
  @apply text-sm font-medium rounded-[10px] border transition-all cursor-pointer block;
}

.pill-tab-active a,
.pill-tab-inactive a {
  @apply inline-block px-5 py-1.5
}

.pill-tab-active {
  @apply bg-status-current-bg text-status-current border-status-current/30;
}

.pill-tab-inactive {
  @apply text-sand-500 border-transparent hover:text-sand-700;
}

.mobile-tabs,
.mobile-segments {
  @apply rounded-xl bg-sand-200 p-1;
}

.mobile-tabs:not(:has(> :not([class~="hidden"]))) {
  display: none;
}

.mobile-tabs > div {
  @apply grow shrink-0 basis-auto whitespace-nowrap text-center text-sm font-medium;
}

.mobile-tabs a {
  @apply block rounded-lg px-4 py-2.5 transition-colors;
}

.mobile-tabs .mobile-tab-active a {
  @apply bg-white text-sand-900 font-semibold shadow-sm;
}

.mobile-tabs .mobile-tab-inactive a {
  @apply text-sand-500 hover:text-sand-700;
}

.mobile-segments > a {
  @apply block grow shrink-0 basis-auto whitespace-nowrap rounded-lg px-4 py-2.5 text-center text-sm font-medium transition-colors;
}

.mobile-segments > a.mobile-parent-tab-active {
  @apply bg-white text-sand-900 font-semibold shadow-sm;
}

.mobile-segments > a.mobile-parent-tab-inactive {
  @apply bg-transparent text-sand-500 hover:bg-transparent hover:text-sand-700;
}

.mobile-bottom-tabs {
  .mobile-bottom-tab-active {
    @apply text-blue-700 border-blue-600 font-semibold;
  }

  .mobile-bottom-tab-inactive {
    @apply font-medium text-gray-700 border-transparent;
  }
}

.mobile-parent-tab-active {
  @apply rounded-[10px] px-[14px] py-[9px] text-sm font-semibold text-white;
}

.mobile-parent-tab-active i {
  @apply text-white;
}
/* Template Main Layout */

.template--layout { @apply p-6 md:p-8 md:pr-24; }

/* Template Edge Cases */
.template--layout .template--layout {
  @apply p-0;
}

.vertical-tabs .horizontal-tabs .template--layout, 
.horizontal-tabs .template--layout
{
  @apply p-0;
}

.vertical-tabs .template--layout .template--layout
{
  @apply p-0;
}
@tailwind base;
@tailwind components;
@tailwind utilities;

.turbo-toast {
  background-color: gray-100;
}

@layer components {
  @media (max-width: 767px) {
    #toast-stack {
      top: calc(1.25rem + env(safe-area-inset-top, 0px));
      bottom: auto;
    }

    .turbo-toast {
      max-width: unset;
    }
  }
}
/*
 * 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.
 *




 *
 * The two pdf_* files hold 2.5 MB of fonts as data: URIs for the PDF layout, which links them itself.
 * Pages get the same fonts from the Google Fonts and Font Awesome links in the document layout.
 */
