.tmx-app main {
  max-width: 1280px;
}

.tmx-app .pe-diff {
  padding: 1px 2px;
  border-radius: 3px;
  background: rgba(151, 72, 64, .2);
  box-shadow: none;
  color: #512722;
}

.dark-mode .tmx-app .pe-diff {
  background: rgba(255, 203, 135, .34);
  color: #fff8eb;
}

#diffToggleButton[aria-pressed="true"] {
  border-color: rgba(var(--accent-rgb), .52);
  background: rgba(var(--accent-rgb), .2);
  color: var(--accent-deep);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .14);
}

#diffToggleButton[aria-pressed="false"] .compiler-diff-icon { opacity: .5; }

.tmx-app.hide-diffs .pe-diff {
  padding: 0;
  background: transparent;
  color: inherit;
}

.compiler-diff-icon {
  font-size: 12px;
  font-weight: 850;
  letter-spacing: -1px;
}

.compiler-diff-icon::after {
  display: block;
  height: 3px;
  margin-top: 1px;
  border-radius: 3px;
  background: rgba(151, 72, 64, .58);
  content: "";
}

.tmx-upload-row {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 360px));
  justify-content: center;
  gap: 14px;
  min-width: 0;
}

.tmx-upload-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
  min-height: 0;
  padding: 12px 14px;
  overflow: visible;
}

.tmx-upload-panel[hidden] {
  display: none;
}

.tmx-upload-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.post-edit-panel {
  color: var(--muted);
}

.post-edit-panel:not(.is-active) .tmx-upload-heading strong,
.post-edit-panel:not(.is-active) .pe-starter-actions .file-upload-label,
.post-edit-panel:not(.is-active) .pe-starter-actions button {
  opacity: .58;
  filter: grayscale(.45);
  transition: opacity .16s ease, filter .16s ease, color .16s ease;
}

.post-edit-panel:hover .tmx-upload-heading strong,
.post-edit-panel:focus-within .tmx-upload-heading strong,
.post-edit-panel:hover .pe-starter-actions .file-upload-label,
.post-edit-panel:focus-within .pe-starter-actions .file-upload-label,
.post-edit-panel:hover .pe-starter-actions button,
.post-edit-panel:focus-within .pe-starter-actions button,
.post-edit-panel.is-active .tmx-upload-heading strong {
  opacity: 1;
  filter: none;
}

.tmx-upload-panel strong {
  min-width: 0;
  color: var(--accent-deep);
  font-size: 13px;
}

.pe-help-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  margin-left: 4px;
  border: 1px solid rgba(var(--accent-rgb), .28);
  border-radius: 50%;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
  vertical-align: text-bottom;
}

.pe-starter-actions .has-tip::after,
.pe-help-icon.has-tip::after {
  z-index: 60;
}

.pe-starter-actions .has-tip:last-child::after {
  right: 0;
  left: auto;
  transform: translateY(4px);
}

.pe-starter-actions .has-tip:last-child:hover::after,
.pe-starter-actions .has-tip:last-child:focus-visible::after {
  transform: translateY(0);
}

.post-edit-panel:hover .pe-help-icon,
.post-edit-panel:focus-within .pe-help-icon {
  border-color: rgba(var(--accent-rgb), .48);
  color: var(--accent-deep);
}

.tmx-upload-heading button {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 4px 10px;
  font-size: 12px;
}

.tmx-upload-heading button[hidden] {
  display: none;
}

.tmx-upload-panel .file-upload {
  display: flex;
  justify-content: center;
  min-height: 0;
  padding: 0;
  border-bottom: 0;
}

.tmx-upload-panel .file-upload[hidden] {
  display: none;
}

.pe-starter-actions {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}

.pe-starter-actions[hidden] {
  display: none;
}

.pe-starter-actions .file-upload-label,
.pe-starter-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, .48);
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  text-transform: none;
  box-shadow: 0 4px 10px rgba(var(--shadow-rgb), .04);
}

.pe-starter-actions .file-upload:hover .file-upload-label,
.pe-starter-actions button:hover {
  border-color: rgba(var(--accent-rgb), .38);
  background: rgba(var(--accent-rgb), .11);
}

.pe-choice-separator {
  width: 1px;
  min-height: 30px;
  background: var(--line);
}

.tmx-file-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  overflow: visible;
}

.tmx-file-actions[hidden] {
  display: none;
}

.tmx-file-name {
  min-width: 0;
  overflow: hidden;
  color: var(--accent-deep);
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tmx-upload-panel .file-upload-label {
  min-height: 42px;
  padding: 8px 12px;
  border-radius: 11px;
  font-size: 13px;
}

.tmx-file-actions button {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 13px;
}

.tmx-app .controls {
  display: flex;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
}

.tmx-app .display-controls {
  display: grid;
  justify-content: center;
  gap: 10px;
}

.tmx-resize-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.tmx-header-actions {
  flex-wrap: nowrap;
}

.tmx-header-actions.is-sticky {
  position: fixed;
  top: 92px;
  right: max(3vw, 22px);
  z-index: 12;
  padding: 3px;
  border: 1px solid rgba(var(--accent-rgb), 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
  box-shadow: 0 6px 16px rgba(var(--shadow-rgb), 0.06);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  flex-direction: column;
}

.dark-mode .tmx-header-actions.is-sticky {
  background: rgba(24, 43, 45, 0.4);
}

.tmx-header-actions.is-sticky .has-tip::after {
  left: auto;
  right: calc(100% + 9px);
  bottom: auto;
  top: 50%;
  transform: translate(4px, -50%);
}

.tmx-header-actions.is-sticky .has-tip:hover::after,
.tmx-header-actions.is-sticky .has-tip:focus-visible::after {
  transform: translate(0, -50%);
}

.tmx-icon-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 50%;
}

#showTagsButton[aria-pressed="true"] {
  border-color: rgba(var(--accent-rgb), 0.42);
  background: var(--accent);
  color: #f7fffb;
}

.tmx-view-icon {
  position: relative;
  width: 17px;
  height: 21px;
  padding: 3px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.tmx-view-icon span {
  display: none;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.tmx-view-icon span:nth-child(-n + 3) {
  display: block;
  margin-bottom: 3px;
}

.tmx-icon-button.is-alignment-view .tmx-view-icon {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px 4px;
  width: 22px;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
}

.tmx-icon-button.is-alignment-view .tmx-view-icon span {
  display: block;
  height: 3px;
  margin: 0;
}

.tmx-tags-icon {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -0.12em;
  transform: translateX(-1px);
}

.tmx-resize-controls .text-size-controls,
.tmx-resize-controls .column-width-controls {
  min-width: min(360px, 88vw);
}

#viewToggleButton:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.tmx-grid.whole-text-view .row-number {
  display: none;
}

.tmx-grid.whole-text-view {
  position: relative;
  grid-template-columns: minmax(180px, var(--whole-column-1, 50%)) minmax(180px, var(--whole-column-2, 50%)) !important;
}

.tmx-grid.whole-text-view:has(.post-edit-cell) {
  grid-template-columns: minmax(180px, var(--whole-column-1, 33.33%)) minmax(180px, var(--whole-column-2, 33.34%)) minmax(180px, 1fr) !important;
}

.tmx-grid.is-sticky-headers .head {
  top: 12px;
}

.tmx-grid .aligned-text,
.tmx-grid .tmx-text {
  min-height: 34px;
}

.tmx-text {
  width: 100%;
  padding: 14px 15px;
  color: var(--ink);
  font-size: var(--alignment-text-size, 16px);
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.tmx-tag {
  color: var(--danger-deep);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
}

.post-edit-head {
  background: rgba(184, 218, 208, 0.96);
}

.post-edit-cell {
  background: rgba(220, 238, 232, 0.92);
}

.dark-mode .post-edit-head {
  background: rgba(48, 91, 88, 0.96);
  color: var(--ink);
}

.dark-mode .post-edit-cell {
  background: rgba(38, 68, 67, 0.96);
}

.dark-mode .post-edit-cell .tmx-text {
  color: var(--ink);
}

.post-edit-editor:focus {
  outline: 0;
  background: rgba(255, 255, 255, 0.38);
  box-shadow: inset 0 0 0 2px rgba(var(--accent-rgb), 0.18);
}

.whole-text-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--whole-column-1, 50%);
  z-index: 8;
  width: 14px;
  margin-left: -7px;
  cursor: col-resize;
}

.whole-text-divider[data-divider-index="1"] {
  left: calc(var(--whole-column-1, 33.33%) + var(--whole-column-2, 33.34%) + 7px);
}

.post-edit-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.pe-export-actions {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 9px;
  pointer-events: none;
}

.export-post-edit {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 50%;
  pointer-events: auto;
}

.export-post-edit-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pe-export-menu {
  position: absolute;
  inset: 4px 42px 4px 4px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-width: 0;
  padding: 5px 7px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  opacity: 0;
  transform: translateX(20px) scaleX(0.9);
  transform-origin: right center;
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.pe-export-menu.is-open {
  opacity: 1;
  transform: translateX(0) scaleX(1);
  pointer-events: auto;
}

.pe-export-menu button {
  width: auto;
  min-height: 30px;
  padding: 4px 10px;
  white-space: nowrap;
  border-color: rgba(var(--accent-rgb), 0.38);
  background: rgba(255, 255, 255, 0.9);
  color: var(--accent-deep);
  box-shadow: 0 8px 18px rgba(var(--shadow-rgb), 0.18);
}

.pe-export-menu button:hover {
  border-color: rgba(var(--accent-rgb), 0.58);
  background: rgba(255, 255, 255, 0.98);
  color: var(--accent-deep);
  box-shadow: 0 10px 22px rgba(var(--shadow-rgb), 0.24);
}

.dark-mode .pe-export-menu {
  background: transparent;
}

.dark-mode .pe-export-menu button {
  background: rgba(31, 78, 78, 0.94);
  color: var(--ink);
}

.dark-mode .pe-export-menu button:hover {
  background: rgba(45, 104, 101, 0.98);
  color: var(--ink);
}

#loadedPostEditActions {
  padding-top: 3px;
}

@media (max-width: 720px) {
  .tmx-upload-row {
    grid-template-columns: minmax(0, 1fr);
  }

}
