.node-summary-dialog,
.node-summary-dialog :is(#timetree-context-menu, #timeline-context-menu) {
  max-width: none;
}

.node-summary-dialog :is(#timetree-context-menu, #timeline-context-menu) {
  overflow: hidden;
}

/* jQuery UI 1.11 calculates resizable dialogs as content-box elements. */
.node-summary-dialog.ui-dialog {
  box-sizing: content-box;
}

/* The deployed jQuery UI close button does not contain a usable icon. */
.node-summary-dialog .ui-dialog-titlebar-close::before {
  color: #fff;
  content: '\00d7';
  display: block;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 27px;
  text-align: center;
}
.node-summary-dialog .ui-dialog-titlebar-close .ui-icon,
.node-summary-dialog .ui-dialog-titlebar-close .ui-button-text,
.node-summary-dialog .ui-dialog-title { display: none; }
.node-summary-dialog .ui-dialog-titlebar {
  background: transparent;
  border: 0;
  box-sizing: border-box;
  margin-bottom: 2px;
  min-height: 32px;
  padding: 0;
}
.node-summary-dialog .ui-dialog-titlebar-close {
  height: 32px;
  margin: 0;
  right: 0;
  top: 0;
  width: 32px;
}

.node-summary-dialog .ui-dialog-content,
.node-summary-dialog .ui-dialog-titlebar { cursor: move; }
.node-summary-dialog a, .node-summary-dialog button { cursor: pointer; }
.node-summary-dialog .context-menu-item-name,
.node-summary-dialog .context-menu-item-value { cursor: text; }
.node-summary-dialog table { cursor: default; }

.node-summary-dialog .node-summary-tabs {
  border-bottom: 2px solid #3e7ac1;
  display: flex;
  gap: 3px;
  height: 32px;
  margin: 0 36px 0 0;
}
.node-summary-dialog .node-summary-tab {
  background: #e7edf5;
  border: 1px solid #9aafc8;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
  color: #284d73;
  font-family: Raleway, Arial, sans-serif;
  font-size: .875rem;
  font-weight: 700;
  margin-bottom: -2px;
  padding: 6px 12px;
}
.node-summary-dialog .node-summary-tab:hover,
.node-summary-dialog .node-summary-tab:focus { background: #d1dfef; }
.node-summary-dialog .node-summary-tab.is-active {
  background: #3e7ac1;
  border-color: #3e7ac1;
  color: #fff;
}
:is(#timetree-context-menu, #timeline-context-menu) .node-summary-tab-pane.hidden { display: none; }
/* Keep the same ID-scoped specificity as ZooTree. Without it, the generic
 * DataTables rules in widget.css override cell padding and expand the table
 * beyond its fixed-layout viewport. */
:is(#timetree-context-menu, #timeline-context-menu) .node-summary-row { margin-bottom: 6px; }
:is(#timetree-context-menu, #timeline-context-menu) .node-summary-message { padding: 12px 0; }
:is(#timetree-context-menu, #timeline-context-menu) .node-study-table-wrapper { margin-top: 8px; overflow: visible; }
:is(#timetree-context-menu, #timeline-context-menu) .node-study-table { border-collapse: collapse; box-sizing: border-box; font-size: .85rem; table-layout: fixed; width: 100% !important; }
:is(#timetree-context-menu, #timeline-context-menu) .node-study-table col.node-study-time-column { width: 76px; }
:is(#timetree-context-menu, #timeline-context-menu) .node-study-table col.node-study-author-column { width: 112px; }
:is(#timetree-context-menu, #timeline-context-menu) .node-study-table col.node-study-year-column { width: 58px; }
:is(#timetree-context-menu, #timeline-context-menu) .node-study-table col.node-study-data-column { width: 70px; }
:is(#timetree-context-menu, #timeline-context-menu) .node-study-table th,
:is(#timetree-context-menu, #timeline-context-menu) .node-study-table td { border: 1px solid #ddd; padding: 4px 6px; vertical-align: top; }
:is(#timetree-context-menu, #timeline-context-menu) .node-study-table td:nth-child(2) { overflow-wrap: anywhere; }
:is(#timetree-context-menu, #timeline-context-menu) .node-study-table th { background: #3e7ac1; color: #fff; font-weight: 700; line-height: 1.1; padding: 4px 22px 4px 6px; position: sticky; top: 0; z-index: 3; }
:is(#timetree-context-menu, #timeline-context-menu) .node-study-table th:hover { background: #000; }
:is(#timetree-context-menu, #timeline-context-menu) .node-study-table th .DataTables_sort_wrapper { min-height: 16px; position: relative; }
:is(#timetree-context-menu, #timeline-context-menu) .node-study-table th .DataTables_sort_icon { display: block; filter: brightness(0); }
:is(#timetree-context-menu, #timeline-context-menu) .node-study-table th:hover .DataTables_sort_icon { filter: brightness(0) invert(1); }
:is(#timetree-context-menu, #timeline-context-menu) .node-study-table-wrapper .dataTables_wrapper,
:is(#timetree-context-menu, #timeline-context-menu) .node-study-row-scroll { box-sizing: border-box; width: 100% !important; }
:is(#timetree-context-menu, #timeline-context-menu) .node-study-table-wrapper .dataTables_wrapper { overflow: visible; }
:is(#timetree-context-menu, #timeline-context-menu) .node-study-row-scroll { height: 180px; max-height: 180px; overflow-x: auto !important; overflow-y: auto !important; overscroll-behavior: contain; }
:is(#timetree-context-menu, #timeline-context-menu) .node-study-row-scroll table.dataTable.no-footer { margin-bottom: 0; }
:is(#timetree-context-menu, #timeline-context-menu) .node-study-table-wrapper .dt-buttons { justify-content: flex-start; margin: 0 0 8px; }
:is(#timetree-context-menu, #timeline-context-menu) .node-study-table-wrapper .dt-button { line-height: 1.1; min-height: 0; }
:is(#timetree-context-menu, #timeline-context-menu) .node-study-table-wrapper .dt-button .ui-button-text { padding: .3em .65em; }
:is(#timetree-context-menu, #timeline-context-menu) .node-study-column-resizer { bottom: 0; cursor: col-resize; position: absolute; top: 0; width: 7px; z-index: 2; }
:is(#timetree-context-menu, #timeline-context-menu) .node-study-column-resizer.is-left { left: -4px; }
:is(#timetree-context-menu, #timeline-context-menu) .node-study-column-resizer.is-right { right: -4px; }

@media (max-width: 599px), (hover: none) and (pointer: coarse) {
  /* Keep jQuery UI's resizable lifecycle initialized on mobile Firefox. The
   * mouse-only handles are hidden instead of disabling the widget, because
   * jQuery UI 1.11 can leave a disabled dialog wrapper hidden on that browser. */
  .node-summary-dialog .ui-resizable-handle,
  .zootree-node-summary-dialog .ui-resizable-handle { display: none !important; }

  .node-summary-dialog .node-summary-tab,
  .zootree-node-summary-dialog .zootree-summary-tab {
    font-size: .75rem !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  :is(#timetree-context-menu, #timeline-context-menu) .node-study-row-scroll,
  :is(#timetree-context-menu, #timeline-context-menu) .zootree-study-row-scroll { overflow-x: hidden !important; }
  :is(#timetree-context-menu, #timeline-context-menu) .node-summary-study-table,
  :is(#timetree-context-menu, #timeline-context-menu) .node-summary-study-table tbody { display: block; width: 100% !important; }

  :is(#timetree-context-menu, #timeline-context-menu) .node-summary-study-table colgroup,
  :is(#timetree-context-menu, #timeline-context-menu) .node-summary-study-table thead {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
  }

  :is(#timetree-context-menu, #timeline-context-menu) .node-summary-study-table tbody tr {
    background: #fff;
    border: 2px solid #9aafc8;
    border-radius: 4px;
    display: grid;
    grid-template-columns: .8fr .65fr 1.4fr .7fr;
    margin-bottom: 8px;
    overflow: hidden;
  }

  :is(#timetree-context-menu, #timeline-context-menu) .node-summary-study-table tbody td {
    border: 0;
    font-size: .75rem;
    min-width: 0;
    overflow-wrap: anywhere;
    padding: 5px;
  }

  :is(#timetree-context-menu, #timeline-context-menu) .node-summary-study-table tbody td::before {
    color: #555;
    display: block;
    font-size: .625rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
  }

  :is(#timetree-context-menu, #timeline-context-menu) .node-summary-study-time { grid-column: 1; grid-row: 1; }
  :is(#timetree-context-menu, #timeline-context-menu) .node-summary-study-time::before { content: 'Time'; }
  :is(#timetree-context-menu, #timeline-context-menu) .node-summary-study-year { grid-column: 2; grid-row: 1; }
  :is(#timetree-context-menu, #timeline-context-menu) .node-summary-study-year::before { content: 'Year'; }
  :is(#timetree-context-menu, #timeline-context-menu) .node-summary-study-author { grid-column: 3; grid-row: 1; }
  :is(#timetree-context-menu, #timeline-context-menu) .node-summary-study-author::before { content: 'Author'; }
  :is(#timetree-context-menu, #timeline-context-menu) .node-summary-study-data { grid-column: 4; grid-row: 1; }
  :is(#timetree-context-menu, #timeline-context-menu) .node-summary-study-data::before { content: 'Data'; }
  :is(#timetree-context-menu, #timeline-context-menu) .node-summary-study-title {
    background: #f3f6fa;
    border-top: 1px solid #9aafc8;
    grid-column: 1 / -1;
    grid-row: 2;
  }
  :is(#timetree-context-menu, #timeline-context-menu) .node-summary-study-title::before { content: 'Title'; }

  :is(#timetree-context-menu, #timeline-context-menu) .zootree-study-table tbody tr {
    grid-template-columns: .8fr .65fr 1.55fr;
  }
}
