/* Template Guard: document-first workspace, restrained eGRANT blue, consistent controls. */
:root {
  --ink: var(--text);
  --muted: var(--text-secondary);
  --blue: var(--brand);
  --bluehover: var(--brand);
  --line: var(--border);
  --canvas: var(--paper-bg);
  --panel: 340px;
  --control-radius: 5px;
  --surface: var(--white);
}
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.compactheader.appbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 0 22px;
  gap: 14px;
  min-height: 60px;
}
.compactheader .wordmark {
  font-size: 20px;
  font-weight: 600;
  border-right: 1px solid var(--line);
}
.compactheader .documentidentity {
  flex: 0 1 260px;
  min-width: 100px;
  margin-right: 8px;
}
.compactheader .documentidentity #docName {
  font-size: 15px;
  letter-spacing: -0.15px;
}
.compactheader > button,
.compactheader .filemenu > summary {
  min-height: 34px;
  padding: 7px 11px;
  font-size: 12px;
  border-radius: var(--control-radius);
  font-weight: 500;
}
.compactheader .primary {
  padding: 9px 15px;
  background: var(--blue);
  border: 1px solid var(--blue);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 6%, transparent);
}
.compactheader .primary:hover {
  background: var(--bluehover);
}
.compactheader #insertTab {
  color: var(--brand);
}
.compactheader #navReport {
  color: var(--muted);
}
.compactheader #sideCount {
  font-size: 10px;
  border-radius: 4px;
  padding: 2px 5px;
  background: var(--canvas);
  color: var(--finding-text);
}
.compactheader #sideCount.zero {
  background: var(--canvas);
  color: var(--brand);
}
.formatbar.edittools {
  display: block;
  padding: 0;
  height: auto;
  min-height: 0;
  overflow: visible;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.texttoolrow,
.documenttoolrow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 22px;
  min-height: 48px;
}
.documenttoolrow {
  background: var(--canvas);
  border-top: 1px solid var(--canvas);
  min-height: 40px;
  padding-top: 3px;
  padding-bottom: 3px;
  gap: 8px;
}
.edittools .toolcluster {
  gap: 4px;
  flex: none;
}
.edittools .toolcluster + .toolcluster {
  padding-left: 12px;
  border-left: 1px solid var(--line);
}
.edittools .settingscluster {
  gap: 3px;
  border: 0;
  padding: 0;
  flex-wrap: wrap;
}
.edittools .settingscluster button {
  font-size: 12px;
  color: var(--muted);
  min-height: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--control-radius);
}
.edittools .settingscluster button:hover:not(:disabled) {
  background: var(--canvas);
  color: var(--brand);
}
.edittools .emphasiscluster {
  gap: 5px;
}
.edittools .emphasiscluster button[id^='format-'] {
  width: 36px;
  height: 34px;
  border-radius: var(--control-radius);
}
.edittools .fontcluster .selectcontrol {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  height: 34px;
  min-height: 34px;
  font-size: 12px;
}
.edittools .fontcluster .selectcontrol:hover:not(:disabled) {
  border-color: var(--line);
  background: var(--surface);
}
.edittools button[aria-pressed='true'] {
  background: var(--canvas);
  color: var(--brand);
}
.edittools .alignmenttools {
  gap: 2px;
}
.edittools .paragraphcluster button svg {
  width: 17px;
  height: 17px;
}
.documenttoolrow .headerfill {
  flex: 1;
  min-width: 0;
}
.documenttoolrow .formconnection {
  max-width: 220px;
  color: var(--muted);
  font-size: 11px;
  min-height: 30px;
  padding: 3px 8px;
}
.documenttoolrow .formconnection svg {
  color: var(--muted);
}
.pageworkbench {
  background: var(--canvas);
}
.paperscroll {
  padding-top: 28px;
  padding-bottom: 50px;
}
.documentpage {
  border-color: var(--line);
  box-shadow: 0 3px 14px color-mix(in srgb, var(--ink) 6%, transparent);
  margin-bottom: 26px;
}
.canvasfooter {
  background: var(--canvas);
  border-top: 1px solid var(--line);
  color: var(--muted);
  min-height: 34px;
  padding: 4px 18px;
}
.inspector {
  background: var(--surface);
  border-left: 1px solid var(--line);
}
.panelheader {
  border-bottom: 1px solid var(--canvas);
  min-height: 54px;
  padding: 0 16px 0 22px;
}
.panelheader h2 {
  font-size: 14px;
  letter-spacing: -0.15px;
  color: var(--brand);
}
.panelheader .iconbutton {
  width: 32px;
  height: 32px;
  border-radius: 5px;
}
.field {
  padding: 12px 9px;
  border-radius: 5px;
  gap: 12px;
}
.field:hover:not(:disabled) {
  background: var(--canvas);
}
.field > span:nth-child(2) {
  font-size: 13px;
  color: var(--brand);
}
.field small {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}
.field .typeicon {
  color: var(--muted);
}
.field .plus {
  color: var(--muted);
}
.fieldsection {
  font-size: 11px;
  font-weight: 600;
  margin: 22px 9px 8px;
}
.search {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}
.search input {
  font-size: 12px;
}
.insertchoices {
  gap: 4px;
  border-color: var(--canvas);
}
.insertchoices button {
  font-size: 11px;
  color: var(--muted);
  min-height: 52px;
  border-radius: 5px;
}
.insertchoices button:hover {
  background: var(--canvas);
}
.issue {
  border-radius: 0;
  box-shadow: none;
}
.issuegroup > h2 {
  font-size: 12px;
}
.issueactions .action {
  color: var(--brand);
}
.checkoverview {
  border-color: var(--canvas);
}
.checkoverview strong {
  font-size: 13px;
  font-weight: 600;
}
.menupopup,
.selectpopup,
.colorpopover {
  border-color: var(--line);
  border-radius: 7px;
  box-shadow: 0 8px 28px color-mix(in srgb, var(--ink) 10%, transparent);
}
.selectoption {
  border-radius: 4px;
  min-height: 38px;
}
.selectoption[aria-selected='true'] {
  background: var(--canvas);
  color: var(--brand);
}
.selectoption:hover {
  background: var(--canvas);
}
button {
  border-radius: var(--control-radius);
}
button:hover:not(:disabled) {
  transition:
    background 0.12s ease,
    color 0.12s ease;
}
button:disabled {
  opacity: 0.4;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 18px 64px color-mix(in srgb, var(--ink) 20%, transparent);
}
dialog::backdrop {
  background: color-mix(in srgb, var(--ink) 28%, transparent);
  backdrop-filter: blur(2px);
}
dialog h2 {
  font-size: 21px;
  letter-spacing: -0.5px;
  color: var(--brand);
}
.modalactions {
  border-top: 1px solid var(--canvas);
}
.modalactions button {
  min-height: 40px;
  border-radius: 5px;
}
#pageNavigator {
  border-color: var(--line);
}
.pagethumbnail[aria-current='page'] {
  background: var(--canvas);
  border-color: var(--muted);
}
.thumbnailviewport {
  border-color: var(--line);
}
.templategroupname {
  color: var(--brand);
}
.templatepaper {
  border-color: var(--line);
  border-radius: 5px;
  box-shadow: 0 2px 6px color-mix(in srgb, var(--ink) 6%, transparent);
}
.templatecardfooter strong {
  color: var(--brand);
}
.templatecardfooter button {
  color: var(--brand);
}
@media (max-width: 1100px) {
  .compactheader.appbar {
    padding-left: 14px;
    padding-right: 14px;
    gap: 7px;
  }
  .texttoolrow {
    gap: 7px;
    padding-left: 14px;
    padding-right: 14px;
    flex-wrap: wrap;
  }
  .texttoolrow .toolcluster + .toolcluster {
    padding-left: 8px;
  }
  .documenttoolrow {
    padding-left: 14px;
    padding-right: 14px;
    flex-wrap: wrap;
  }
  .documenttoolrow .formconnection {
    max-width: 170px;
  }
  .compactheader .documentidentity {
    max-width: 190px;
  }
}
@media (max-width: 760px) {
  .compactheader.appbar {
    padding: 8px 12px;
    gap: 5px;
    min-height: 0;
  }
  .compactheader .wordmark {
    font-size: 18px;
    padding-right: 12px;
  }
  .compactheader .documentidentity {
    max-width: none;
    min-width: 0;
  }
  .compactheader > button,
  .compactheader .filemenu > summary {
    min-height: 38px;
  }
  .formatbar.edittools {
    max-height: 212px;
    overflow-y: auto;
    overflow-x: hidden;
  }
  .texttoolrow {
    padding: 7px 8px;
    gap: 6px;
    flex-wrap: wrap;
    min-height: 0;
  }
  .documenttoolrow {
    padding: 4px 8px;
    gap: 4px;
    flex-wrap: wrap;
    min-height: 0;
  }
  .texttoolrow .toolcluster + .toolcluster {
    padding-left: 0;
    border: 0;
  }
  .edittools .fontcluster {
    width: 100%;
    order: -1;
    gap: 6px;
  }
  .edittools .fontcluster .selectcontrol {
    min-height: 40px;
    height: 40px;
  }
  .edittools .emphasiscluster button[id^='format-'] {
    width: 38px;
    min-width: 38px;
    height: 40px;
    min-height: 40px;
  }
  .edittools .historycluster button,
  .edittools .paragraphcluster button {
    height: 40px;
    min-height: 40px;
  }
  .edittools .settingscluster {
    width: 100%;
    gap: 2px;
    display: flex;
  }
  .edittools .settingscluster button {
    min-height: 40px;
    height: 40px;
    padding: 0 8px;
    font-size: 11px;
  }
  .documenttoolrow .formconnection,
  .documenttoolrow .headerfill {
    display: none;
  }
  .canvasfooter {
    padding: 4px 10px;
  }
  .panelheader {
    min-height: 54px;
  }
  .field {
    min-height: 54px;
  }
  .field small {
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  button {
    transition: none;
  }
  dialog::backdrop {
    backdrop-filter: none;
  }
}
/* One insertion picker: search, choose, continue writing. */
#insertPopover {
  position: fixed;
  z-index: 24;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 12px 36px color-mix(in srgb, var(--ink) 15%, transparent);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 8px;
  box-sizing: border-box;
}
#insertPopover[hidden] {
  display: none;
}
#insertPopover .insertpicker {
  overflow: visible;
  padding: 0;
}
#insertPopover .insertsearchrow {
  display: flex;
  align-items: center;
  gap: 4px;
  position: sticky;
  top: -8px;
  background: var(--surface);
  padding: 2px 0 7px;
  z-index: 1;
}
#insertPopover .search {
  flex: 1;
  min-width: 0;
  margin: 0;
  border: 0;
  background: var(--canvas);
  min-height: 38px;
  padding: 0 10px;
  border-radius: 5px;
}
#insertPopover .search input {
  width: 100%;
  font-size: 12px;
  padding: 10px 0;
}
#closeInsert {
  width: 30px;
  min-width: 30px;
  height: 36px;
  padding: 0;
  font-size: 21px;
  color: var(--muted);
}
#insertPopover .field {
  min-height: 48px;
  padding: 8px 10px;
  border-radius: 5px;
  gap: 10px;
}
#insertPopover .field small {
  font-size: 11px;
  max-width: 260px;
  color: var(--muted);
  margin-top: 1px;
}
#insertPopover .field .plus {
  display: none;
}
#insertPopover .field .typeicon {
  width: 20px;
}
#insertPopover .insertchoices {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 5px 0 0;
  padding: 5px 0 0;
  border: 0;
  border-top: 1px solid var(--canvas);
}
#insertPopover .insertchoices button {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  text-align: left;
  width: 100%;
  min-height: 38px;
  font-size: 12px;
  padding: 7px 10px;
  color: var(--muted);
}
#insertPopover .insertchoices button[hidden] {
  display: none;
}
#insertPopover .insertchoices svg {
  width: 18px;
  height: 18px;
}
#insertPopover .empty {
  padding: 10px;
  font-size: 12px;
}
@media (max-width: 760px) {
  #insertPopover {
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 -5px 35px color-mix(in srgb, var(--ink) 16%, transparent);
  }
  #insertPopover .field {
    min-height: 52px;
  }
  #insertPopover .search input {
    font-size: 16px;
  }
  #insertPopover .insertchoices button {
    min-height: 44px;
  }
}
/* Page navigation uses paper silhouettes, without enclosing cards. */
#pageNavigator {
  width: 148px;
  padding: 12px 15px;
  background: var(--canvas);
}
.pagenavheading {
  margin-bottom: 18px;
  font-size: 11px;
  color: var(--muted);
}
.pagenavheading strong {
  font-weight: 500;
}
#pageThumbnails .pagethumbnail {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin: 0 0 21px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
#pageThumbnails .pagethumbnail:hover,
#pageThumbnails .pagethumbnail[aria-current='page'] {
  border: 0;
  background: transparent;
  box-shadow: none;
}
#pageThumbnails .thumbnailviewport {
  width: 112px;
  border: 0;
  border-radius: 0;
  box-shadow:
    0 1px 3px color-mix(in srgb, var(--ink) 9%, transparent),
    0 0 0 1px color-mix(in srgb, var(--ink) 30%, transparent);
  transition: box-shadow 0.12s ease;
  overflow: hidden;
}
#pageThumbnails .pagethumbnail:hover .thumbnailviewport {
  box-shadow:
    0 2px 6px color-mix(in srgb, var(--ink) 14%, transparent),
    0 0 0 1px var(--muted);
}
#pageThumbnails .pagethumbnail[aria-current='page']::before {
  position: absolute;
  left: -10px;
  top: 0;
  bottom: 24px;
  width: 2px;
  border-radius: 1px;
  background: var(--brand);
}
#pageThumbnails .thumbnumber {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  padding-top: 8px;
}
#pageThumbnails .pagethumbnail[aria-current='page'] .thumbnumber {
  font-weight: 600;
}
#pageThumbnails .pagethumbnail:focus-visible {
  outline: 0;
}
#pageThumbnails .pagethumbnail:focus-visible .thumbnailviewport {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  #pageThumbnails .thumbnailviewport {
    transition: none;
  }
}

.compactheader .documentidentity {
  border-left: 0;
  padding-left: 0;
}

/* Editing must never animate toward the temporary unpaginated DOM. */
.paperscroll {
  scroll-behavior: auto;
  overflow-anchor: none;
}

.tableappearances {
  display: flex;
  gap: 12px;
  margin: 16px 0 20px;
}
.tableappearances button {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  padding: 9px 6px;
  border-radius: 4px;
  border-bottom: 2px solid transparent;
  font-size: 11px;
  line-height: 1.4;
  text-align: left;
}
.tableappearances button[aria-pressed='true'] {
  border-bottom-color: var(--brand);
  background: var(--canvas);
  color: var(--brand);
}
.tablelookmini {
  display: grid;
  grid-template-columns: repeat(3, 9px);
  grid-template-rows: repeat(3, 7px);
  flex: none;
}
.tablelookmini i {
  margin: -0.5px;
}
.tablelookmini.lines i {
  border-left: 0;
  border-right: 0;
}
.tablelookmini.clean i {
  margin: 1px;
  background: var(--line);
}
.tablelookmini.clean i:nth-child(-n + 3) {
  background: var(--muted);
}
.paper table.look-grid td,
#tablePreview table.look-grid th,
#tablePreview table.look-grid td {
  border: 1px solid var(--line);
}
.paper table.look-grid tr:first-child td,
#tablePreview table.look-grid th {
  background: var(--canvas);
}
.paper table.look-lines td,
#tablePreview table.look-lines th,
#tablePreview table.look-lines td {
  border: 0;
  border-bottom: 1px solid var(--line);
}
.paper table.look-lines tr:first-child td,
#tablePreview table.look-lines th {
  background: var(--canvas);
}
.paper table.look-clean td,
#tablePreview table.look-clean th,
#tablePreview table.look-clean td {
  border: 0;
  background: var(--surface);
}
.paper table.look-clean tr:first-child td,
#tablePreview table.look-clean th {
  font-weight: 600;
}
.paper table.look-lines,
.paper table.look-clean,
#tablePreview table.look-lines,
#tablePreview table.look-clean {
  border: 0;
}
@media (max-width: 480px) {
  .tableappearances {
    gap: 4px;
  }
  .tableappearances button {
    flex-direction: column;
    align-items: flex-start;
    font-size: 10px;
    padding: 8px 5px;
  }
}

#tableColumns.activecolumncontrols {
  margin: 8px 0 4px;
}
#tableColumns .columnedit[hidden] {
  display: none !important;
}
#tableColumns .columnedit {
  display: grid;
  grid-template-columns: 20px minmax(60px, 1fr) 110px 30px 30px;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--canvas);
  margin: 0;
}
#tableColumns .columneditname {
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
#tableColumns .selectcontrol {
  min-height: 32px;
  height: 32px;
  font-size: 11px;
  padding: 4px 7px;
}
#tableColumns .columnedit button[data-move] {
  width: 30px;
  min-height: 30px;
  padding: 4px;
}
#tablePreview .selectedtablecolumn {
  box-shadow: inset 0 -2px var(--brand);
}
#tablePreview .tableheadinput {
  outline-offset: -2px;
}
#toggleTableColumns {
  font-size: 11px;
  color: var(--muted);
}
@media (max-width: 480px) {
  #tableColumns .columnedit {
    grid-template-columns: 16px minmax(40px, 1fr) 90px 28px 28px;
    gap: 4px;
  }
  #tableColumns .columnedit .selectcontrol {
    grid-column: auto;
    min-width: 0;
    width: 90px;
    min-height: 38px;
    height: 38px;
  }
}

/* Drafts: readable document list, distinct continue and remove actions. */

/* eGrant Studio — application chrome only; document fonts and colors stay intact. */
:root {
  --ink: var(--text);
  --muted: var(--text-secondary);
  --blue: var(--brand);
  --bluehover: var(--ink);
  --line: var(--border);
  --canvas: var(--paper-bg);
}
.compactheader .wordmark {
  color: var(--brand);
  letter-spacing: -0.5px;
  white-space: nowrap;
}
.compactheader #insertTab,
.issueactions .action {
  color: var(--blue);
}
.edittools button[aria-pressed='true'],
.selectoption[aria-selected='true'] {
  background: var(--canvas);
  color: var(--ink);
}
.edittools .settingscluster button:hover:not(:disabled),
.field:hover:not(:disabled),
.selectoption:hover {
  background: var(--canvas);
  color: var(--ink);
}
.documenttoolrow,
.canvasfooter {
  background: var(--canvas);
}
.fieldsection {
  color: var(--muted);
}
.previewapplications {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  flex-wrap: wrap;
}
.previewapplications[hidden] {
  display: none;
}
.previewapplications label {
  font-weight: 600;
  margin: 0;
}
.previewapplications select,
.previewapplications .selectcontrol {
  min-width: 240px;
  max-width: 100%;
  font-size: 12px;
}
.previewapplications > span {
  color: var(--muted);
  font-size: 11px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}
@media (max-width: 700px) {
  .previewapplications {
    padding: 9px 12px;
    gap: 8px;
  }
  .previewapplications select,
  .previewapplications .selectcontrol {
    min-width: 180px;
  }
  .previewapplications > span {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
.paper .chip:not(.invalid):not(.condition) {
  color: var(--brand);
  background: color-mix(in srgb, var(--ink) 50%, transparent);
  border-color: var(--line);
}
.paper .chip:not(.invalid):hover {
  background: var(--canvas);
}
.outlineitem[data-level='2'] {
  padding-left: 24px;
}
.outlineitem[data-level='3'] {
  padding-left: 36px;
  font-size: 12px;
}
.compactheader #saveState {
  font-size: 10px;
  color: var(--muted);
  font-weight: 400;
  margin-top: 3px;
}
.paper h1.docheading {
  text-align: left;
}
.paper h3.docheading {
  line-height: 1.35;
  margin-top: 16pt;
  margin-bottom: 6pt;
}
.field:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
.field:disabled .plus {
  visibility: hidden;
}
/* Grid min-content must not silently widen and clip the entire workspace. */
body {
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  min-width: 0;
}
.appbar,
.formatbar,
.workspace {
  min-width: 0;
  max-width: 100%;
}
.texttoolrow {
  flex-wrap: wrap;
}
@media (min-width: 761px) and (max-width: 1150px) {
  .compactheader.appbar {
    flex-wrap: wrap;
    gap: 6px 10px;
    padding: 10px 16px;
  }
  .compactheader .documentidentity {
    flex: 1;
    max-width: none;
    min-width: 0;
  }
  .compactheader .wordmark {
    flex: none;
  }
  .compactheader .headerfill {
    display: none;
  }
  .compactheader::after {
    content: '';
    flex-basis: 100%;
    height: 0;
    order: 1;
  }
  .compactheader > #insertTab,
  .compactheader > #addTable,
  .compactheader > #navReport,
  .compactheader > #togglePreview,
  .compactheader > #editMode,
  .compactheader > #export {
    order: 2;
  }
  .compactheader > #navReport {
    margin-left: auto;
  }
  .texttoolrow,
  .documenttoolrow {
    padding-left: 16px;
    padding-right: 16px;
    gap: 6px;
  }
  .edittools .toolcluster + .toolcluster {
    padding-left: 6px;
  }
}
/* Quiet control states: pointer interaction has no focus halo. */
:root[data-input-mode='pointer'] :is(button, a, summary, [tabindex]):focus {
  outline: none !important;
  box-shadow: none;
}
:root[data-input-mode='keyboard'] :is(button, a, summary, [tabindex]):focus-visible {
  outline: 1px solid var(--muted) !important;
  outline-offset: 2px;
  box-shadow: none;
}
:is(input, textarea, select):focus-visible {
  outline: 1px solid var(--muted);
  outline-offset: 0;
  box-shadow: none;
}
.search:focus-within {
  border-color: var(--muted);
  box-shadow: none;
}
.field:hover:not(:disabled),
.selectoption:hover,
.selectoption[aria-selected='true'] {
  background: var(--canvas);
  color: var(--ink);
}
.selectcontrol:focus-visible {
  outline-color: var(--muted) !important;
  box-shadow: none;
}
#modal .close:hover,
#closeInsert:hover,
#closePanel:hover {
  background: var(--canvas);
  color: var(--muted);
}
/* Device layouts: short tools on phones, compact rows on tablets. */
#mobileFormatting,
.exportshort {
  display: none;
}
@media (min-width: 761px) and (max-width: 1150px) {
  .texttoolrow {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
    min-height: 48px;
    gap: 6px;
  }
  .documenttoolrow {
    flex-wrap: nowrap;
    overflow-x: auto;
    min-height: 42px;
  }
  .documenttoolrow .settingscluster {
    flex-wrap: nowrap;
  }
  .edittools .toolcluster {
    flex-shrink: 0;
  }
  .edittools .fontcluster {
    width: auto;
    order: 0;
  }
  .compactheader.appbar {
    height: auto !important;
    min-height: 0;
    padding: 7px 14px;
    gap: 4px 8px;
  }
  .compactheader > button,
  .compactheader .filemenu > summary {
    min-height: 40px;
  }
  #pageNavigator {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 6;
    box-shadow: 4px 0 18px color-mix(in srgb, var(--ink) 8%, transparent);
  }
  .pageworkbench {
    position: relative;
  }
}
@media (max-width: 760px) {
  .compactheader.appbar {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-template-rows: 48px 44px;
    gap: 2px 4px;
    padding: 4px 10px 6px;
    height: auto;
    min-height: 0;
  }
  .compactheader.appbar::after {
    display: none;
  }
  .compactheader .wordmark {
    grid-column: 1;
    grid-row: 1;
    font-size: 16px;
    border: 0;
    padding: 0;
    letter-spacing: -0.6px;
    gap: 0;
  }
  .compactheader .documentidentity {
    grid-column: 2/5;
    grid-row: 1;
    padding: 0 6px;
    min-width: 0;
    max-width: none;
    margin: 0;
  }
  .compactheader .documentidentity #docName {
    font-size: 12px;
    line-height: 1.35;
    max-width: 100%;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal;
    overflow: hidden;
  }
  .compactheader .filemenu {
    grid-column: 5;
    grid-row: 1;
  }
  .compactheader .filemenu > summary {
    font-size: 11px;
    justify-content: flex-end;
    padding: 0;
    min-height: 44px;
  }
  .compactheader > button {
    padding: 5px 2px !important;
    min-height: 44px;
    font-size: 11px !important;
    white-space: nowrap;
    gap: 3px;
  }
  .exportfull {
    display: none;
  }
  .exportshort {
    display: inline;
  }
  .compactheader #navReport {
    margin: 0;
  }
  .compactheader .headerfill {
    display: none;
  }
  .formatbar.edittools {
    max-height: 40dvh;
    overflow-y: auto;
    overflow-x: hidden;
  }
  .texttoolrow {
    display: flex;
    flex-wrap: wrap;
    padding: 4px 10px;
    gap: 5px;
    min-height: 48px;
  }
  .texttoolrow .historycluster {
    order: 0;
  }
  .texttoolrow .emphasiscluster {
    order: 1;
  }
  .texttoolrow #mobileFormatting {
    order: 2;
    display: inline-flex;
    flex: 1;
    justify-content: flex-end;
    font-size: 12px;
    width: auto;
    min-width: 90px;
    padding: 0 4px;
    color: var(--muted);
  }
  .texttoolrow .fontcluster,
  .texttoolrow .colorcluster,
  .texttoolrow .paragraphcluster,
  .documenttoolrow {
    display: none;
  }
  .formatting-expanded .texttoolrow .fontcluster {
    display: flex;
    order: 3;
    width: 100%;
    gap: 5px;
  }
  .formatting-expanded .fontcluster .selectcontrol {
    min-width: 0 !important;
    flex: 1;
    width: auto !important;
    font-size: 12px;
  }
  .formatting-expanded .texttoolrow .colorcluster {
    display: flex;
    order: 4;
  }
  .formatting-expanded .texttoolrow .paragraphcluster {
    display: flex;
    order: 5;
  }
  .formatting-expanded .documenttoolrow {
    display: flex;
    flex-wrap: wrap;
    padding: 4px 10px;
  }
  .formatting-expanded .documenttoolrow .settingscluster {
    flex-wrap: wrap;
    width: 100%;
    gap: 4px;
  }
  .edittools .emphasiscluster button[id^='format-'],
  .edittools .historycluster button {
    width: 38px;
    min-width: 38px;
    height: 40px;
    min-height: 40px;
  }
  .paperscroll {
    padding: 0 0 24px;
  }
  .paper {
    border: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
  }
  .documentpage {
    border: 0 !important;
    box-shadow: none !important;
    margin-bottom: 8px;
    background: var(--surface);
  }
  .mobile-flow .documentpage {
    min-height: 0 !important;
  }
  .mobile-flow .pagelabel,
  .mobile-flow .pagefurniture {
    display: none !important;
  }
  .mobile-flow #togglePages,
  .mobile-flow #pageStatus,
  .mobile-flow .zoomcontrol {
    display: none !important;
  }
  .mobile-flow .canvasfooter {
    min-height: 30px;
    padding: 3px 12px;
  }
  .mobile-flow .pageworkbench {
    background: var(--surface);
  }
  .mobile-flow .paper .chip {
    font-size: 13px;
    line-height: 1.8;
  }
  .mobile-flow .paper h1 {
    line-height: 1.3;
  }
  .mobile-flow .doctable {
    overflow-x: auto;
  }
  .mobile-flow .doctable table {
    min-width: 380px;
  }
  .inspector {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    z-index: 60;
    box-shadow: none;
  }
  .panelheader {
    position: sticky;
    top: 0;
    background: var(--surface);
  }
  .inspectorview {
    overflow-y: auto;
  }
  dialog,
  dialog.tabledialog,
  dialog.conditiondialog,
  dialog.librarydialog,
  dialog.draftsdialog {
    position: fixed;
    inset: auto 0 0;
    margin: 0;
    width: 100%;
    max-width: 100%;
    max-height: 90dvh;
    padding: 24px 18px 12px;
    border-radius: 14px 14px 0 0;
    border: 0;
    border-top: 1px solid var(--line);
  }
  .modalactions {
    bottom: -12px;
    padding: 12px 0 max(8px, env(safe-area-inset-bottom));
    gap: 8px;
  }
  .modalactions button {
    flex: 1;
    min-height: 46px;
  }
  .previewapplications {
    gap: 6px;
    padding: 8px 12px;
  }
  .previewapplications label {
    font-size: 11px;
  }
  .previewapplications .selectcontrol {
    min-width: 0;
    width: 100%;
    flex: 1;
    font-size: 12px;
  }
  .previewnotice {
    padding: 7px 12px;
    font-size: 10px;
  }
  .phone-viewer #insertPopover {
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    border-radius: 14px 14px 0 0;
    max-height: 65dvh !important;
    padding: 12px 12px max(12px, env(safe-area-inset-bottom));
  }
}
.tablepreviewnote {
  font:
    12px/1.5 -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Arial,
    sans-serif !important;
  color: var(--muted);
  margin: 8px 0 14px !important;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
#fieldPopover {
  position: fixed;
  z-index: 40;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 8px 30px color-mix(in srgb, var(--ink) 13%, transparent);
  padding: 14px;
  overflow: auto;
  overscroll-behavior: contain;
  box-sizing: border-box;
}
#fieldPopover[hidden] {
  display: none;
}
.fieldpopheading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.fieldpopheading strong {
  font-size: 13px;
  color: var(--ink);
}
.fieldpopheading button {
  padding: 0;
  width: 30px;
  height: 30px;
  font-size: 21px;
  color: var(--muted);
}
.fieldpopvalue {
  font-size: 15px;
  line-height: 1.5;
  padding: 10px 0 14px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.fieldpopactions {
  display: flex;
  gap: 8px;
  border-top: 1px solid var(--canvas);
  padding-top: 9px;
}
.fieldpopactions button {
  min-height: 36px;
  font-size: 12px;
  padding: 6px 10px;
}
.fieldpopactions [data-field-delete] {
  margin-left: auto;
  color: var(--finding-text);
}
.fieldpopformats {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding-bottom: 12px;
}
.fieldpopformats button {
  font-size: 11px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.fieldpopformats button[aria-pressed='true'] {
  background: var(--canvas);
  border-color: var(--line);
  color: var(--brand);
}
.fieldpopsearch {
  width: 100%;
  font-size: 13px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  margin: 10px 0;
}
.fieldpopresults {
  max-height: 220px;
  overflow: auto;
}
.fieldpopresults button {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  font-size: 12px;
  min-height: 38px;
}
.fieldpopresults p {
  font-size: 12px;
  color: var(--muted);
}
.fieldpopback {
  font-size: 12px;
  margin-top: 8px;
}
.fieldpopreplacement {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  line-height: 1.5;
  padding-top: 12px;
}
.fieldpopreplacement > span {
  color: var(--muted);
}
@media (max-width: 600px) {
  #fieldPopover {
    border-radius: 14px 14px 0 0;
    padding: 18px 18px max(18px, env(safe-area-inset-bottom));
    border-bottom: 0;
  }
  .fieldpopheading button,
  .fieldpopactions button,
  .fieldpopformats button,
  .fieldpopresults button {
    min-height: 44px;
  }
  .fieldpopsearch {
    font-size: 16px;
    min-height: 44px;
  }
}
/* One editing row; page settings belong with the document, not each keystroke. */
.documenttoolrow[hidden] {
  display: none !important;
}
.menupopup .formconnection {
  display: flex;
  justify-content: flex-start;
  width: 100%;
  max-width: none;
  min-height: 38px;
  font-size: 12px;
  color: var(--muted);
}
.menupopup .formconnection svg {
  margin-left: auto;
}
.texttoolrow > #paragraphSettings {
  font-size: 12px;
  padding: 0 10px;
  min-height: 34px;
  width: auto;
  flex: none;
}
@media (max-width: 760px) {
  .texttoolrow > #paragraphSettings {
    display: none;
  }
  .formatting-expanded .texttoolrow > #paragraphSettings {
    display: inline-flex;
    order: 6;
    min-height: 44px;
  }
  .menupopup .formconnection {
    display: flex !important;
  }
}

/* Four task-oriented groups; the document remains the main workspace. */
.workspaceMenus {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: none;
  min-width: 0;
}
.workspaceMenus > button,
.workspaceMenus summary {
  min-height: 38px;
  padding: 8px 10px;
  font-size: 12px;
  white-space: nowrap;
}
.workspaceMenus .menupopup {
  max-height: min(70vh, 650px);
  overflow-y: auto;
  min-width: 230px;
}
.workspaceMenus .filemenu {
  position: relative;
}
.insertchoices {
  flex-wrap: wrap;
}
.insertchoices #conditionParagraph,
.insertchoices #reuseParagraph {
  font-size: 12px;
}
@media (min-width: 761px) and (max-width: 1150px) {
  .compactheader .workspaceMenus {
    order: 2;
    flex: 1;
  }
  .compactheader .workspaceMenus #insertTab {
    order: initial;
  }
}
@media (max-width: 760px) {
  .compactheader {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: auto auto auto;
    height: auto;
    gap: 4px;
    padding: 8px 12px;
  }
  .compactheader .wordmark {
    grid-column: 1;
    grid-row: 1;
  }
  .compactheader .documentidentity {
    grid-column: 2/4;
    grid-row: 1;
    min-width: 0;
  }
  .compactheader .workspaceMenus {
    grid-column: 1/4;
    grid-row: 2;
    display: flex;
    justify-content: space-between;
    width: 100%;
  }
  .compactheader .workspaceMenus .filemenu,
  .compactheader .workspaceMenus #insertTab {
    grid-column: auto;
    grid-row: auto;
    min-width: 0;
    width: auto;
    display: block;
  }
  .compactheader .workspaceMenus > button,
  .compactheader .workspaceMenus summary {
    min-height: 44px;
    padding: 8px;
    font-size: 12px;
  }
  .compactheader #navReport {
    grid-column: 1;
    grid-row: 3;
  }
  .compactheader #togglePreview,
  .compactheader #editMode {
    grid-column: 2;
    grid-row: 3;
  }
  .compactheader #export {
    grid-column: 3;
    grid-row: 3;
  }
  .workspaceMenus #displayMenu .menupopup,
  .workspaceMenus #layoutMenu .menupopup {
    left: auto;
    right: 0;
  }
}

/* Document library: a full workspace, never a dialog over the editor. */
.home-open > .appbar,
.home-open > .formatbar,
.home-open > .workspace {
  display: none !important;
}
#workspaceHome[hidden] {
  display: none !important;
}
#workspaceHome {
  position: fixed;
  inset: 0;
  overflow: auto;
  background: var(--canvas);
  color: var(--ink);
  z-index: 15;
}
.homebar {
  height: 76px;
  padding: 0 5vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.homebrand {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -1px;
}
.homebrand span {
  font-size: 15px;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--muted);
  margin-left: 8px;
}
.homebar > div {
  display: flex;
}
.homebar button {
  font-size: 13px;
}
.homemain {
  max-width: 1160px;
  padding: 42px 32px 70px;
  margin: auto;
}
.homeheading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 25px;
}
.homeheading h1 {
  font-size: 27px;
  letter-spacing: -0.6px;
  margin: 0;
  font-weight: 600;
  outline: none;
}
.homesearch {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
}
.homesearch svg {
  width: 17px;
  height: 17px;
  flex: none;
  color: var(--muted);
}
.homesearch input {
  border: 0;
  background: transparent;
  min-width: 0;
  width: 100%;
  outline: none;
}
.hometabs {
  display: flex;
  border-bottom: 1px solid var(--line);
}
.hometabs button {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}
.hometabs button[aria-current='page'] {
  border-bottom-color: var(--brand);
  color: var(--brand);
  font-weight: 600;
}
.homeitems {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.homedocicon {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 11px;
  display: flex;
}
.homedocicon svg {
  width: 24px;
  height: 29px;
  color: var(--muted);
}
.homedocname {
  display: flex;
  flex: 1;
  min-width: 0;
  gap: 7px;
  flex-direction: column;
}
.homedocname strong {
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.homedocname small,
.hometemplate small {
  font-size: 12px;
  color: var(--muted);
}
.homegrid {
  display: grid;
  gap: 26px;
}
.hometemplate {
  display: flex;
  align-items: stretch;
  flex-direction: column;
  text-align: left;
  min-width: 0;
}
.hometemplate strong {
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.homepaper {
  background: var(--surface);
  overflow: hidden;
  border: 1px solid var(--line);
  padding: 16px;
  box-shadow: 0 2px 5px color-mix(in srgb, var(--ink) 3%, transparent);
  pointer-events: none;
}
.hometemplate:hover .homepaper {
  border-color: var(--brand);
}
.homepaper > .templatemini {
  width: 630px;
  transform: scale(0.3);
  transform-origin: top left;
  color: var(--ink);
}
.homepaper > span {
  font-size: 12px;
  color: var(--muted);
}
.homeempty {
  font-size: 14px;
}
#workspaceHome button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}
@media (max-width: 600px) {
  .homebar {
    height: auto;
    min-height: 74px;
    gap: 18px;
    padding: 18px;
    flex-wrap: wrap;
  }
  .homebar > div {
    flex: 1;
    justify-content: flex-end;
  }
  .homebar button {
    padding: 0 12px;
    min-height: 44px;
  }
  .homemain {
    padding: 28px 18px;
  }
  .homeheading {
    align-items: stretch;
    flex-direction: column;
    gap: 18px;
  }
  .homesearch {
    width: auto;
  }
  .homegrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 14px;
  }
  .homepaper {
    height: 200px;
    padding: 10px;
  }
  .homepaper > .templatemini {
    transform: scale(0.21);
  }
  .homebrand {
    font-size: 22px;
  }
  .homebrand span {
    font-size: 13px;
  }
}
/* A4 silhouettes remain proportional at every library breakpoint. */
.homegrid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 230px));
  justify-content: start;
}
.homepaper {
  width: 100%;
  height: auto;
  aspect-ratio: 210/297;
  box-sizing: border-box;
  flex: none;
}
@media (max-width: 600px) {
  .homegrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .homepaper {
    height: auto;
    aspect-ratio: 210/297;
  }
}
.recentfallback {
  position: absolute;
  width: 20px;
  height: 24px;
  left: calc(50% - 10px);
  top: calc(50% - 12px);
  color: var(--muted);
}
@media (max-width: 600px) {
}
@media (prefers-reduced-motion: reduce) {
}

.homeaddpaper {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px dashed var(--muted);
  box-shadow: none;
}
.homeaddpaper > svg {
  width: 30px;
  height: 30px;
  color: var(--brand);
  stroke-width: 1.5;
}
.homeaddtemplate:hover .homeaddpaper {
  background: var(--canvas);
  border-color: var(--brand);
}

.columnformats {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  background: var(--canvas);
  border-radius: 5px;
}
.columnformats button {
  font-size: 12px;
  min-height: 32px;
  padding: 5px 8px;
}
.columnformats button[aria-pressed='true'] {
  background: var(--surface);
  color: var(--brand);
  box-shadow: 0 1px 3px color-mix(in srgb, var(--ink) 9%, transparent);
}
.columnedit {
  flex-wrap: wrap;
}
.columnedit > [data-delete-column] {
  font-size: 12px;
  color: var(--muted);
  margin-left: auto;
}
.columnedit > [data-delete-column]:hover {
  color: var(--finding-text);
  background: var(--canvas);
}
#tablePreview td[data-preview-column] {
  cursor: pointer;
}
#tablePreview td[data-preview-column]:hover {
  background: var(--canvas);
}

/* Table editing: pick columns, work on the table, reveal only the selected column. */
dialog.simpletabledialog {
  max-width: calc(100vw - 24px);
}
.simpletabledialog h2 {
  margin-bottom: 5px;
}
.simpletabledialog .tablesourceplain {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 22px;
}
.simpletablecolumns {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0 16px;
  border-bottom: 1px solid var(--line);
}
.simpletablecolumns .tablepicklabel {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  margin: 0;
  flex: none;
}
.simpletabledialog .tablecolumnpicker {
  gap: 6px;
}
.simpletabledialog .tablecolumnpicker button {
  padding: 6px 12px;
  min-height: 34px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
  border-radius: 5px;
  font-size: 12px;
}
.simpletabledialog .tablecolumnpicker button[aria-pressed='true'] {
  background: var(--canvas);
  border-color: var(--line);
  color: var(--brand);
}
.simpletabledialog #tablePreview {
  overflow-x: auto;
  margin-top: 18px;
}
.simpletabledialog .tableexample {
  margin: 0;
  min-width: 290px;
}
.simpletabledialog .tableexample th {
  padding: 9px 8px;
}
.simpletabledialog .tableexample td {
  padding: 12px 10px;
  font-size: 13px;
}
.simpletabledialog .tableheadinput {
  padding: 6px 2px;
}
.simpletabledialog .tableheadinput:focus {
  outline: 0;
  box-shadow: none;
  background: var(--surface);
}
.simpletabledialog #tableColumns {
  max-height: none;
  overflow: visible;
  margin: 0;
}
.simpletabledialog #tableColumns[hidden] {
  display: none !important;
}
.simpletabledialog #tableColumns .columnedit {
  display: flex;
  flex-wrap: wrap;
  padding: 2px 0;
  border: 0;
}
.simpletabledialog .columneditname {
  font-weight: 600;
  flex: 1;
  min-width: 60px;
}
.simpletabledialog #tableColumns .selectcontrol {
  width: 88px;
  min-width: 0;
  flex: none;
  min-height: 34px;
  height: 34px;
}
.simpletabledialog .columnedit button {
  width: auto;
  height: auto;
  padding: 5px 8px;
  min-height: 34px;
  min-width: 0;
}
.simpletabledialog .columnformats {
  padding: 0;
  gap: 0;
  border: 1px solid var(--line);
  background: var(--surface);
}
.simpletabledialog .columnformats button {
  font-size: 11px;
  border-radius: 3px;
}
.simpletabledialog .columnformats button[aria-pressed='true'] {
  background: var(--canvas);
  box-shadow: none;
}
.simpletabledialog .tablepreviewstatus {
  margin: 10px 0 22px !important;
  color: var(--muted);
  font-size: 11px !important;
}
.simpletableappearance {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.simpletabledialog .tableappearances {
  gap: 4px;
  margin: 0;
  justify-content: flex-start;
}
.simpletabledialog .tableappearances button {
  flex: none;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 12px;
  color: var(--muted);
}
.simpletabledialog .tableappearances button[aria-pressed='true'] {
  border-color: var(--line);
  background: var(--canvas);
  color: var(--brand);
}
.simpletabledialog .tablelookmini {
  display: none;
}
.simpletabledialog .tablequickoptions {
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0 0;
  margin: 0;
}
.simpletabledialog .tablequickoptions label {
  margin: 0;
}
.simpletabledialog .tablecustomize {
  border: 0;
  padding: 0;
  margin: 14px 0 0;
}
.simpletabledialog .tablecustomize > button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  min-height: 30px;
}
@media (max-width: 600px) {
  dialog.simpletabledialog {
    padding: 22px 16px 14px;
    max-width: 100%;
    width: 100%;
    max-height: 94dvh;
  }
  .simpletablecolumns {
    align-items: flex-start;
    gap: 10px;
  }
  .simpletabledialog .tablecolumnpicker button {
    min-height: 40px;
  }
  .simpletabledialog .tableappearances button {
    padding: 8px 9px;
    min-height: 40px;
    flex-direction: row;
  }
  .simpletabledialog .columneditname {
    flex-basis: 100%;
  }
  .simpletabledialog .tablequickoptions {
    align-items: center;
    flex-wrap: wrap;
  }
  .simpletabledialog .columnedit button,
  .simpletabledialog #tableColumns .selectcontrol {
    min-height: 40px;
    height: 40px;
  }
  .simpletabledialog .tableexample td {
    padding: 10px 8px;
  }
  .simpletabledialog .columnedit > [data-delete-column] {
    margin-left: 0;
  }
  .simpletabledialog .columnformats button {
    font-size: 12px;
  }
}

/* Direct sizing, data-aware preview: table tools stay on the table. */
.tabledataactions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}
.tabledataactions > button {
  font-size: 12px;
  color: var(--brand);
  min-height: 34px;
  padding: 5px 0;
}
.tableapplication {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 !important;
  font-size: 11px !important;
  color: var(--muted);
  min-width: 0;
}
.tableapplication .selectcontrol {
  font-size: 12px;
  min-height: 34px;
  max-width: 250px;
  padding: 6px 9px;
}
.simpletabledialog #tablePreview {
  max-height: 350px;
  overscroll-behavior: contain;
}
.simpletabledialog .tableexample {
  table-layout: fixed;
  width: 100%;
}
.simpletabledialog .tableexample th {
  position: relative;
}
.simpletabledialog .tableexample td {
  overflow-wrap: anywhere;
}
.simpletabledialog .tableheadinput {
  width: 100%;
  min-width: 0;
}
.tableresize {
  position: absolute;
  z-index: 2;
  top: 0;
  right: -7px;
  bottom: 0;
  width: 14px;
  cursor: col-resize;
  touch-action: none;
}
.tableresize::after {
  content: '';
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 6px;
  width: 2px;
  border-radius: 2px;
  background: transparent;
}
.tableresize:hover::after,
.tableresize:focus-visible::after,
.tableresize.dragging::after {
  background: var(--brand);
}
.tableresize:focus-visible {
  outline: 1px solid var(--brand);
  outline-offset: -3px;
  border-radius: 4px;
}
.tableallrows {
  font-size: 11px;
  min-height: 28px;
  padding: 0 7px;
  color: var(--brand);
}
.tableemptyrow td {
  text-align: center;
  color: var(--muted);
  padding: 26px 12px !important;
  font-size: 13px !important;
}
@media (max-width: 600px) {
  .tabledataactions {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
  .tableapplication {
    width: 100%;
  }
  .tableapplication .selectcontrol {
    flex: 1;
    max-width: none;
    min-height: 40px;
  }
  .simpletabledialog #tablePreview {
    max-height: 310px;
  }
  .tableallrows {
    min-height: 40px;
  }
  .tableresize {
    width: 20px;
    right: -10px;
  }
  .tableresize::after {
    left: 9px;
    background: var(--line);
  }
}

/* Quiet selection: neutral surfaces instead of coloured fills, ticks or focus halos. */
:root .selectcontrol[aria-expanded='true'] {
  border-color: var(--muted);
  box-shadow: none;
  background: var(--surface);
  color: var(--ink);
}
:root .selectoption[aria-selected='true'],
:root .selectoption[aria-selected='true']:focus {
  background: var(--canvas);
  color: var(--ink);
  font-weight: 600;
}
:root .selectoption[aria-selected='true']::after {
  content: none;
  display: none;
}
:root .selectoption {
  padding-right: 12px;
}
:root .selectoption:hover,
:root .selectoption:focus {
  background: var(--canvas);
  color: var(--ink);
  box-shadow: none;
}
:root .tablecolumnpicker button[aria-pressed='true']::before {
  content: none;
  display: none;
}
:root .tablecolumnpicker button[aria-pressed='true'],
:root .simpletabledialog .tablecolumnpicker button[aria-pressed='true'] {
  background: var(--canvas);
  border-color: var(--muted);
  color: var(--ink);
}
:root .fieldpopformats button[aria-pressed='true'],
:root .columnformats button[aria-pressed='true'],
:root .simpletabledialog .columnformats button[aria-pressed='true'] {
  background: var(--canvas);
  border-color: var(--muted);
  color: var(--ink);
  box-shadow: none;
}
:root .tableappearances button[aria-pressed='true'],
:root .simpletabledialog .tableappearances button[aria-pressed='true'] {
  background: var(--canvas);
  border-color: var(--muted);
  color: var(--ink);
  box-shadow: none;
}
:root #tablePreview .selectedtablecolumn {
  box-shadow: inset 0 -1px var(--muted);
}
:root .paper .chip[role='button']:hover {
  background: var(--canvas);
}
:root[data-input-mode='pointer'] :is(input, textarea, select, [contenteditable]):focus {
  outline: none !important;
  box-shadow: none !important;
}
:root #modal :is(input:not([type='checkbox']):not([type='radio']), textarea, select):focus,
:root .fieldpopsearch:focus {
  border-color: var(--muted);
  box-shadow: none;
  outline: none;
}
:root[data-input-mode='keyboard'] :is(input, textarea, select, [contenteditable]):focus-visible {
  outline: 1px solid var(--muted) !important;
  outline-offset: 1px;
  box-shadow: none !important;
}

.tabletypography {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  margin-top: 14px;
}
.tabletypography label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0 !important;
  font-size: 11px !important;
  color: var(--muted);
  min-width: 0;
}
.tabletypography label:first-child {
  flex: 1;
}
.tabletypography label:last-child {
  width: 110px;
}
.tabletypography .selectcontrol {
  font-size: 12px;
  min-height: 36px;
  padding: 7px 10px;
}
.simpletabledialog #tablePreview .tableexample :is(td, th) {
  font-family: inherit;
  font-size: var(--table-font-size, 13px);
}
@media (max-width: 600px) {
  .tabletypography .selectcontrol {
    min-height: 42px;
    font-size: 14px;
  }
}
#paper table .chip {
  font-family: inherit;
  font-size: inherit;
}

/* One consistent A4 grid for both recent work and reusable templates. */
.homerecentcard .homedocname {
  flex: none;
}
.homerecentcard .homedocname strong {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.homerecentcard .homedocname small {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.homerecentcard .homepaper {
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease;
}
.homerecentcard:hover .homepaper {
  border-color: var(--muted);
  box-shadow: 0 3px 10px color-mix(in srgb, var(--ink) 6%, transparent);
}
@media (prefers-reduced-motion: reduce) {
  .homerecentcard .homepaper {
    transition: none;
  }
}

/* Phones are readers, not squeezed desktop editors. Tablets retain editing. */
.phone-viewer .formatbar,
.phone-viewer .workspaceMenus,
.phone-viewer #editMode,
.phone-viewer #togglePreview,
.phone-viewer #homeNew,
.phone-viewer #homeAddTemplate,
.phone-viewer #saveState,
.phone-viewer .selectionstatus,
.phone-viewer .issueactions [data-repair],
.phone-viewer .issueactions [data-normalize],
.phone-viewer .issueactions [data-source-action],
.phone-viewer #compareForms {
  display: none !important;
}
.phone-viewer .compactheader.appbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: 40px 40px;
  gap: 4px 8px;
  padding: 8px 14px 10px;
  height: auto;
  min-height: 0;
  background: var(--surface);
}
.phone-viewer .compactheader .wordmark {
  grid-column: 1;
  grid-row: 1;
  font-size: 20px;
}
.phone-viewer .compactheader .documentidentity {
  grid-column: 2/4;
  grid-row: 1;
  margin: 0;
  padding: 0;
  min-width: 0;
  max-width: none;
}
.phone-viewer .documentidentity #docName {
  font-size: 12px;
  line-height: 1.4;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.phone-viewer #mobileReadLabel {
  display: flex;
  align-items: center;
  grid-column: 1;
  grid-row: 2;
  font-size: 11px;
  color: var(--muted);
}
.phone-viewer #mobileReadLabel[hidden] {
  display: none !important;
}
.phone-viewer .compactheader #navReport {
  grid-column: 2;
  grid-row: 2;
  margin: 0;
  min-height: 40px;
}
.phone-viewer .compactheader #export {
  grid-column: 3;
  grid-row: 2;
  min-height: 40px;
}
.phone-viewer .compactheader .headerfill {
  display: none;
}
.phone-viewer .exportfull,
.phone-viewer .desktopcheck {
  display: none;
}
.phone-viewer .exportshort,
.phone-viewer .mobilecheck {
  display: inline;
}
.phone-viewer .workspace {
  height: calc(var(--app-height, 100dvh) - 102px);
  min-height: 0;
}
.phone-viewer .canvas {
  height: 100%;
  min-height: 0;
}
.phone-viewer .previewapplications {
  padding: 12px 16px;
  gap: 6px;
  flex-wrap: wrap;
  border-top: 1px solid var(--canvas);
  background: var(--surface);
}
.phone-viewer .previewapplications label {
  font-size: 11px;
  color: var(--muted);
}
.phone-viewer .previewapplications .selectcontrol {
  max-width: 100%;
  width: 100%;
  font-size: 13px;
  min-height: 42px;
}
.phone-viewer .previewnotice {
  padding: 9px 16px;
  font-size: 11px;
  line-height: 1.5;
  background: var(--surface);
  color: var(--muted);
}
.phone-viewer .pageworkbench {
  min-height: 0;
  background: var(--surface);
}
.phone-viewer .paperscroll {
  padding: 0 0 20px;
}
.phone-viewer .paper,
.phone-viewer .documentpage {
  border: 0 !important;
  box-shadow: none !important;
}
.phone-viewer .doctable {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.phone-viewer .doctable table {
  min-width: 360px;
}
.phone-viewer .canvasfooter {
  min-height: 28px;
  padding: 4px 14px;
}
.phone-viewer .homebar {
  min-height: 68px;
}
.phone-viewer .homebar > div {
  flex: 0 0 auto;
  margin-left: auto;
}
.phone-viewer .homebar button {
  min-height: 42px;
}
.phone-viewer .inspector {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  z-index: 60;
  background: var(--surface);
}
.phone-viewer .panelheader {
  position: sticky;
  top: 0;
  background: var(--surface);
}

/* Scenario picker: readable situations grouped by their actual form field. */
dialog.scenariodialog {
  width: 620px;
  padding: 28px;
  max-width: calc(100vw - 24px);
}
.scenariodialog h2 {
  margin: 0 35px 8px 0;
  font-size: 23px;
}
.scenarioguidance {
  margin: 0 0 24px !important;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.scenariogroups {
  max-height: 54dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 6px;
}
.scenariogroup + .scenariogroup {
  margin-top: 24px;
}
.scenariogroup h3 {
  font-size: 11px;
  letter-spacing: 0.02em;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 8px;
}
.scenariodialog .scenariolist {
  display: flex;
  flex-direction: column;
  max-height: none;
  overflow: visible;
}
.scenariodialog .scenariolist button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 14px;
  gap: 12px;
  min-height: 48px;
  padding: 13px 10px;
  border-bottom: 1px solid var(--canvas);
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.5;
  align-items: center;
}
.scenariodialog .scenariolist button:hover {
  background: var(--canvas);
}
.scenariodialog .scenariolist button > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.scenariodialog .scenariolist button > svg {
  width: 14px;
  height: 14px;
  transform: rotate(-90deg);
  color: var(--muted);
}
.scenariodialog .scenariolist .scenariostatus {
  font-size: 10px;
  font-weight: 400;
  color: var(--muted);
  white-space: nowrap;
}
.scenariodialog .scenariolist .haswarnings {
  color: var(--finding-text);
}
.scenariodialog .scenariolist .haserrors {
  color: var(--finding-text);
}
.scenariofootnote {
  font-size: 11px !important;
  color: var(--muted);
  line-height: 1.6;
  margin: 22px 0 0 !important;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}
.scenarioempty {
  padding: 24px 0;
  font-size: 13px;
  color: var(--muted);
}
@media (max-width: 600px) {
  dialog.scenariodialog {
    width: 100%;
    max-width: 100%;
    padding: 24px 18px 18px;
  }
  .scenariogroups {
    max-height: 59dvh;
    padding-right: 0;
  }
  .scenariodialog .scenariolist button {
    grid-template-columns: minmax(0, 1fr) 14px;
    gap: 3px 10px;
    padding: 12px 4px;
    min-height: 58px;
  }
  .scenariodialog .scenariolist .scenariostatus {
    grid-column: 1;
    grid-row: 2;
  }
  .scenariodialog .scenariolist button > svg {
    grid-column: 2;
    grid-row: 1/3;
  }
  .scenariogroup + .scenariogroup {
    margin-top: 18px;
  }
}

/* Rename in place, without a modal or another settings screen. */
.compactheader .documentidentity {
  position: relative;
}
.documenttitlebutton {
  display: block;
  min-width: 0;
  max-width: 100%;
  min-height: 30px;
  text-align: left;
  padding: 3px 5px;
  margin-left: -5px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-weight: 600;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.documenttitlebutton:hover:not(:disabled) {
  background: var(--canvas);
  border-color: var(--line);
}
.documenttitlebutton:disabled {
  opacity: 1;
  cursor: default;
}
.documenttitlebutton[hidden],
.documenttitleinput[hidden],
.documenttitleerror[hidden] {
  display: none !important;
}
.documenttitleinput {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  margin: 0;
  padding: 3px 7px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--muted);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  box-sizing: border-box;
}
.documenttitleinput[aria-invalid='true'] {
  border-color: var(--finding-text);
}
.documenttitleerror {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  left: 0;
  min-width: 210px;
  max-width: 290px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 3px 12px color-mix(in srgb, var(--ink) 7%, transparent);
  color: var(--finding-text);
  font-size: 11px;
  line-height: 1.5;
}
.phone-viewer .documenttitlebutton {
  padding: 0;
  margin: 0;
  border: 0;
}

/* Left navigation uses quiet selection, without vertical marker lines. */
#pageThumbnails .pagethumbnail[aria-current='page']::before {
  content: none;
  display: none;
}
#pageNavigator {
  border-right: 0;
}
.outlineitem,
.outlineitem.active {
  border-left: 0;
}
.outlineitem.active {
  background: var(--canvas);
  color: var(--ink);
  font-weight: 600;
}
#pageThumbnails .pagethumbnail[aria-current='page'] .thumbnailviewport {
  box-shadow:
    0 1px 4px color-mix(in srgb, var(--ink) 9%, transparent),
    0 0 0 1px var(--muted);
}
#pageThumbnails .pagethumbnail[aria-current='page'] .thumbnumber {
  color: var(--ink);
}

.furnituresectionhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 8px;
}
.furnituresectionhead > span {
  font-size: 13px;
  font-weight: 600;
}
.furnituresectionhead > button {
  font-size: 12px;
  min-height: 34px;
  padding: 5px 0;
  color: var(--muted);
}
.furnituresectionhead > button:hover {
  background: transparent;
  color: var(--ink);
  text-decoration: underline;
}
#headerFields[hidden] {
  display: none !important;
}
#headerFields .furnitureinput {
  margin-top: 0;
}

.homesorting {
  display: flex;
  gap: 6px;
  margin: -8px 0 22px;
}
.homesorting[hidden] {
  display: none;
}
.homesorting button {
  background: transparent;
  border: 0;
  border-radius: 5px;
  padding: 7px 10px;
  font-size: 12px;
  color: var(--muted);
}
.homesorting button[aria-pressed='true'] {
  background: var(--line);
  color: var(--ink);
  font-weight: 600;
}
.homesorting button:hover {
  background: var(--line);
}

.tablerowhint {
  font-size: 12px;
  color: var(--muted);
  margin: 10px 0;
}
.tablecolumnpicker button[draggable='true'] {
  cursor: grab;
}
.tablecolumnpicker button[draggable='true']:active {
  cursor: grabbing;
}

.homeblankpaper {
  background: var(--surface) !important;
  position: relative;
}
.homeblankpaper:after {
  content: '';
  position: absolute;
  left: 20%;
  right: 20%;
  top: 24%;
  height: 1px;
  background: var(--line);
  box-shadow:
    0 12px var(--line),
    0 24px var(--line),
    0 36px var(--line);
}

.homeheading .homesearch {
  margin-left: auto;
}
.homesortmenu {
  position: relative;
  flex: none;
}
.homesortmenu[hidden] {
  display: none;
}
.homesortmenu summary {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  list-style: none;
  border-radius: 6px;
  color: var(--muted);
}
.homesortmenu summary::-webkit-details-marker {
  display: none;
}
.homesortmenu summary svg {
  width: 21px;
  height: 21px;
}
.homesortmenu summary:hover,
.homesortmenu[open] summary {
  background: var(--line);
}
.homesortmenu .homesorting {
  position: absolute;
  right: 0;
  top: 44px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0;
  padding: 6px;
  min-width: 195px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--ink) 9%, transparent);
}
.homesortmenu .homesorting button {
  white-space: nowrap;
  padding: 10px 12px;
}
@media (max-width: 600px) {
  .homeheading {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
  }
  .homeheading h1 {
    flex-basis: 100%;
  }
  .homeheading .homesearch {
    flex: 1;
    min-width: 0;
    margin-left: 0;
  }
}

.homesortmenu .homesorting button {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
  text-align: left;
}

/* Document-oriented table workspace: live table first, compact settings alongside. */
dialog.simpletabledialog {
  width: 1040px;
  padding: 26px;
  max-height: calc(100dvh - 32px);
}
.tableeditworkspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 264px;
  gap: 26px;
  margin-top: 20px;
  align-items: start;
}
.tableeditcanvas {
  min-width: 0;
  padding: 0 24px 24px 0;
  border-right: 1px solid var(--line);
  min-height: 310px;
}
.tableeditsettings {
  min-width: 0;
}
.tableeditsettings h3 {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  margin: 24px 0 10px;
}
.tableeditsettings .simpletablecolumns {
  display: block;
  border: 0;
  padding: 0;
}
.tableeditsettings .tablepicklabel {
  margin: 0 0 10px;
  font-weight: 600;
  color: var(--ink);
}
.tableeditsettings .tablecolumnpicker {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.tableeditsettings .tablecolumnpicker button {
  justify-content: flex-start;
  text-align: left;
  width: 100%;
  padding: 9px 12px;
  min-height: 38px;
}
.tableeditsettings .simpletableappearance {
  border: 0;
  padding: 0;
}
.tableeditsettings .tableappearances {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}
.simpletabledialog .tableeditsettings .tableappearances button {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 8px 3px;
  font-size: 10px;
  min-width: 0;
  white-space: normal;
  text-align: center;
  border: 1px solid var(--line);
}
.simpletabledialog .tableeditsettings .tablelookmini {
  display: grid;
  width: 48px;
  height: 32px;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
}
.tablelookmini i {
  border: 1px solid var(--line);
  background: var(--surface);
}
.tablelookmini i:nth-child(-n + 3) {
  background: var(--canvas);
}
.tablelookmini.lines i {
  border-width: 0 0 1px;
}
.tablelookmini.clean i {
  border: 0;
}
.tableeditsettings .tabletypography {
  gap: 8px;
  margin-top: 16px;
}
.tableeditsettings .tabletypography label:last-child {
  width: 85px;
}
.simpletabledialog .tableeditsettings .tablequickoptions {
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  gap: 12px;
}
.tableeditsettings .tablesumcontrol .selectcontrol {
  width: 100%;
  max-width: none;
}
.tableeditcanvas .tabledataactions {
  margin: 0;
}
.simpletabledialog .tableeditcanvas #tablePreview {
  margin-top: 14px;
  max-height: 410px;
}
.simpletabledialog #tablePreview .selectedtablecolumn {
  box-shadow: inset 0 -2px var(--muted);
}
.simpletabledialog .tableexample th {
  background: var(--canvas);
}
.simpletabledialog .tablepreviewstatus {
  margin-bottom: 0 !important;
}
.simpletabledialog .tablerowhint {
  margin: 4px 0;
  color: var(--muted);
}
.simpletabledialog .tablesourceplain {
  margin-bottom: 4px;
}
@media (max-width: 850px) {
  .tableeditworkspace {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .tableeditcanvas {
    border-right: 0;
    padding: 0;
    min-height: 0;
  }
  .tableeditsettings {
    border-top: 1px solid var(--line);
    padding-top: 18px;
  }
  .tableeditsettings .tablecolumnpicker {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .tableeditsettings .tablecolumnpicker button {
    width: auto;
  }
  .tableeditsettings .tableappearances {
    max-width: 320px;
  }
  .tableeditsettings .tabletypography {
    max-width: 360px;
  }
  .simpletabledialog .tableeditsettings .tablequickoptions {
    flex-direction: row;
    align-items: center;
  }
  .tableeditsettings h3 {
    margin-top: 18px;
  }
}

.simpletabledialog .modalactions {
  position: sticky;
  bottom: -26px;
  background: var(--surface);
  z-index: 8;
  padding: 16px 0 10px;
  border-top: 1px solid var(--line);
  margin-top: 22px;
}
.tablecolumndone {
  display: block;
  margin: 5px 0 0 auto;
  font-size: 12px;
  min-height: 32px;
  padding: 4px 12px;
  color: var(--muted);
}
.tablecolumndone[hidden] {
  display: none;
}
.simpletabledialog #tableColumns {
  background: var(--canvas);
  padding: 12px;
  margin-top: 8px;
  border-radius: 6px;
}
.simpletabledialog .columneditname {
  flex-basis: 100%;
  font-size: 12px;
}
.simpletabledialog #tableColumns .columnedit {
  gap: 10px;
}
.simpletabledialog .tableeditcanvas #tablePreview {
  scrollbar-gutter: stable;
}
@media (max-width: 850px) {
  .simpletabledialog .modalactions {
    bottom: -26px;
  }
  .simpletabledialog .tableeditsettings .tablequickoptions {
    flex-wrap: wrap;
  }
}

.tableeditworkspace.tablequickstart {
  grid-template-columns: minmax(0, 1fr);
  margin-top: 14px;
}
.tablequickstart .tableeditcanvas {
  border: 0;
  padding: 0;
  min-height: 0;
}
.tableeditsettings[hidden] {
  display: none;
}
.tablecustomizebutton {
  margin-top: 14px;
  padding: 7px 0;
  font-size: 12px;
  color: var(--muted);
  justify-content: flex-start;
}
.simpletabledialog:has(.tablequickstart) {
  width: 760px;
}

/* Tessera brand palette. Document run colors remain defined by the DOCX. */
:root {
  --brand: var(--teal);
  --brand-hover: var(--ink);
  --brand-subtle: var(--canvas);
  --ink: var(--text);
  --blue: var(--brand);
  --bluehover: var(--brand-hover);
  --canvas: var(--paper-bg);
}
.homebrand,
.compactheader .wordmark {
  color: var(--ink);
}
.home-open,
#workspaceHome,
.homemain,
.pageworkbench {
  background: var(--canvas);
}
.homeheading h1,
.simpletabledialog h2,
.tableeditsettings h3 {
  color: var(--ink);
}
button.primary,
.homebar button.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--surface);
}
button.primary:hover:not(:disabled),
.homebar button.primary:hover:not(:disabled) {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}

.homebrand {
  display: flex;
  align-items: center;
}
.compactheader .wordmark {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  min-width: 148px;
  padding-right: 14px;
}
/* Source columns are sortable rows, rather than generic selection chips. */
.simpletabledialog .tableeditsettings .tablecolumnpicker {
  gap: 0;
  border-top: 1px solid var(--line);
}
.simpletabledialog .tableeditsettings .tablecolumnpicker .columnchoice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  width: 100%;
  padding: 10px 2px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  box-shadow: none;
}
.simpletabledialog .tableeditsettings .tablecolumnpicker .columnchoice:hover {
  background: var(--canvas);
}
.columnchoicegrip {
  display: flex;
  flex: none;
  color: var(--muted);
  width: 16px;
  align-items: center;
  justify-content: center;
}
.columnchoicegrip svg {
  width: 14px;
  height: 20px;
  stroke-width: 3;
  stroke-linecap: round;
}
.columnchoicename {
  flex: 1;
  min-width: 0;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.columnchoicetoggle {
  display: flex;
  align-items: center;
  width: 28px;
  height: 17px;
  padding: 2px;
  border-radius: 10px;
  background: var(--line);
  flex: none;
}
.columnchoicetoggle > span {
  display: block;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 13%, transparent);
  transition: transform 0.14s;
}
.columnchoice[aria-pressed='true'] .columnchoicetoggle {
  background: var(--muted);
}
.columnchoice[aria-pressed='true'] .columnchoicetoggle > span {
  transform: translateX(11px);
}
.columnchoice[aria-pressed='false'] .columnchoicegrip {
  opacity: 0.25;
}
@media (prefers-reduced-motion: reduce) {
  .columnchoicetoggle > span {
    transition: none;
  }
}

.simpletabledialog .tableexample {
  font-family: Arial, Helvetica, sans-serif;
}
.columnchoicename {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 400;
  font-size: 13px;
}

/* Word-style contextual tool groups, Notion-style direct headers, Excel-style previews. */
.tableinspectortabs {
  display: flex;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.tableinspectortabs button {
  padding: 7px 0 11px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  font-size: 12px;
  color: var(--muted);
  background: transparent;
}
.tableinspectortabs button[aria-selected='true'] {
  color: var(--ink);
  border-bottom-color: var(--ink);
  font-weight: 600;
}
.tableinspectortabs button:hover {
  background: transparent;
  color: var(--ink);
}
.tableinspectorpanel[hidden] {
  display: none;
}
.tableeditsettings .tableinspectorpanel .tabletypography {
  margin-top: 22px;
}
.tableeditsettings .tableinspectorpanel .tablepicklabel {
  display: none;
}
.tableeditsettings .tableinspectorpanel .tablecolumnpicker {
  border-top: 0;
}
.simpletabledialog .tableeditsettings .tableinspectorpanel .tableappearances {
  grid-template-columns: 1fr;
  gap: 9px;
}
.simpletabledialog .tableeditsettings .tableinspectorpanel .tableappearances button {
  flex-direction: row;
  justify-content: flex-start;
  gap: 14px;
  min-height: 60px;
  padding: 10px 12px;
  font-size: 12px;
  background: var(--surface);
  border-color: var(--line);
  border-radius: 5px;
}
.simpletabledialog
  .tableeditsettings
  .tableinspectorpanel
  .tableappearances
  button[aria-pressed='true'] {
  border-color: var(--muted);
  background: var(--canvas);
}
.simpletabledialog .tableeditsettings .tableinspectorpanel .tablelookmini {
  width: 62px;
  height: 36px;
  flex: none;
}
.tableeditcanvas .tabledataactions {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.simpletabledialog .tableeditcanvas .tableexample {
  border-collapse: collapse;
}
@media (max-width: 850px) {
  .tableinspectortabs {
    margin-bottom: 12px;
  }
  .simpletabledialog .tableeditsettings .tableinspectorpanel .tableappearances {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: none;
  }
  .simpletabledialog .tableeditsettings .tableinspectorpanel .tableappearances button {
    flex-direction: column;
    gap: 8px;
  }
  .tableeditsettings .tableinspectorpanel .tablecolumnpicker {
    flex-direction: column;
  }
  .tableeditsettings .tableinspectorpanel .tablecolumnpicker button {
    width: 100%;
  }
}

.importmapping label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, 1fr);
  gap: 18px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
  margin: 0;
}
.importmapping small {
  display: block;
  color: var(--muted);
  font-weight: 400;
  margin-top: 4px;
  overflow-wrap: anywhere;
}
.importtablepreview {
  overflow: auto;
  margin: 18px 0;
  max-height: 220px;
}
.importtablepreview table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.importtablepreview th,
.importtablepreview td {
  text-align: left;
  padding: 9px;
  border-bottom: 1px solid var(--line);
}
#pasteTableText {
  width: 100%;
  resize: vertical;
  min-height: 140px;
}

.menupopup .menushortcuthelp {
  border-top: 1px solid var(--line);
  margin-top: 6px;
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
}
.menushortcuthelp kbd {
  font-family: inherit;
  font-size: 11px;
  color: var(--muted);
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}
