/* The native customer wiki editor and its canonical, read-only article view. */
.cw-editor-field,
.cw-host,
.form-grid > :has(.cw-editor),
.form-grid > :has(.customer-wiki-content) {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
.cw-editor {
  --cw-border: #dfe6f2;
  --cw-muted: #7c8ba3;
  --cw-ink: #344860;
  --cw-blue: #375bdb;
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  background: #fff;
  border: 1px solid var(--cw-border);
  border-radius: 9px;
  color: var(--cw-ink);
}
.cw-editor:focus-within {
  border-color: #a4b9ed;
  box-shadow: 0 0 0 3px #375bdb08;
}
.cw-editor [hidden] { display: none !important; }
.cw-toolbar,
.cw-table-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  padding: 9px;
  background: #f7f9fd;
  border-bottom: 1px solid var(--cw-border);
}
.cw-toolbar { border-radius: 8px 8px 0 0; }
.cw-tool-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
  min-width: 0;
  max-width: 100%;
  padding-right: 7px;
  border-right: 1px solid #e0e6f0;
}
.cw-tool-group:last-child { padding-right: 0; border-right: 0; }
.cw-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 32px;
  min-height: 32px;
  max-width: 100%;
  padding: 6px 8px;
  background: #fff;
  border: 1px solid transparent;
  border-radius: 5px;
  color: #64758e;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}
.cw-tool:hover:not(:disabled):not([aria-disabled="true"]) {
  border-color: #d5def0;
  background: #edf2fc;
  color: #365bd2;
}
.cw-tool[aria-pressed="true"],
.cw-tool.is-active {
  border-color: #cad8fb;
  background: #e8efff;
  color: #3158d0;
  box-shadow: inset 0 0 0 1px #d9e4ff;
}
.cw-tool:disabled,
.cw-tool[aria-disabled="true"] {
  opacity: .42;
  cursor: not-allowed;
}
.cw-tool:focus-visible,
.cw-format-select:focus-visible,
.cw-popover input:focus-visible,
.cw-popover select:focus-visible {
  outline: 2px solid #8da7ee;
  outline-offset: 2px;
}
.cw-tool svg,
.cw-tool .icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
.cw-tool[data-cw-command="bold"] { font-weight: 800; }
.cw-tool[data-cw-command="italic"] { font-style: italic; }
.cw-tool[data-cw-command="underline"] { text-decoration: underline; text-underline-offset: 2px; }
.cw-tool[data-cw-command="strikeThrough"] { text-decoration: line-through; }
.cw-format-select {
  width: auto;
  min-width: 110px;
  max-width: 155px;
  min-height: 32px;
  padding: 6px 25px 6px 9px;
  background-color: #fff;
  border: 1px solid #dce4f1;
  border-radius: 5px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  color: #5d708d;
  cursor: pointer;
}
.cw-color {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 32px;
  padding: 2px 6px;
  border: 1px solid #dce4f1;
  border-radius: 5px;
  background: #fff;
  font-size: 10px;
  font-weight: 500;
  color: #6c7f9a;
  white-space: nowrap;
  cursor: pointer;
}
.cw-color input[type="color"] {
  width: 24px;
  height: 25px;
  min-width: 24px;
  padding: 2px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
}
.cw-color:focus-within { outline: 2px solid #8da7ee; outline-offset: 2px; }
.cw-table-controls {
  padding: 7px 9px;
  background: #f0f5ff;
  color: #7a8eaf;
  font-size: 10px;
  line-height: 1.6;
}
.cw-table-controls > span,
.cw-table-controls > strong { margin-right: 5px; font-size: 10px; font-weight: 500; }
.cw-table-controls .cw-tool { min-height: 29px; font-size: 10px; padding: 5px 7px; }
.cw-editable {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 300px;
  max-width: 100%;
  max-height: 55vh;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 23px 25px;
  background: #fff;
  color: var(--cw-ink);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.8;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  outline: none;
  caret-color: #375bdb;
  cursor: text;
}
.cw-editable:focus { box-shadow: inset 0 0 0 1px #375bdb0b; }
.cw-editable:empty::before {
  content: attr(data-placeholder);
  display: block;
  color: #a0aec2;
  pointer-events: none;
}
.cw-editable::selection,
.cw-editable *::selection { background: #dce7ff; }
.cw-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 15px;
  padding: 10px 13px;
  border-top: 1px solid #e8edf5;
  border-radius: 0 0 8px 8px;
  background: #fbfcff;
  font-size: 10px;
  font-weight: 400;
  line-height: 1.6;
  color: #8191aa;
}
.cw-status strong { color: #677fa5; font-weight: 500; }
.cw-status .is-dirty,
.cw-status [data-cw-dirty="true"] { color: #a47f45; }
.cw-help {
  margin: 9px 0 0;
  font-size: 10px;
  font-weight: 400;
  line-height: 1.7;
  color: #90a0b8;
}
.cw-help kbd {
  padding: 1px 4px;
  background: #f2f5fb;
  border: 1px solid #e1e7f2;
  border-bottom-width: 2px;
  border-radius: 3px;
  font: inherit;
  color: #7589a8;
}
.cw-popover {
  position: relative;
  min-width: 0;
  max-width: 100%;
  padding: 15px 17px;
  border-bottom: 1px solid #dfe7f5;
  background: #f8faff;
  color: #6a7f9e;
  font-size: 11px;
}
.cw-popover h3 { margin: 0 0 12px; color: #506989; font-size: 13px; letter-spacing: 0; }
.cw-popover p { margin: 0 0 12px; color: #8799b3; font-size: 10px; line-height: 1.7; }
.cw-dialog-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}
.cw-dialog-fields > label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  font-size: 10px;
  font-weight: 500;
  color: #7187a7;
}
.cw-dialog-fields > .full { grid-column: 1 / -1; }
.cw-popover input,
.cw-popover select {
  width: 100%;
  max-width: 100%;
  padding: 9px 10px;
  border: 1px solid #d9e3f4;
  border-radius: 5px;
  background: #fff;
  font-size: 12px;
  color: #526d91;
}
.cw-popover-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 13px;
}
.cw-popover-actions .cw-tool { min-width: 75px; border-color: #dbe4f4; }
.cw-popover-actions .cw-tool.primary,
.cw-popover-actions [data-cw-apply] { background: #375bdb; border-color: #375bdb; color: #fff; }
.cw-popover .cw-error,
.cw-popover [role="alert"] { color: #b26862; font-size: 11px; line-height: 1.7; margin-top: 10px; }

/* Only HTML explicitly mounted as a wiki article receives rich typography. */
.document-body.customer-wiki-content {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  white-space: normal;
  color: #344860;
  font-size: 14px;
  line-height: 1.8;
}
.customer-wiki-content,
.cw-editable { scrollbar-color: #cad6ec #f6f8fd; scrollbar-width: thin; }
.cw-editable p,
.customer-wiki-content p { color: inherit; font: inherit; margin: 0 0 1em; }
.cw-editable > :first-child,
.customer-wiki-content > :first-child { margin-top: 0; }
.cw-editable > :last-child,
.customer-wiki-content > :last-child { margin-bottom: 0; }
.cw-editable h1,
.cw-editable h2,
.cw-editable h3,
.cw-editable h4,
.customer-wiki-content h1,
.customer-wiki-content h2,
.customer-wiki-content h3,
.customer-wiki-content h4 {
  color: #2c4160;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -.4px;
  margin: 1.4em 0 .55em;
  overflow-wrap: anywhere;
}
.cw-editable h1,
.customer-wiki-content h1 { font-size: 27px; }
.cw-editable h2,
.customer-wiki-content h2 { font-size: 23px; }
.cw-editable h3,
.customer-wiki-content h3 { font-size: 19px; }
.cw-editable h4,
.customer-wiki-content h4 { font-size: 16px; }
.cw-editable ul,
.cw-editable ol,
.customer-wiki-content ul,
.customer-wiki-content ol { margin: .7em 0 1.2em; padding-left: 26px; }
.cw-editable li,
.customer-wiki-content li { margin: .28em 0; padding-left: 2px; line-height: 1.75; }
.cw-editable li > ul,
.cw-editable li > ol,
.customer-wiki-content li > ul,
.customer-wiki-content li > ol { margin: .3em 0 .55em; }
.cw-editable li > p,
.customer-wiki-content li > p { margin-bottom: .35em; }
.cw-editable blockquote,
.customer-wiki-content blockquote {
  margin: 1.2em 0;
  padding: 12px 17px;
  border-left: 3px solid #aec3f2;
  border-radius: 0 6px 6px 0;
  background: #f4f7fd;
  color: #69809f;
}
.cw-editable blockquote > :last-child,
.customer-wiki-content blockquote > :last-child { margin-bottom: 0; }
.cw-editable code,
.customer-wiki-content code {
  padding: 2px 5px;
  background: #f0f3fa;
  border-radius: 4px;
  color: #5b7196;
  font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace;
  font-size: .9em;
}
.cw-editable pre,
.customer-wiki-content pre {
  display: block;
  min-width: 0;
  max-width: 100%;
  margin: 1.1em 0;
  padding: 15px 17px;
  overflow: auto;
  border: 1px solid #e4eaf5;
  border-radius: 7px;
  background: #f5f7fc;
  font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace;
  font-size: 12px;
  line-height: 1.75;
  white-space: pre;
  overflow-wrap: normal;
}
.cw-editable pre code,
.customer-wiki-content pre code { padding: 0; background: transparent; color: inherit; font: inherit; }
.cw-editable a,
.customer-wiki-content a { color: #365ccf; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.cw-editable a:hover,
.customer-wiki-content a:hover { text-decoration-thickness: 2px; }
.cw-editable hr,
.customer-wiki-content hr { margin: 1.6em 0; border: 0; border-top: 1px solid #dfe6f2; }
.cw-table-scroll {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 1.2em 0;
  overflow: auto;
  overscroll-behavior-x: contain;
  border: 1px solid #dfe6f2;
  border-radius: 6px;
  scrollbar-width: thin;
  scrollbar-color: #c5d3ed #f5f7fc;
}
.cw-editable table,
.customer-wiki-content table {
  width: 100%;
  min-width: 420px;
  max-width: none;
  margin: 1.2em 0;
  border-collapse: collapse;
  table-layout: auto;
  font-size: 12px;
  line-height: 1.7;
}
.cw-table-scroll > table { margin: 0; }
.cw-editable th,
.cw-editable td,
.customer-wiki-content th,
.customer-wiki-content td {
  min-width: 75px;
  padding: 10px 12px;
  vertical-align: top;
  border: 1px solid #dfe6f2;
  text-align: left;
  overflow-wrap: anywhere;
}
.cw-editable th,
.customer-wiki-content th { background: #f0f4fc; color: #526e98; font-weight: 650; }
.cw-editable td > :last-child,
.cw-editable th > :last-child,
.customer-wiki-content td > :last-child,
.customer-wiki-content th > :last-child { margin-bottom: 0; }
.cw-editable .cw-active-cell { box-shadow: inset 0 0 0 2px #6e91e8; }
.cw-editable td:empty::after,
.cw-editable th:empty::after { content: '\200b'; }

@media (max-width: 900px) {
  .cw-toolbar { padding: 8px; gap: 5px; }
  .cw-tool-group { padding-right: 5px; }
  .cw-editable { padding: 20px; }
}
@media (max-width: 600px) {
  .cw-toolbar { align-items: flex-start; padding: 7px; gap: 6px 4px; }
  .cw-tool-group { gap: 3px; padding-right: 4px; }
  .cw-tool { min-width: 34px; min-height: 36px; padding: 7px; font-size: 11px; }
  .cw-format-select { min-height: 36px; min-width: 120px; max-width: 155px; font-size: 16px; padding: 6px 22px 6px 7px; }
  .cw-color { min-height: 36px; padding: 3px 5px; }
  .cw-color input[type="color"] { width: 24px; height: 27px; }
  .cw-table-controls { padding: 7px; gap: 5px; }
  .cw-table-controls .cw-tool { min-height: 35px; font-size: 10px; padding: 6px; }
  .cw-editable { min-height: 240px; max-height: 52dvh; padding: 17px 15px; font-size: 16px; line-height: 1.75; }
  .cw-status { padding: 9px 10px; font-size: 9px; gap: 6px; }
  .cw-help { font-size: 9px; }
  .cw-popover { padding: 14px 12px; }
  .cw-dialog-fields { gap: 11px; }
  .cw-dialog-fields > label { font-size: 10px; }
  .cw-popover input,
  .cw-popover select { font-size: 16px; }
  .cw-popover-actions { gap: 7px; }
  .cw-popover-actions .cw-tool { min-height: 38px; font-size: 11px; }
  .document-body.customer-wiki-content { font-size: 14px; line-height: 1.8; }
  .cw-editable h1,
  .customer-wiki-content h1 { font-size: 25px; }
  .cw-editable h2,
  .customer-wiki-content h2 { font-size: 21px; }
  .cw-editable h3,
  .customer-wiki-content h3 { font-size: 18px; }
  .cw-editable ul,
  .cw-editable ol,
  .customer-wiki-content ul,
  .customer-wiki-content ol { padding-left: 23px; }
  .cw-editable pre,
  .customer-wiki-content pre { padding: 12px; font-size: 11px; }
  .cw-editable th,
  .cw-editable td,
  .customer-wiki-content th,
  .customer-wiki-content td { min-width: 80px; padding: 9px 10px; font-size: 12px; }
}
@media (max-height: 600px) and (max-width: 900px) {
  .cw-editable { min-height: 180px; max-height: 45dvh; }
}
