/* One viewport shell: header wrapping and the software keyboard must not hide the canvas. */
html {
  height: 100%;
  overflow: hidden;
}
body {
  height: var(--app-height, 100dvh);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}
.workspace {
  height: auto;
  min-height: 0;
}
.paperscroll,
.inspectorview,
dialog {
  overscroll-behavior: contain;
}
.paper {
  overflow-wrap: anywhere;
}
/* A data label breaks between words, not inside "Poradie", when its column is narrow. */
.paper .chip {
  overflow-wrap: break-word;
}
.doctable {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}
.doctable table {
  min-width: 420px;
}
#tablePreview {
  max-width: 100%;
  overflow-x: auto;
}
#tablePreview table {
  min-width: 340px;
}
.menupopup {
  max-height: calc(var(--app-height, 100dvh) - 80px);
  overflow-y: auto;
}
dialog {
  max-height: calc(var(--app-height, 100dvh) - 24px);
}
@media (max-width: 1050px) {
  .compactheader {
    gap: 5px;
    padding: 0 14px;
  }
  .compactheader .documentidentity {
    min-width: 0;
    flex: 1;
    max-width: 200px;
  }
  .compactheader .documentidentity #docName {
    max-width: 100%;
    width: 100%;
  }
  .compactheader .headerfill {
    display: none;
  }
  .compactheader button,
  .compactheader .filemenu > summary {
    padding-left: 8px;
    padding-right: 8px;
  }
  .workspace.panel-open {
    grid-template-columns: minmax(0, 1fr);
  }
  .inspector {
    position: absolute;
    inset: 0 0 0 auto;
    width: 360px;
    max-width: 100%;
    z-index: 4;
    box-shadow: -8px 0 24px color-mix(in srgb, var(--ink) 9%, transparent);
  }
  .workspace.panel-open .paper {
    padding: 55px 57px;
    font-size: 14px;
  }
}
@media (max-width: 760px) {
  .compactheader {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-template-rows: 44px 48px;
    gap: 0 3px;
    height: auto;
    min-height: 0;
    padding: 4px 10px;
  }
  .compactheader .wordmark {
    grid-column: 1;
    grid-row: 1;
    font-size: 18px;
    margin: 0;
  }
  .compactheader .documentidentity {
    grid-column: 2/5;
    grid-row: 1;
    flex: none;
    max-width: none;
    min-width: 0;
    padding-left: 10px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }
  .compactheader .documentidentity #docName {
    max-width: 100%;
    font-size: 13px;
  }
  .compactheader .docversion {
    margin-top: 2px;
    font-size: 10px;
  }
  .compactheader .filemenu {
    grid-column: 5;
    grid-row: 1;
    min-width: 0;
  }
  .compactheader .filemenu > summary {
    font-size: 11px;
    min-height: 44px;
    padding: 0 2px;
    gap: 2px;
    justify-content: flex-end;
  }
  .compactheader #insertTab {
    grid-column: 1;
    grid-row: 2;
  }
  .compactheader #addTable {
    grid-column: 2;
    grid-row: 2;
  }
  .compactheader #navReport {
    grid-column: 3;
    grid-row: 2;
    margin: 0;
  }
  .compactheader #togglePreview,
  .compactheader #editMode {
    grid-column: 4;
    grid-row: 2;
  }
  .compactheader #export {
    grid-column: 5;
    grid-row: 2;
  }
  .compactheader > button {
    min-height: 44px;
    min-width: 0;
    padding: 6px 2px;
    font-size: 11px !important;
    gap: 3px;
  }
  .compactheader > button svg {
    display: none !important;
  }
  .compactheader #sideCount {
    padding: 2px 3px;
    font-size: 9px;
  }
  .compactheader .menupopup {
    position: fixed;
    top: 52px;
    left: auto;
    right: 10px;
    width: min(300px, calc(100vw - 20px));
    max-height: calc(var(--app-height, 100dvh) - 64px);
  }
  .edittools {
    height: 48px;
    padding: 0 8px;
    gap: 2px;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
  }
  .edittools button,
  .edittools button:not([id^='format-']) {
    flex: none;
    min-width: 44px;
    width: 44px;
    height: 44px;
    padding: 0;
  }
  /* Pole, Podmienka and Tabuľka carry a text label; only icon buttons are square. */
  .edittools .studio-insertions button {
    width: auto;
    padding-inline: 10px;
  }
  .edittools #paragraphStyle {
    flex: none;
    width: 100px;
    height: 44px;
    font-size: 13px;
    margin: 0;
    padding: 4px;
  }
  .edittools .editseparator {
    display: none;
  }
  .edittools .formconnection {
    display: none;
  }
  .edittools .headerfill {
    min-width: 0;
  }
  .paperscroll {
    padding: 14px 10px 30px;
  }
  .paper,
  .workspace.panel-open .paper {
    padding: 28px 24px;
    font-size: 16px;
    min-height: 650px;
  }
  .paper h1,
  .workspace.panel-open .paper h1 {
    font-size: 20px;
  }
  .paper h2.smallheading {
    font-size: 17px;
  }
  .paper .chip {
    font-size: inherit;
  }
  .inspector {
    width: 100%;
    max-width: 100%;
    box-shadow: none;
  }
  .inspectorview {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .panelheader {
    min-height: 56px;
  }
  .canvasfooter {
    min-height: 44px;
    padding: 0 10px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .canvasfooter #clearSelection {
    width: 44px;
    height: 44px;
    font-size: 20px;
  }
  .canvasfooter #clearSelection::after {
    content: none;
  }
  .zoomcontrol select {
    min-height: 44px;
    font-size: 13px;
  }
  .previewnotice {
    font-size: 12px;
    line-height: 1.5;
  }
  dialog,
  dialog.tabledialog {
    padding: 22px 18px;
    max-width: calc(100vw - 16px);
    max-height: calc(var(--app-height, 100dvh) - 16px);
    border-radius: 10px;
  }
  dialog input:not([type='checkbox']):not([type='radio']),
  dialog select,
  dialog textarea,
  .conditionrule input,
  .conditionrule select,
  .columnedit select,
  .columnedit input:not([type='checkbox']):not([type='radio']),
  .search input {
    font-size: 16px;
    min-height: 44px;
  }
  dialog h2 {
    padding-right: 30px;
    font-size: 21px;
  }
  dialog .close {
    width: 44px;
    height: 44px;
    top: 6px;
    right: 6px;
  }
  .modalactions {
    position: sticky;
    bottom: -22px;
    background: var(--surface);
    padding: 14px 0 max(4px, env(safe-area-inset-bottom));
    margin-top: 18px;
    z-index: 2;
  }
  .modalactions button {
    min-height: 44px;
    white-space: normal;
  }
  .conditionrule {
    grid-template-columns: 1fr 1fr auto;
  }
  .conditionrule > select:first-child {
    grid-column: 1/-1;
  }
  .conditionrule input,
  .conditionrule [data-rule-answer] {
    grid-column: auto;
  }
  .columnedit {
    grid-template-columns: 28px minmax(0, 1fr) 44px 44px;
    gap: 5px;
    border-bottom: 1px solid var(--canvas);
    padding: 8px 0;
  }
  .columnedit > label {
    grid-column: 2/-1;
  }
  .columnedit > select {
    grid-column: 2;
  }
  .columnedit button {
    width: 44px;
    height: 44px;
  }
  .tabledialog #tableColumns {
    max-height: none;
    overflow: visible;
  }
  .tableoptions > summary {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .newformrow {
    gap: 8px;
  }
  .newformrow span {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  #toast {
    bottom: 52px;
    font-size: 13px;
  }
}
@media (pointer: coarse), (max-width: 760px) {
  button,
  .filemenu > summary {
    min-height: 44px;
  }
  .field,
  .insertchoices button,
  .menupopup button {
    min-height: 48px;
  }
  input[type='checkbox'] {
    width: 22px;
    height: 22px;
  }
  .checkline {
    min-height: 44px;
    align-items: center;
  }
  .edittools button,
  .edittools #paragraphStyle {
    min-height: 44px;
    height: 44px;
  }
  .edittools {
    min-height: 48px;
  }
}
@media (max-width: 360px) {
  .compactheader {
    padding-left: 6px;
    padding-right: 6px;
    column-gap: 1px;
  }
  .compactheader .wordmark {
    font-size: 16px;
  }
  .compactheader #navReport {
    font-size: 10px !important;
    gap: 2px;
  }
  .compactheader .filemenu > summary {
    font-size: 10px;
  }
  .paper,
  .workspace.panel-open .paper {
    padding: 24px 18px;
  }
  .catalogchoices {
    grid-template-columns: 1fr;
  }
}
.mobilecheck {
  display: none;
}
@media (max-width: 760px) {
  .desktopcheck {
    display: none;
  }
  .mobilecheck {
    display: inline;
  }
}
@media (pointer: coarse) {
  button,
  .modalactions button,
  .columnedit button,
  .canvasfooter #clearSelection {
    min-width: 44px;
    min-height: 44px;
  }
  .edittools button,
  .edittools button:not([id^='format-']) {
    width: 44px;
  }
  .edittools .studio-insertions button {
    width: auto;
  }
  .columnedit {
    grid-template-columns: 24px minmax(0, 1fr) 100px 44px 44px;
  }
  dialog input:not([type='checkbox']):not([type='radio']),
  dialog select,
  dialog textarea,
  .search input {
    font-size: 16px;
    min-height: 44px;
  }
}
@media (pointer: coarse) and (max-width: 760px) {
  .columnedit {
    grid-template-columns: 28px minmax(0, 1fr) 44px 44px;
  }
}
@media (max-height: 500px) {
  .modalactions {
    position: sticky;
    bottom: -24px;
    background: var(--surface);
    padding-bottom: 8px;
    z-index: 2;
  }
  dialog {
    scroll-padding-bottom: 76px;
  }
}
.savestate {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.2;
  margin-top: 2px;
}
.paper .chip[role='button'] {
  cursor: pointer;
}
.paper .chip[role='button']:hover {
  background: var(--canvas);
}
.paper .chip[role='button']:focus-visible {
  outline: 2px solid var(--soft);
  outline-offset: 3px;
}
@media (pointer: coarse), (max-width: 760px) {
  .paper .chip[role='button'] {
    display: inline-block;
    min-height: 44px;
    padding: 7px 2px;
  }
}
dialog.tabledialog {
  width: 620px;
}
.tablepicklabel {
  font-size: 12px;
  font-weight: 600;
  margin: 18px 0 8px;
}
.tablecolumnpicker {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.tablecolumnpicker button {
  border: 1px solid var(--line);
  min-height: 36px;
  padding: 7px 12px;
  font-size: 12px;
}
.tablecolumnpicker button[aria-pressed='true'] {
  background: var(--canvas);
  border-color: var(--soft);
  color: var(--brand);
}
.tablecolumnpicker button[aria-pressed='true']::before {
  content: '✓';
  font-size: 12px;
}
.tablequickoptions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
}
.tablequickoptions .checkline {
  margin: 0;
}
.tablesumcontrol {
  margin: 0 !important;
}
.tablesumcontrol select {
  min-height: 38px;
  width: auto;
  max-width: 240px;
  font-size: 12px;
}
.tablepreviewstatus {
  font-size: 11px !important;
  color: var(--muted);
  margin: 8px 0 0 !important;
}
.columnposition {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}
.tablesumrow td {
  font-weight: 600 !important;
  border-top: 1px solid var(--line);
}
.tabledialog .tableoptions {
  margin-top: 12px;
}
.tabledialog #tableValidation {
  font-size: 12px;
}
.tablequickoptions select {
  margin: 0;
}
@media (max-width: 760px) {
  .tablequickoptions {
    gap: 8px;
    flex-wrap: wrap;
  }
  .tablecolumnpicker button {
    min-height: 44px;
    font-size: 14px;
  }
  .tablesumcontrol select {
    font-size: 16px;
    min-height: 44px;
    max-width: 100%;
  }
  .tablequickoptions .checkline {
    font-size: 13px !important;
  }
  .tablesumcontrol {
    max-width: 100%;
  }
  .tablepreviewstatus {
    font-size: 12px !important;
  }
}
dialog.librarydialog {
  width: 780px;
  padding: 28px;
}
.libraryentryactions {
  display: flex;
  gap: 10px;
  padding: 6px 0 22px;
  border-bottom: 1px solid var(--line);
}
.libraryentryactions button {
  font-size: 13px;
  min-height: 42px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.libraryentryactions button:first-child {
  color: var(--brand);
  border-color: var(--soft);
}
.librarysectionheading {
  padding: 24px 0 6px;
}
.librarysectionheading h3 {
  font-size: 12px;
  margin: 0 0 6px;
  font-weight: 600;
  color: var(--muted);
}
.librarysectionheading > span {
  font-size: 11px;
  color: var(--muted);
}
.libraryrow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 20px 0;
  border-bottom: 1px solid var(--canvas);
  align-items: center;
}
.libraryrow:last-child {
  border-bottom: 0;
  padding-bottom: 4px;
}
.libraryidentity {
  min-width: 0;
}
.libraryidentity b {
  display: block;
  font-size: 15px;
  font-weight: 600;
}
.libraryidentity > span {
  display: block;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  margin-top: 5px;
}
.libraryrowactions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.libraryrowactions button {
  font-size: 12px;
  min-height: 40px;
  white-space: nowrap;
  padding: 8px;
}
.libraryrowactions [data-preview-template] {
  color: var(--muted);
}
.libraryrowactions [data-open-template] {
  color: var(--brand);
  font-weight: 600;
  background: var(--canvas);
  padding: 8px 13px;
}
.librarycontent {
  grid-column: 1/-1;
  min-width: 0;
}
.librarycontent > .micro {
  margin: 3px 0 12px;
}
.libraryreadpreview {
  max-height: 300px;
  overflow: auto;
  overscroll-behavior: contain;
  border-left: 2px solid var(--canvas);
  padding: 4px 20px 14px;
  font:
    13px/1.7 Arial,
    sans-serif;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.libraryreadpreview h3 {
  font-size: 15px;
  margin: 10px 0 20px;
  text-align: left;
}
.libraryreadpreview h4 {
  font-size: 13px;
  margin: 16px 0 8px;
}
.libraryreadpreview p {
  font-size: 13px;
  margin: 10px 0;
}
.libraryreadpreview table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.libraryreadpreview td {
  border: 1px solid var(--line);
  padding: 7px;
}
.libraryreadpreview td p {
  margin: 0;
  font-size: 12px;
}
@media (max-width: 760px) {
  dialog.librarydialog {
    padding: 24px 18px;
  }
  .libraryentryactions {
    gap: 8px;
    flex-wrap: wrap;
    padding-bottom: 18px;
  }
  .libraryentryactions button {
    min-height: 44px;
    font-size: 13px;
  }
  .libraryrow {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 18px 0;
  }
  .libraryrowactions {
    justify-content: space-between;
    gap: 8px;
  }
  .libraryrowactions button {
    min-height: 44px;
  }
  .libraryidentity b {
    font-size: 16px;
  }
  .libraryidentity > span {
    font-size: 13px;
  }
  .libraryreadpreview {
    padding-left: 12px;
    max-height: 280px;
  }
  .librarysectionheading {
    padding-top: 18px;
  }
}
.inserttarget {
  font-size: 11px;
  color: var(--muted);
  padding: 2px 6px 14px;
}
.field:focus-visible {
  outline-offset: -2px;
}
.tablecustomize {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.tablecustomize > button {
  font-size: 12px;
  color: var(--brand);
  border: 1px solid var(--line);
  padding: 8px 12px;
  min-height: 38px;
  background: var(--surface);
}
.tablecustomize > button[aria-expanded='true'] {
  background: var(--canvas);
  border-color: var(--soft);
}
.tablecustomize #tableColumns {
  margin-top: 12px;
}
.tablecustomize .columnedit {
  margin-top: 8px;
}
@media (max-width: 760px) {
  .tablecustomize > button {
    min-height: 44px;
    font-size: 14px;
  }
}
.selectnative {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: 0 !important;
  opacity: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
  clip-path: inset(50%) !important;
}
.selectcontrol {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  text-align: left;
  font:
    13px/1.4 -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Arial,
    sans-serif;
}
.selectcontrol:hover:not(:disabled) {
  border-color: var(--line);
  background: var(--surface);
}
.selectcontrol[aria-expanded='true'] {
  border-color: var(--soft);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 6%, transparent);
}
.selectvalue {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.selectcontrol svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
}
.selectpopup {
  z-index: 100;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 28px color-mix(in srgb, var(--ink) 13%, transparent);
}
.selectoption {
  display: flex;
  justify-content: flex-start;
  position: relative;
  width: 100%;
  text-align: left;
  padding: 9px 32px 9px 11px;
  font:
    13px/1.4 -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Arial,
    sans-serif;
  white-space: normal;
}
.selectoption[aria-selected='true'] {
  font-weight: 500;
}
.selectoption[aria-selected='true']::after {
  content: '✓';
  position: absolute;
  right: 11px;
}
.selectoption:focus {
  outline: none;
  background: var(--canvas);
}
.selectoption[aria-selected='true']:focus {
  background: var(--canvas);
}
.selectoption:focus-visible {
  outline: 2px solid var(--soft);
  outline-offset: -2px;
}
.edittools .selectcontrol {
  width: 150px;
  flex: none;
  min-height: 28px;
  height: 28px;
  padding: 3px 7px;
  font-size: 11px;
  border-color: transparent;
  background: transparent;
}
.edittools .selectcontrol svg {
  width: 12px;
  height: 12px;
}
.zoomcontrol .selectcontrol {
  width: 78px;
  min-height: 28px;
  padding: 3px 6px;
  font-size: 11px;
  border-color: transparent;
  background: transparent;
}
.conditionrule .selectcontrol {
  margin: 0;
}
.columnedit .selectcontrol {
  min-height: 36px;
  padding: 5px 6px;
  font-size: 11px;
}
.tablesumcontrol .selectcontrol {
  width: auto;
  max-width: 240px;
  min-width: 140px;
}
.selectcontrol[hidden] {
  display: none !important;
}
@media (max-width: 760px), (pointer: coarse) {
  .selectcontrol {
    min-height: 44px;
    font-size: 16px;
  }
  .selectoption {
    min-height: 44px;
    font-size: 15px;
  }
  .edittools .selectcontrol {
    height: 44px;
    min-height: 44px;
    width: 100px;
    font-size: 13px;
  }
  .zoomcontrol .selectcontrol {
    min-height: 44px;
    font-size: 13px;
  }
  .columnedit .selectcontrol {
    min-height: 44px;
    font-size: 14px;
  }
  .tablesumcontrol .selectcontrol {
    max-width: 100%;
    min-height: 44px;
  }
}
.edittools button.selectcontrol {
  width: 150px;
  padding: 3px 7px;
  font-family: inherit;
  font-size: 11px;
}
@media (max-width: 760px) {
  .conditionrule > .selectcontrol:nth-child(2) {
    grid-column: 1/-1;
  }
  .columnedit > .selectcontrol {
    grid-column: 2;
  }
  .edittools button.selectcontrol {
    width: 100px;
    min-width: 100px;
    font-size: 13px;
  }
}
.tableactions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 5px;
}
.doctable .tableactions .tableedit {
  margin: 0;
  padding: 5px 6px 5px 0;
}
/* Fixed squares only for the icon buttons (↑, ↓, remove); text buttons keep their width. */
.tableactions > button:is([data-tablemove], [data-tableremove]) {
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 4px;
  color: var(--muted);
}
.tableactions > button:not(.tableedit):hover:not(:disabled) {
  background: var(--canvas);
  color: var(--brand);
}
.tableactions svg {
  width: 15px;
  height: 15px;
}
@media (max-width: 760px), (pointer: coarse) {
  .tableactions > button:is([data-tablemove], [data-tableremove]) {
    min-width: 44px;
    width: 44px;
    height: 44px;
  }
  .doctable .tableactions .tableedit {
    min-height: 44px;
    font-size: 13px;
  }
}
.findstatus {
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 10px;
}
.findresult {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px 4px;
  border-bottom: 1px solid var(--canvas);
  border-radius: 0;
  line-height: 1.6;
}
.findresult > span {
  display: block;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.findresult small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 5px;
}
.findresult[aria-current='true'] {
  color: var(--brand);
  background: var(--canvas);
}
.namedversion {
  display: flex;
  gap: 8px;
  margin: 18px 0 10px;
}
.namedversion input {
  flex: 1;
  min-width: 0;
}
.namedversion button {
  flex: none;
  white-space: nowrap;
}
.savedrow {
  padding: 16px 0;
  border-bottom: 1px solid var(--canvas);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.savedrow b,
.savedrow small {
  display: block;
  overflow-wrap: anywhere;
}
.savedrow b {
  font-size: 13px;
}
.savedrow small {
  font-size: 11px;
  color: var(--muted);
  margin-top: 5px;
}
.savedactions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.savedactions button {
  font-size: 12px;
  color: var(--brand);
  min-height: 38px;
}
.savedactions button:hover {
  background: var(--canvas);
}
.comparisonrows {
  max-height: 400px;
  overflow: auto;
}
.comparisonlegend {
  display: flex;
  gap: 25px;
  font-size: 12px;
  margin: 15px 0;
  color: var(--muted);
}
.compareline {
  padding: 12px 14px;
  margin: 5px 0;
  border-left: 2px solid var(--line);
}
.compareline.added {
  border-color: var(--muted);
  background: var(--canvas);
}
.compareline.removed {
  border-color: var(--muted);
  background: var(--canvas);
}
.compareline p {
  font-size: 13px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 5px 0;
}
.compareline small {
  font-size: 10px;
  color: var(--muted);
}
.snippetcontent {
  font:
    13px/1.7 Arial,
    sans-serif;
  white-space: pre-wrap;
  max-height: 250px;
  overflow: auto;
  padding: 12px 0;
}
.proposalrow {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.proposalrow > small,
.proposalrow > del,
.proposalrow > ins {
  display: block;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.proposalrow > small {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
}
.proposalrow del {
  color: var(--muted);
}
.proposalrow ins {
  color: var(--brand);
  text-decoration: none;
}
.styleoptions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.sectionmoves {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.sectionmoves button {
  font-size: 12px;
  color: var(--brand);
  border: 1px solid var(--line);
}
.paper .wordlist {
  position: relative;
  padding-left: 26px;
}
.listmarker {
  position: absolute;
  left: 0;
  top: 0;
  user-select: none;
  min-width: 20px;
  text-align: right;
}
.paper .pagebreakbefore {
  border-top: 1px dashed var(--line);
  padding-top: 22px;
  margin-top: 32px;
}
.floatingformat.formatbar {
  position: fixed;
  z-index: 10;
  display: flex;
  gap: 2px;
  padding: 4px;
  height: 38px;
  width: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 5px 18px color-mix(in srgb, var(--ink) 9%, transparent);
}
.floatingformat.formatbar button {
  min-width: 32px;
  height: 28px;
}
.floatingformat #floatingParagraph {
  font:
    11px -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  width: auto;
  padding: 0 8px;
}
.floatingformat[hidden] {
  display: none !important;
}
@media (max-width: 760px) {
  .namedversion {
    flex-wrap: wrap;
  }
  .namedversion input {
    flex-basis: 100%;
    font-size: 16px;
  }
  .namedversion button {
    min-height: 44px;
  }
  .savedrow {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .savedactions button {
    min-height: 44px;
  }
  .floatingformat.formatbar {
    height: 48px;
  }
  .floatingformat.formatbar button {
    min-width: 40px;
    min-height: 38px;
  }
  .styleoptions {
    gap: 8px;
  }
  .styleoptions input {
    width: 100%;
    min-width: 0;
  }
}

/* Keep controls at a readable size and wrap complete groups instead of squeezing them. */
.formatbar.edittools {
  gap: 6px 12px;
  flex-wrap: wrap;
  align-items: center;
}
.edittools .toolcluster {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}
.edittools .emphasiscluster button[id^='format-'] {
  display: grid;
  place-items: center;
  min-width: 36px;
  min-height: 34px;
  padding: 0;
  font:
    16px/1 Arial,
    sans-serif;
  flex: none;
}
.edittools .emphasiscluster b {
  font-weight: 600;
}
.edittools .emphasiscluster i {
  font-family: Georgia, serif;
  font-style: italic;
}
.edittools .emphasiscluster u {
  text-underline-offset: 3px;
}
.edittools .fontcluster .selectcontrol {
  margin: 0;
  padding: 4px 8px;
}
.edittools .fontcluster #paragraphStyle + .selectcontrol {
  width: 124px;
  min-width: 100px;
}
.edittools .fontcluster #fontFamily + .selectcontrol {
  width: 132px;
  min-width: 110px;
}
.edittools .fontcluster #fontSize + .selectcontrol {
  width: 72px;
  min-width: 68px;
}
.edittools .historycluster button,
.edittools .paragraphcluster button {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 4px;
}
.edittools .paragraphcluster {
  gap: 6px;
}
.edittools .alignmenttools {
  margin-left: 6px;
}
.edittools .settingscluster button {
  width: auto;
  min-width: 0;
  white-space: nowrap;
}
.edittools .headerfill {
  flex: 1;
  min-width: 0;
}
.edittools .formconnection {
  margin-left: auto;
}
@media (max-width: 760px) {
  .formatbar.edittools {
    padding: 6px 8px;
    gap: 6px 8px;
    max-height: 176px;
    overflow-y: auto;
    overflow-x: hidden;
    flex-wrap: wrap;
  }
  .edittools .toolcluster + .toolcluster {
    padding-left: 0;
    border-left: 0;
  }
  .edittools .fontcluster {
    order: -1;
    width: 100%;
    gap: 6px;
  }
  .edittools .fontcluster .selectcontrol {
    height: 40px;
    min-height: 40px;
    font-size: 12px;
  }
  .edittools .fontcluster #paragraphStyle + .selectcontrol {
    flex: 1;
    width: 100px;
    min-width: 80px;
  }
  .edittools .fontcluster #fontFamily + .selectcontrol {
    flex: 1.2;
    width: 120px;
    min-width: 100px;
  }
  .edittools .fontcluster #fontSize + .selectcontrol {
    width: 68px;
    min-width: 60px;
  }
  .edittools .emphasiscluster button[id^='format-'],
  .edittools .historycluster button,
  .edittools .paragraphcluster button {
    height: 40px;
    min-height: 40px;
    width: 36px;
    min-width: 36px;
  }
  .edittools .settingscluster button {
    height: 40px;
    min-height: 40px;
  }
  .edittools .paragraphcluster {
    gap: 2px;
  }
  .edittools .alignmenttools {
    gap: 1px;
    margin-left: 3px;
  }
  .edittools .headerfill {
    display: none;
  }
  .edittools .formconnection {
    display: none;
  }
}

.templatelibraryheading {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}
.templatelibraryheading h2 {
  margin: 0;
}
.templatelibraryheading > button {
  font-size: 12px;
  color: var(--brand);
  text-align: right;
}
.templategroupname {
  font-size: 13px;
  margin: 24px 0 12px;
}
.templategrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.templatecard {
  min-width: 0;
}
.templatepaper {
  height: 225px;
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
  padding: 18px 14px;
  position: relative;
  color: var(--ink);
}
.templatepaper:after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 28px;
  background: linear-gradient(transparent, var(--surface));
  pointer-events: none;
}
.templatemini {
  font:
    8px/1.6 Arial,
    sans-serif;
  pointer-events: none;
}
.templatemini h3 {
  font-size: 10px;
  line-height: 1.4;
  margin: 4px 0 14px;
}
.templatemini h4 {
  font-size: 8px;
  margin: 12px 0 4px;
}
.templatemini p {
  font-size: 8px;
  margin: 5px 0;
  line-height: 1.6;
}
.templatemini table {
  width: 100%;
  border-collapse: collapse;
  font-size: 7px;
}
.templatemini td {
  border: 1px solid var(--line);
  padding: 3px;
}
.templatemini td p {
  font-size: 7px;
}
.templatecardfooter {
  padding: 10px 0;
}
.templatecardfooter strong {
  font-size: 12px;
  display: block;
  line-height: 1.5;
}
.templatecardfooter > div {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
}
.templatecardfooter button {
  font-size: 12px;
  min-height: 36px;
  padding: 4px 0;
}
.previewloading {
  font-size: 11px;
  color: var(--muted);
}
@media (max-width: 760px) {
  .templategrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .templatepaper {
    height: 190px;
    padding: 12px 9px;
  }
  .templatelibraryheading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
}
@media (max-width: 420px) {
  .templategrid {
    grid-template-columns: 1fr;
  }
  .templatepaper {
    height: 240px;
  }
  .templatemini {
    font-size: 10px;
  }
  .templatemini p {
    font-size: 10px;
  }
  .templatemini h3 {
    font-size: 12px;
  }
}

.insertchoices {
  display: flex;
  padding-bottom: 12px;
  margin-bottom: 14px;
  justify-content: space-between;
}
.insertchoices button {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 2px;
  white-space: nowrap;
}
.insertchoices button svg {
  width: 17px;
  height: 17px;
}
.quicktablechoices {
  display: grid;
  gap: 0;
}
.quicktablechoices button {
  display: block;
  width: 100%;
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 16px 4px;
  min-height: 60px;
}
.quicktablechoices strong,
.quicktablechoices span {
  display: block;
}
.quicktablechoices strong {
  font-size: 14px;
}
.quicktablechoices span {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  margin-top: 5px;
}
.quicktablechoices button:hover {
  background: var(--canvas);
}

.paper:has(> .documentpage) {
  background: transparent;
  border: 0;
  box-shadow: none;
  min-height: 0 !important;
  padding: 0 !important;
}
.documentpage {
  position: relative;
  box-sizing: border-box;
  background: var(--surface);
  border: 1px solid var(--line);
  margin: 0 0 22px;
  display: flow-root;
}
.documentpage:last-child {
  margin-bottom: 0;
}
.pagelabel {
  position: absolute;
  bottom: 22px;
  right: 30px;
  font:
    11px/1.4 Arial,
    sans-serif;
  color: var(--muted);
  pointer-events: none;
  user-select: none;
}
.documentpage > .pagebreakbefore {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}
.pageoverflowwarning {
  padding: 8px 16px;
  background: var(--canvas);
  color: var(--finding-text);
  font-size: 12px;
  line-height: 1.5;
}
.pageoverflowwarning[hidden] {
  display: none;
}
.documentpage > .pageoverflow {
  outline: 1px dashed var(--finding-text);
  outline-offset: 4px;
}
#pageStatus {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}

.documentpage > .pagefurniture {
  position: absolute;
  display: block;
  width: auto;
  min-height: 0;
  height: auto;
  padding: 2px 0;
  border: 1px solid transparent;
  background: transparent;
  white-space: pre-line;
  font:
    12px/1.6 Arial,
    sans-serif;
  color: var(--muted);
  border-radius: 2px;
  overflow-wrap: anywhere;
}
.documentpage > .pagefurniture:hover {
  border-color: var(--line);
  background: var(--canvas);
}
.documentpage > .pagefurniture:focus-visible {
  outline: 2px solid var(--brand);
}
.documentpage > .pagefurniture.pageheader {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.furnitureinput {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 8px;
  margin-bottom: 16px;
}
.furnitureinput input,
.furnitureinput .selectcontrol {
  min-width: 0;
  margin: 0;
}
@media (max-width: 480px) {
  .furnitureinput {
    grid-template-columns: 1fr;
  }
  .furnitureinput .selectcontrol {
    width: 100%;
  }
}

.pageworkbench {
  display: flex;
  position: relative;
  flex: 1;
  min-height: 0;
  min-width: 0;
}
.pageworkbench > .paperscroll {
  min-width: 0;
}
#pageNavigator {
  flex: none;
  overflow-y: auto;
  box-sizing: border-box;
}
#pageNavigator[hidden] {
  display: none;
}
.pagenavheading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pagenavheading button {
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 20px;
  color: var(--muted);
}
.pagethumbnail {
  display: block;
  width: 100%;
  padding: 5px;
  margin: 0 0 14px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
}
.pagethumbnail:hover {
  background: var(--canvas);
}
.thumbnailviewport {
  display: block;
  width: 112px;
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  pointer-events: none;
  box-sizing: content-box;
}
.thumbnailviewport > .thumbnailpaper {
  display: block !important;
  position: absolute !important;
  top: 0;
  left: 0;
  min-height: 0 !important;
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  zoom: 1 !important;
  transform-origin: top left;
  box-shadow: none !important;
}
.thumbnailpaper > .documentpage {
  margin: 0;
  box-shadow: none;
}
.thumbnumber {
  display: block;
  font-size: 11px;
  color: var(--muted);
  padding-top: 8px;
  line-height: 1.4;
}
#pageStatus {
  padding: 2px 5px;
  border-radius: 3px;
}
#pageStatus:hover {
  background: var(--canvas);
  color: var(--brand);
}
@media (max-width: 760px) {
  #pageNavigator {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 6;
    box-shadow: 5px 0 20px color-mix(in srgb, var(--ink) 10%, transparent);
  }
  .pagenavheading button {
    height: 36px;
    width: 36px;
  }
}

.transferexcerpt {
  max-height: 150px;
  overflow: auto;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.7;
  padding: 12px 0;
  color: var(--muted);
  border-bottom: 1px solid var(--canvas);
}
.transfermode {
  display: flex;
  gap: 4px;
  margin: 16px 0 10px;
}
.transfermode button {
  padding: 8px 16px;
  border-radius: 5px;
  font-size: 12px;
}
.transfermode button[aria-pressed='true'] {
  background: var(--canvas);
  color: var(--brand);
}
.transferdestinations {
  max-height: 280px;
  overflow: auto;
}
.transferdestinations button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 12px 4px;
  font-size: 13px;
  border-bottom: 1px solid var(--canvas);
  text-align: left;
}
.transferdestinations button:hover {
  background: var(--canvas);
}
.transferdestinations span {
  color: var(--muted);
}

/* The trash glyph is drawn on a 3-unit grid so its strokes stay crisp at 16 px. */
#deleteParagraph svg,
[data-tableremove] svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

/* Finding actions and text links in the Kontrola panel and export dialog stay easy to tap. */
@media (max-width: 760px) {
  #checkPane .findingactions button,
  #checkPane .linkbutton,
  #checkPane .fixsafe,
  dialog#modal.exportdialog .linkbutton {
    min-height: 44px;
  }
}

/* Inside a host program the mark alone identifies Tessera; the name would cost toolbar room. */
body.embedded .compactheader .wordmark .tesserawordmark {
  display: none;
}
