/* Snippets (QA #343): the 13 Nov design's assets/css/snippets.css as is, except the ".check" rules, scoped under .mt-page so they cannot reach other pages. */
/* =================== MESSAGE TEMPLATES =================== */
.mt-page {
  --mt-btn-radius: var(--radius-sm);
  --mt-field-radius: var(--radius-sm);
  --mt-z-modal: 1100;
  --mt-z-pop: 1300;
  --mt-z-toast: 1400;
  --mt-row-h: 58px;
}
/* modals / popovers / toasts are moved to <body> by the script so the app
   shell can never clip them; this wrapper only carries the scoped variables */
.mt-portal {
  height: 0;
  min-height: 0;
  /* Sequences SQ-3: on a page without the app shell (the sequence editor) <body> keeps the light
     text colour in dark mode, so the portal's content takes the theme's own. */
  color: var(--text);
}

/* base.css typo: "text-size-crmjust" is not a CSS property. Correct version: */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* base.css has the global :focus-visible rule commented out and removes the
   outline everywhere, so links, tabs, selects and custom controls had no
   keyboard focus indicator. Restored here for this page only. */
.mt-page a:focus-visible,
.mt-page button:focus-visible,
.mt-page [tabindex]:focus-visible,
.mt-page [contenteditable="true"]:focus-visible,
.mt-page summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.mt-page .btn-crm:focus-visible,
.mt-page .icon-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.mt-page .mt-editor:focus-visible {
  outline: none;
}

/* base.css gives .btn-crm / .input their radius from --radius-sm; this keeps
   the page switchable between square-ish and pill without touching base.css */
.mt-page .btn-crm {
  border-radius: var(--mt-btn-radius);
}
.mt-page .input {
  border-radius: var(--mt-field-radius);
  height: 40px;
  font-size: 14px;
}
.mt-page .input[type="search"]::-webkit-search-cancel-button {
  display: none;
}
.mt-page textarea.input {
  height: auto;
  padding: 10px 14px;
  line-height: 1.5;
  resize: vertical;
}

/* screen-reader only */
.mt-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.mt-grow {
  flex: 1 1 auto;
  min-width: 0;
}
.mt-noscript {
  padding: var(--sp-6);
  text-align: center;
  color: var(--danger);
}

/* checkbox "mixed" state (base.css .check has no indeterminate look) */
.mt-page .check input:indeterminate + .check__box {
  background: var(--brand);
  border-color: var(--brand);
}
.mt-page .check input:indeterminate + .check__box::after {
  width: 10px;
  height: 0;
  border: 0;
  border-top: 2px solid var(--brand-contrast);
  transform: none;
}
.mt-page .check .check__box {
  flex: none;
}

/* ==========================================================================
   2. PAGE LAYOUT
   ========================================================================== */
.mt-container {
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

/* top bar */
.mt-topbar {
  background: var(--surface);
  border-radius: 12px 12px 0 0;
  border-bottom: 1px solid var(--border);
}
.mt-topbar__in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  min-height: 72px;
  padding-top: var(--sp-3);
  padding-bottom: var(--sp-3);
  flex-wrap: wrap;
}
.mt-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.mt-topbar__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}
.mt-count {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-right: var(--sp-1);
}

/* toolbar */
.mt-main {
  border-radius: 0 0 12px 12px;
  background: var(--surface);
  min-height: calc(100vh - var(--header-h, 64px) - 72px);
  padding-bottom: var(--sp-12);
}
.mt-main:focus {
  outline: none;
}
.mt-toolbar {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-5) 0;
  flex-wrap: wrap;
}
.mt-search {
  position: relative;
  width: 260px;
  max-width: 100%;
}
.mt-search--block {
  width: 100%;
}
.mt-search .input {
  padding-right: 40px;
}
.mt-search__icon {
position: absolute;
    top: 49%;
    right: 10px;
    transform: translateY(-50%);
    color: var(--text-subtle);
    pointer-events: none;
}

/* table */
.mt-table-wrap {
  overflow-x: auto;
}
.mt-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 640px;
}
.mt-table th,
.mt-table td {
  text-align: left;
  padding: 0 var(--sp-3);
  vertical-align: middle;
}
.mt-table thead th {
  height: 52px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 1px solid var(--text);
}
[data-theme="dark"] .mt-table thead th {
  border-bottom-color: var(--border-strong);
}
.mt-col-check {
  width: 48px;
  padding-left: var(--sp-2) !important;
}
.mt-col-owner {
  width: 168px;
}
.mt-col-date {
  width: 152px;
}

.mt-sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  line-height: 1.25;
  text-align: left;
  border-radius: 6px;
  padding: 2px 0;
}
.mt-sort:hover,
.mt-sort.is-active {
  color: var(--text);
}
.mt-sort .icon {
  color: var(--text-subtle);
}
.mt-sort.is-active .icon {
  color: var(--text);
}

.mt-table tbody tr {
  height: var(--mt-row-h);
  border-bottom: 1px solid var(--border);
  transition: background-color var(--fast) var(--ease);
}
.mt-table tbody tr:hover,
.mt-table tbody tr.is-menu-open,
.mt-table tbody tr.is-selected {
  background: var(--surface-hover);
}
.mt-table tbody td {
  font-size: 14px;
  padding-top: 10px;
  padding-bottom: 10px;
}
.mt-cell-name {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-width: 0;
}
.mt-name-link {
  min-width: 0;
  font-weight: 600;
  font-size: 14px;
  color: var(--brand-ink);
  text-align: left;
  overflow-wrap: anywhere;
  border-radius: 4px;
}
.mt-name-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.mt-folder-tag {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 150px;
  padding: 2px 8px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface-3);
  border-radius: var(--radius-pill);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mt-cell-owner {
  line-height: 1.35;
  max-width: 130px;
  overflow-wrap: anywhere;
}
.mt-cell-empty {
  height: 160px;
  text-align: center !important;
  color: var(--text-muted);
}

/* bulk bar replaces the heading row while rows are selected */
.mt-bulk-row th {
  height: 52px;
  font-weight: 500;
  color: var(--text-muted);
}
.mt-bulk {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  flex-wrap: wrap;
}
.mt-bulk__count {
  font-size: 13.5px;
  color: var(--text-muted);
  white-space: nowrap;
}
.mt-bulk__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--brand-ink);
  border-radius: 6px;
  padding: 4px 2px;
}
.mt-bulk__btn:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
/* HUB-417: what the person may not change reads as switched off. */
.mt-bulk__btn:disabled,
.mt-bulk__btn:disabled:hover {
  opacity: 0.45;
  cursor: not-allowed;
  text-decoration: none;
}

/* pager */
.mt-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 0 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.mt-pager__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  font-size: 13px;
  line-height: 1;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  transition: background-color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.mt-pager__btn:hover:not([disabled]):not(.is-current) {
  background: var(--surface-hover);
}
.mt-pager__btn.is-current {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--border-strong);
  cursor: default;
}
.mt-pager__btn[disabled] {
  color: #b8c0cc;
  cursor: default;
}
.mt-pager__info {
  width: 100%;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-subtle);
  margin-top: var(--sp-2);
}

/* ==========================================================================
   3. SMALL CONTROLS
   ========================================================================== */
.mt-owner-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 8px;
  font-size: 14px;
  border-radius: var(--radius-sm);
  color: var(--text);
}
.mt-owner-btn:hover {
  background: var(--surface-hover);
}
.mt-owner-btn[aria-expanded="true"] {
  background: var(--surface-3);
}

.mt-actions-btn {
    flex: none;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 33px;
    padding: 0 9px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--mt-btn-radius);
    opacity: 0;
    transition: opacity var(--fast) var(--ease);
}
.mt-table tbody tr:hover .mt-actions-btn,
.mt-table tbody tr:focus-within .mt-actions-btn,
.mt-actions-btn[aria-expanded="true"] {
  opacity: 1;
}
@media (hover: none) {
  .mt-actions-btn {
    opacity: 1;
  }
}

.mt-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  border-radius: 6px;
  padding: 4px 2px;
}
.mt-link-btn:hover {
  color: var(--brand-ink);
}
.mt-link-btn--strong {
  color: var(--brand-ink);
  font-size: 14px;
}
.mt-link-btn--strong:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* small text dropdown trigger used inside the compose box ("No folder v") */
.mt-dd {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  border-radius: 6px;
  padding: 4px 4px;
  white-space: nowrap;
}
.mt-dd:hover,
.mt-dd[aria-expanded="true"] {
  background: var(--surface-3);
}
.mt-dd .icon {
  color: var(--text-muted);
}

/* ==========================================================================
   4. POPOVERS, MENUS, LIST BOXES, SELECT
   ========================================================================== */
.mt-layer {
  position: relative;
  z-index: var(--mt-z-pop);
}
.mt-pop {
  --arrow-x: 24px;
  position: fixed;
  z-index: var(--mt-z-pop);
  max-width: calc(100vw - 16px);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: mtPopIn 0.14s var(--ease);
  width: auto!important;min-width: auto;
}
.mt-pop::before {
  content: "";
  position: absolute;
  left: var(--arrow-x);
  width: 12px;
  height: 12px;
  margin-left: -6px;
  background: var(--surface);
  border: 1px solid var(--border);
  transform: rotate(45deg);
}
.mt-pop[data-place="bottom"]::before {
  top: -7px;
  border-right: 0;
  border-bottom: 0;
}
.mt-pop[data-place="top"]::before {
  bottom: -7px;
  border-left: 0;
  border-top: 0;
}
.mt-pop[data-place="right"]::before,
.mt-pop--noarrow::before {
  display: none;
}
@keyframes mtPopIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.mt-pop__pad {
  padding: var(--sp-4);
}

/* menu items */
.mt-menu {
  padding: var(--sp-2);
  min-width: 190px;
}
.mt-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  font-size: 14px;
  text-align: left;
  color: var(--text);
  border-radius: var(--radius-sm);
}
.mt-menu__item:hover,
.mt-menu__item.is-focus {
  background: var(--surface-3);
}
.mt-menu__item[disabled] {
  color: var(--text-subtle);
  cursor: not-allowed;
}
.mt-menu__item--danger {
  color: var(--danger);
}
.mt-menu__item .icon {
  color: var(--text-muted);
}
.mt-menu__item .mt-menu__chev {
  margin-left: auto;
}
.mt-menu__txt {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.mt-menu__sub {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* list box (searchable, grouped) */
.mt-listbox {
  display: flex;
  flex-direction: column;
  min-width: 220px;
  max-height: 340px;
}
.mt-listbox__search {
  position: relative;
  padding: var(--sp-3) var(--sp-3) var(--sp-2);
}
.mt-listbox__search .input {
  height: 38px;
  padding-right: 38px;
  border: 2px solid var(--brand);
  border-radius: var(--mt-field-radius);
}
.mt-listbox__search .mt-search__icon {
  right: 26px;
}
.mt-listbox__list {
  overflow-y: auto;
  padding: var(--sp-1) var(--sp-2) var(--sp-2);
  max-height: 260px;
  overscroll-behavior: contain;
}
.mt-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font-size: 14px;
  color: var(--text);
  border-radius: var(--radius-sm);
  cursor: pointer;
  overflow-wrap: anywhere;
}
.mt-opt:hover,
.mt-opt.is-focus {
  background: var(--surface-3);
}
.mt-opt[aria-selected="true"] {
  font-weight: 600;
}
.mt-opt[aria-disabled="true"] {
  color: var(--text-subtle);
  cursor: not-allowed;
}
.mt-opt .icon {
  color: var(--text-muted);
}
.mt-opt__txt {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.mt-opt__sub {
  font-size: 12.5px;
  font-weight: 400;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
}
.mt-opt__title {
  display: block;
}
.mt-group {
  padding: 12px 12px 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.mt-empty-opt {
  padding: 14px 12px;
  font-size: 13.5px;
  color: var(--text-muted);
}
.mt-listbox__foot {
  padding: var(--sp-3);
  border-top: 1px solid var(--border);
}

/* custom select button (looks like .input) */
.mt-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  width: 100%;
  height: 40px;
  padding: 0 12px;
  font-size: 14px;
  text-align: left;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--mt-field-radius);
  transition: border-color var(--fast) var(--ease);
}
.mt-select:hover {
  border-color: var(--text-subtle);
}
.mt-select[aria-expanded="true"] {
  border-color: var(--brand);
}
.mt-select[disabled] {
  opacity: 0.55;
  pointer-events: none;
}
.mt-select__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mt-select__label.is-placeholder {
  color: var(--text-subtle);
}
.mt-select .icon {
  color: var(--text-muted);
}

/* ==========================================================================
   5. MODALS, DRAWER, ALERTS
   ========================================================================== */
body.mt-lock {
  overflow: hidden;
}
.mt-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: var(--mt-z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5vh var(--sp-4) var(--sp-4);
  overflow-y: auto;
  background: rgba(16, 24, 40, 0.55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: mtFade 0.18s var(--ease);
}
[data-theme="dark"] .mt-overlay {
  background: rgba(2, 6, 14, 0.7);
}
@keyframes mtFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.mt-modal {
  width: 100%;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  animation: mtModalIn 0.2s var(--ease);
}
@keyframes mtModalIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.mt-modal--sm {
  max-width: 480px;
}
.mt-modal--md {
  max-width: 520px;
}
.mt-modal--ai {
  max-width: 720px;
}
.mt-modal--video {
  max-width: 560px;
}
.mt-modal--lib {
  max-width: 1080px;
}
.mt-modal--editor {
  max-width: 1280px;
}
.mt-modal--editor.is-solo {
  max-width: 800px;
}
.mt-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-4) var(--sp-4) var(--sp-8);
  border-bottom: 1px solid var(--border);
}
.mt-modal__head h2 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.mt-modal__body {
  padding: var(--sp-6) var(--sp-8);
  display: grid;
  gap: var(--sp-4);
}
.mt-modal__foot {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  padding: var(--sp-2) var(--sp-8) var(--sp-6);
}
.mt-modal__foot--split {
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-8);
  border-top: 1px solid var(--border);
}
.mt-text {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text);
}
.mt-text--lg {
  font-size: 15px;
}
.mt-text--sm {
  font-size: 12.5px;
}
.mt-text--muted {
  color: var(--text-muted);
}

.mt-alert {
  padding: var(--sp-4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.mt-alert strong {
  display: block;
  margin-bottom: 4px;
}
.mt-alert p {
  font-size: 14px;
  line-height: 1.5;
}
.mt-alert--warning {
  background: var(--warning-bg);
  border-color: var(--warning);    margin-bottom: 23px;
}

/* drawer */
.mt-overlay--drawer {
  align-items: stretch;
  justify-content: flex-end;
  padding: 0;
  overflow: hidden;
}
.mt-drawer {
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  height: 100%;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  animation: mtDrawerIn 0.24s var(--ease);
}
@keyframes mtDrawerIn {
  from {
    transform: translateX(40px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
.mt-drawer__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: var(--sp-6) var(--sp-8);
}
.mt-drawer .mt-modal__foot {
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
}

/* ==========================================================================
   6. RADIO, TABS, FOLDER LIST
   ========================================================================== */
.mt-radio-group {
  display: grid;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
}
.mt-radio {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14.5px;
  cursor: pointer;
  width: fit-content;
}
.mt-radio input {
  position: absolute;
  opacity: 0;
  width: 20px;
  height: 20px;
  margin: 0;
  cursor: pointer;
}
.mt-radio__dot {
  flex: none;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
  transition: border-color var(--fast) var(--ease);
}
.mt-radio__dot::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand);
  transform: scale(0);
  transition: transform var(--fast) var(--ease);
}
.mt-radio:hover .mt-radio__dot {
  border-color: var(--brand);
}
.mt-radio input:checked + .mt-radio__dot {
  border-color: var(--brand);
}
.mt-radio input:checked + .mt-radio__dot::after {
  transform: scale(1);
}
.mt-radio input:focus-visible + .mt-radio__dot {
  box-shadow: var(--focus-ring);
}
.mt-radio .mt-tip {
  display: inline-flex;
  color: var(--text-muted);
}

/* css tooltip: <span class="mt-tip" data-mt-tip="..."> */
.mt-tip {
  position: relative;
}
.mt-tip::after {
  content: attr(data-mt-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  width: max-content;
  max-width: 240px;
  padding: 6px 10px;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--bg);
  background: var(--text);
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--fast) var(--ease);
  z-index: 5;
}
.mt-tip:hover::after,
.mt-tip:focus-visible::after {
  opacity: 1;
}

.mt-tabs {
  display: flex;
  gap: var(--sp-6);
  margin: var(--sp-6) 0 var(--sp-4);
  border-bottom: 1px solid var(--border);
}
.mt-tab {
  position: relative;
  padding: 10px 6px 12px;
  font-size: 14px;
  color: var(--text-muted);
}
.mt-tab[aria-selected="true"] {
  font-weight: 600;
  color: var(--text);
}
.mt-tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--text);
}
.mt-checklist {
  display: grid;
  gap: var(--sp-1);
  max-height: 46vh;
  overflow-y: auto;
  padding: 2px;
}
.mt-checklist .check {
  padding: 8px 6px;
  font-size: 14.5px;
  color: var(--text);
  border-radius: var(--radius-sm);
}
.mt-checklist .check:hover {
  background: var(--surface-hover);
}

.mt-folder-list {
  display: grid;
  gap: 2px;
  max-height: 46vh;
  overflow-y: auto;
  margin: 0 calc(var(--sp-2) * -1);
  padding: 2px var(--sp-2);
}
.mt-folder-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  font-size: 14.5px;
  text-align: left;
  border-radius: var(--radius-sm);
  color: var(--text);
}
.mt-folder-item:hover {
  background: var(--surface-hover);
}
.mt-folder-item[aria-selected="true"] {
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-weight: 600;
}
.mt-folder-item .icon {
  color: var(--text-muted);
}
.mt-folder-item[aria-selected="true"] .icon {
  color: inherit;
}

/* ==========================================================================
   7. TEMPLATE EDITOR
   ========================================================================== */
.mt-ed {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--sp-6);
  padding: var(--sp-5) var(--sp-8) var(--sp-4);
}
.mt-modal--editor.is-solo .mt-ed {
  grid-template-columns: minmax(0, 1fr);
}
.mt-modal--editor.is-solo .mt-ed__previewcol {
  display: none;
}
.mt-ed__col {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  min-width: 0;
}
.mt-ed__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  min-height: 34px;
}
.mt-ed__head h3 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
}
.mt-ed__showprev {
  display: none;
}
.mt-modal--editor.is-solo .mt-ed__showprev {
  display: inline-flex;
}

/* compose box */
.mt-compose {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--text);
  border-radius: var(--radius-sm);
  background: var(--surface);
  min-height: 540px;
}
[data-theme="dark"] .mt-compose {
  border-color: var(--border-strong);
}
.mt-compose:focus-within {
  border-color: var(--brand);
}
.mt-compose__row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 42px;
  padding: 0 var(--sp-3);
  border-bottom: 1px solid var(--border-strong);
}
.mt-compose__row.is-invalid {
  box-shadow: inset 0 0 0 2px var(--danger);
}
.mt-compose__meta {
  gap: var(--sp-5);
  flex-wrap: wrap;
  padding-top: 4px;
  padding-bottom: 4px;
}
.mt-compose__owner {
  font-size: 13.5px;
  color: var(--text);
}
.mt-compose__lbl {
  flex: none;
  font-size: 13.5px;
  font-weight: 600;
}
.mt-compose__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 36px;
  padding: 0 4px;
  font-size: 14px;
  color: var(--text);
  background: transparent;
  border: 0;
}
.mt-compose__input::placeholder {
  color: var(--text-subtle);
}
.mt-compose__input:focus {
  outline: none;
}

.mt-editor {
  flex: 1 1 auto;
  min-height: 280px;
  max-height: 46vh;
  overflow-y: auto;
  padding: var(--sp-4) var(--sp-5);
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  overflow-wrap: anywhere;
}
.mt-editor:empty::before {
  content: attr(data-mt-placeholder);
  color: var(--text-subtle);
  pointer-events: none;
}
.mt-editor p,
.mt-editor div {
  margin: 0 0 14px;
}
.mt-editor ul,
.mt-editor ol {
  margin: 0 0 14px;
  padding-left: 28px;
}
.mt-editor ul {
  list-style: disc;
}
.mt-editor ol {
  list-style: decimal;
}
.mt-editor a {
  color: var(--brand-ink);
  text-decoration: underline;
}
.mt-editor img {
  display: inline-block;
  max-width: 100%;
  height: auto;
}
.mt-editor .mt-doc-preview {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

/* personalization token chip */
.mt-token {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 6px;
  margin: 0 1px;
  font-size: 14px;
  line-height: 20px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--text-muted);
  border-radius: 6px;
  vertical-align: baseline;
  cursor: pointer;
  user-select: all;
}
.mt-token .icon {
  color: var(--text-muted);
}
.mt-token:hover {
  background: var(--surface-hover);
}
.mt-token.is-selected,
.mt-token:focus-visible {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand);
}
.mt-lib__preview .mt-token,
.mt-mail .mt-token {
  cursor: default;
}

.mt-compose__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-4);
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.mt-sig {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.mt-sig .link {
  font-size: 13px;
}
.mt-suggest {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-muted);
  border-radius: 6px;
  padding: 2px 4px;
}
.mt-suggest:hover {
  color: var(--text);
}
.mt-badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--bg);
  background: var(--success);
  border-radius: var(--radius-pill);
}
.mt-badge.is-zero {
  background: var(--text-subtle);
}

.mt-fmt {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  padding: 4px var(--sp-3) var(--sp-3);
}
.mt-fmt__btn,
.mt-fmt__txt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 30px;
  min-width: 30px;
  padding: 0 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 6px;
}
.mt-fmt__btn:hover,
.mt-fmt__txt:hover,
.mt-fmt__txt[aria-expanded="true"],
.mt-fmt__btn.is-on {
  background: var(--surface-3);
  color: var(--text);
}
.mt-fmt__txt {
  color: var(--text);
}
.mt-fmt__ai {
  margin-left: auto;
}

/* more-formatting popover */
.mt-moretools {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 10px;
}
.mt-moretools .mt-fmt__txt {
  min-width: 0;
}
.mt-moretools__sep {
  width: 1px;
  height: 18px;
  margin: 0 6px;
  background: var(--border);
}
.mt-swatches {
  display: grid;
  grid-template-columns: repeat(6, 26px);
  gap: 6px;
  padding: var(--sp-3);
}
.mt-swatch {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
}
.mt-swatch:hover {
  transform: scale(1.08);
}

/* insert menu + panels */
.mt-insert {
  width: 360px;
  max-width: calc(100vw - 24px);
}
.mt-panel__head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
}
.mt-panel__back {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: var(--text-muted);
}
.mt-panel__back:hover {
  background: var(--surface-3);
  color: var(--text);
}
.mt-panel__sep {
  width: 1px;
  height: 20px;
  background: var(--border-strong);
}
.mt-panel__title {
  font-size: 13.5px;
  font-weight: 700;
}
.mt-panel__right {
  margin-left: auto;
  display: flex;
  gap: var(--sp-2);
}
.mt-panel__body {
  display: grid;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-4);
}
.mt-panel__body h3{padding-top: 10px;}
.mt-panel__body .field__label {
  font-size: 13.5px;
}
.mt-panel__actions {
  display: flex;
  gap: var(--sp-2);
  padding-top: var(--sp-2);
}
.mt-panel__list {
  max-height: 280px;
  overflow-y: auto;
  padding: 0 var(--sp-2) var(--sp-3);
}
.mt-snippet {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px 12px;
  text-align: left;
  border-radius: var(--radius-sm);
}
.mt-snippet:hover {
  background: var(--surface-3);
}
.mt-snippet__name {
  font-size: 14px;
  font-weight: 600;
}
.mt-snippet__text {
  font-size: 12.5px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mt-panel__search {
  position: relative;
  padding: 0 var(--sp-4) var(--sp-2);
}
.mt-panel__search .input {
  height: 38px;
  padding-right: 38px;
}
.mt-panel__search .mt-search__icon {
  right: 28px;
}
.mt-checks {
  display: grid;
  gap: 2px;
}
.mt-checks .check {
  padding: 9px 10px;
  color: var(--text);
  font-size: 14px;
  border-radius: var(--radius-sm);
}
.mt-checks .check:hover {
  background: var(--surface-3);
}
.mt-radio-block {
  display: grid;
  gap: var(--sp-2);
}
.mt-radio-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
}
.mt-radio-row .link {
  font-size: 13px;
}
.mt-suggest-list {
  display: grid;
  gap: var(--sp-3);
  width: 320px;
  max-width: calc(100vw - 24px);
  padding: var(--sp-4);
}
.mt-suggest-list li {
  display: flex;
  gap: 10px;
  font-size: 13.5px;
  line-height: 1.45;
}
.mt-suggest-list .icon {
  margin-top: 2px;
  color: var(--warning);
}
.mt-suggest-list .is-ok .icon {
  color: var(--success);
}

/* ==========================================================================
   8. PREVIEW PANE
   ========================================================================== */
.mt-preview-pick {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.mt-preview {
  flex: 1 1 auto;
  min-height: 540px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: auto;
}
.mt-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: var(--sp-4);
  min-height: 538px;
  padding: var(--sp-8);
  text-align: center;
  font-size: 14px;
  color: var(--text);
}
.mt-empty__art {
  width: 170px;
  height: auto;
}
.mt-mail {
  padding: var(--sp-5);
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}
.mt-mail__meta {
  display: grid;
  gap: 6px;
  padding-bottom: var(--sp-4);
  margin-bottom: var(--sp-4);
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.mt-mail__meta dt {
  display: inline;
  font-weight: 700;
  color: var(--text-muted);
}
.mt-mail__meta dd {
  display: inline;
  margin: 0 0 0 6px;
}
.mt-mail p {
  margin: 0 0 14px;
}
.mt-mail ul,
.mt-mail ol {
  margin: 0 0 14px;
  padding-left: 28px;
}
.mt-mail ul {
  list-style: disc;
}
.mt-mail ol {
  list-style: decimal;
}
.mt-mail a {
  color: var(--brand-ink);
  text-decoration: underline;
}
.mt-mail__sig {
  margin-top: var(--sp-5);
  padding-top: var(--sp-3);
  border-top: 1px dashed var(--border-strong);
  font-size: 13px;
  color: var(--text-muted);
}
.mt-mail__sig strong {
  display: block;
  color: var(--text);
}

/* ==========================================================================
   9. LIBRARY, AI MODAL, VIDEO MODAL
   ========================================================================== */
.mt-lib {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  height: min(560px, 62vh);
  border-bottom: 0;
}
.mt-lib__list {
  overflow-y: auto;
  padding: 0 var(--sp-6) var(--sp-4) var(--sp-6);
}
.mt-lib__cat {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: var(--sp-4) 0 var(--sp-2);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--surface);
  border-bottom: 1px solid var(--text);
}
[data-theme="dark"] .mt-lib__cat {
  border-bottom-color: var(--border-strong);
}
.mt-lib__item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  width: 100%;
  padding: 14px 8px;
  text-align: left;
  border-radius: 0;
  cursor: pointer;
}
.mt-lib__item:hover,
.mt-lib__item.is-active {
  background: var(--surface-hover);
}
.mt-lib__item .check {
  margin-top: 1px;
}
.mt-lib__name {
  display: block;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
}
.mt-lib__desc {
  display: block;
  margin-top: 4px;
  font-size: 13.5px;
  color: var(--text-muted);
}
.mt-lib__preview {
  overflow-y: auto;
  padding: var(--sp-8) var(--sp-8);
  background: var(--surface-3);
  font-size: 14px;
}
.mt-lib__preview .mt-lib__row {
  margin-bottom: var(--sp-4);
  font-size: 13.5px;
}
.mt-lib__preview .mt-lib__row strong {
  margin-right: 10px;
}
.mt-lib__preview .mt-mail {
  padding: 0;
}
.mt-lib__count {
  font-size: 14px;
  color: var(--text);
}

.mt-ai {
  gap: var(--sp-5);
}
.mt-ai__badge {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--gradient-3);
  border-radius: 6px;
}
.mt-ai .field__label {
  font-size: 13.5px;
}
.mt-tones {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--sp-3);
}
.mt-tones__row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4) var(--sp-5);
}
.mt-tones .check {
  color: var(--text);
  font-size: 14.5px;
}

.mt-vid {
  display: grid;
  justify-items: center;
  gap: var(--sp-4);
  padding: var(--sp-8) var(--sp-6);
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.mt-vid__logo {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.mt-vid__mark {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: inset 0 0 0 6px var(--teal-bg);
}
.mt-vid__word {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.mt-vid__title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.mt-vid__text {
  max-width: 340px;
  font-size: 14px;
  color: var(--text-muted);
}
.mt-vid__alt {
  font-size: 14px;
  color: var(--text-muted);
}

/* ==========================================================================
   10. TOASTS
   ========================================================================== */
.mt-toasts {
  position: fixed;
  left: 50%;
  bottom: var(--sp-6);
  transform: translateX(-50%);
  z-index: var(--mt-z-toast);
  display: grid;
  gap: var(--sp-2);
  width: max-content;
  max-width: calc(100vw - 24px);
  pointer-events: none;
}
.mt-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  font-size: 14px;
  color: var(--bg);
  background: var(--text);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity var(--slow) var(--ease),
    transform var(--slow) var(--ease);
}
.mt-toast.is-in {
  opacity: 1;
  transform: none;
}
.mt-toast--error .icon {
  color: var(--danger);
}
.mt-toast--success .icon {
  color: var(--success);
}
.mt-toast--info .icon {
  color: var(--info);
}
[data-theme="dark"] .mt-toast {
  color: var(--text);
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
}

.mt-page {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

/* ==========================================================================
   11. RESPONSIVE
   ========================================================================== */
@media (max-width: 1100px) {
  .mt-ed {
    grid-template-columns: minmax(0, 1fr);
  }
  .mt-preview,
  .mt-empty {
    min-height: 320px;
  }
  .mt-compose {
    min-height: 460px;
  }
  .mt-modal--editor {
    max-width: 760px;
  }
}
@media (max-width: 860px) {
  .mt-col-date,
  .mt-table td.mt-cell-date,
  .mt-table th.mt-col-date {
    display: none;
  }
  .mt-table {
    min-width: 0;
  }
  .mt-col-owner {
    width: 130px;
  }
  .mt-lib {
    grid-template-columns: minmax(0, 1fr);
    height: 70vh;
  }
  .mt-lib__preview {
    display: block;
  }
}
@media (max-width: 640px) {
  .mt-container {
    padding: 0 var(--sp-4);
  }
  .mt-topbar__in {
    align-items: flex-start;
  }
  .mt-count {
    width: 100%;
  }
  .mt-overlay {
    padding: var(--sp-2);
  }
  .mt-modal__head,
  .mt-modal__body,
  .mt-modal__foot,
  .mt-ed,
  .mt-drawer__body {
    padding-left: var(--sp-4);
    padding-right: var(--sp-4);
  }
  .mt-modal__foot--split {
    padding-left: var(--sp-4);
    padding-right: var(--sp-4);
  }
  .mt-col-owner {
    display: none;
  }
  .mt-table td.mt-cell-owner {
    display: none;
  }
  .mt-folder-tag {
    display: none;
  }
}


/* Clone template dialog - additive styles */
.mt-clone-modal .mt-modal__body { padding: 24px; }
.mt-clone-modal .field { margin: 0 0 22px; }
.mt-clone-modal .field:last-child { margin-bottom: 0; }
.mt-clone-modal .field__label { display:block; margin:0 0 14px; font-size:14px; font-weight:600; color:var(--text); }
.mt-clone-modal .input { height:46px; border-radius:8px; font-size:15px; }
.mt-clone-folder { position:relative; }
.mt-clone-folder-trigger { width:100%; display:flex; align-items:center; justify-content:space-between; text-align:left; border:1px solid var(--brand); background:var(--surface); color:var(--text); padding:0 14px; cursor:pointer; }
.mt-clone-folder-trigger .icon { flex:none; color:var(--text-muted); }
.mt-clone-folder-menu { position:absolute; z-index:var(--mt-z-pop); top:calc(100% + 6px); left:0; right:0; padding:10px; background:var(--surface); border:1px solid var(--border); border-radius:10px; box-shadow:var(--shadow-lg); }
.mt-clone-folder-menu[hidden] { display:none!important; }
.mt-clone-folder-menu .mt-search { width:100%; margin:0 0 8px; }
.mt-clone-folder-menu .input { height:44px; }
.mt-clone-folder-menu ul { list-style:none; padding:0; margin:0; max-height:170px; overflow-y:auto; }
.mt-clone-folder-option { display:block; width:100%; padding:10px 8px; border:0; border-radius:6px; background:transparent; color:var(--text); text-align:left; font:inherit; cursor:pointer; }
.mt-clone-folder-option:hover,.mt-clone-folder-option[aria-selected="true"] { background:var(--surface-3); }
.mt-clone-folder-empty { padding:10px 8px; color:var(--text-muted); font-size:13px; }
.mt-clone-modal .mt-modal__foot { justify-content:flex-start; gap:12px; padding:0 24px 16px; }
.mt-clone-modal .mt-modal__foot .btn-crm { min-width:72px; min-height:42px; border-radius:8px; }
@media(max-width:600px) {
 .mt-clone-modal .mt-modal__body { padding:20px 16px; }
 .mt-clone-modal .mt-modal__foot { padding:0 16px 16px; }
}


/* Clone dialog: keep the folder picker in the modal's normal flow so the
   complete option list and action buttons remain visible (desktop + mobile). */
.mt-overlay#mClone {
  align-items: flex-start;
  justify-content: center;
  padding: 16px;
}
.mt-clone-modal {
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.mt-clone-modal .mt-modal__head {
  min-height: 72px;
  padding: 18px 32px;
}
.mt-clone-modal .mt-modal__body {
  display: block;
  padding: 24px 32px 12px;
}
.mt-clone-modal .field {
  margin: 0 0 20px;
}
.mt-clone-modal .field:last-child {
  margin-bottom: 0;
}
.mt-clone-modal .field__label {
  margin: 0 0 12px;
  line-height: 1.35;
}
.mt-clone-modal .input,
.mt-clone-folder-trigger {
  height: 40px;
  min-height: 40px;
  font-size: 14px;
}
.mt-clone-folder-trigger {
  border-color: var(--brand);
}
.mt-clone-folder-menu {
  position: static;
  inset: auto;
  width: 100%;
  margin-top: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
.mt-clone-folder-menu .mt-search {
  width: 100%;
  margin: 0;
}
.mt-clone-folder-menu .input {
  height: 40px;
  min-height: 40px;
  border: 1px solid var(--brand);
  border-radius: 8px;
  padding: 0 14px;
}
.mt-clone-folder-menu ul {
  max-height: 224px;
  overflow-y: auto;
  padding: 0;
  margin: 0;
  scrollbar-width: thin;
  overscroll-behavior: contain;
}
.mt-clone-folder-option {
  min-height: 26px;
  padding: 3px 0;
  border-radius: 0;
  line-height: 1.45;
  font-size: 14px;
}
.mt-clone-folder-option:hover,
.mt-clone-folder-option[aria-selected="true"] {
  background: var(--surface-3);
}
.mt-clone-modal .mt-modal__foot {
  padding: 16px 32px 24px;
  gap: 12px;
}
.mt-clone-modal .mt-modal__foot .btn-crm {
  min-width: 72px;
  min-height: 42px;
  border-radius: 8px;
}
@media (max-width: 600px) {
  .mt-overlay#mClone { padding: 8px; }
  .mt-clone-modal { max-height: calc(100vh - 16px); }
  .mt-clone-modal .mt-modal__head { min-height: 64px; padding: 16px 20px; }
  .mt-clone-modal .mt-modal__body { padding: 20px 20px 8px; }
  .mt-clone-modal .mt-modal__foot { padding: 12px 20px 20px; }
  .mt-clone-folder-menu ul { max-height: min(224px, 30vh); }
}

/* Clone template popup — match the supplied compact reference (open folder state).
   The folder menu intentionally overlays the modal footer instead of increasing
   the dialog height. All rules are scoped to #mClone. */
.mt-overlay#mClone {
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}
.mt-overlay#mClone .mt-clone-modal {
  position: relative;
  width: 100%;
  max-width: 450px;
  max-height: none;
  overflow: visible;
  border-radius: 13px;
}
.mt-overlay#mClone .mt-clone-modal .mt-modal__head {
  min-height: 58px;
  padding: 14px 24px;
}
.mt-overlay#mClone .mt-clone-modal .mt-modal__head h2 {
  font-size: 18px;
  line-height: 1.35;
}
.mt-overlay#mClone .mt-clone-modal .mt-modal__body {
  display: block;
  padding: 24px 24px 18px;
  overflow: visible;
}
.mt-overlay#mClone .mt-clone-modal .field {
  margin: 0 0 24px;
}
.mt-overlay#mClone .mt-clone-modal .field:last-child {
  margin-bottom: 0;
}
.mt-overlay#mClone .mt-clone-modal .field__label {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.35;
}
.mt-overlay#mClone .mt-clone-modal .input,
.mt-overlay#mClone .mt-clone-folder-trigger {
  height: 46px;
  min-height: 46px;
  font-size: 15px;
  border-radius: 8px;
}
.mt-overlay#mClone .mt-clone-folder-trigger {
  border: 1px solid var(--border-strong);
  padding: 0 14px;
}
.mt-overlay#mClone .mt-clone-folder-menu {
  position: absolute;
  z-index: calc(var(--mt-z-pop) + 2);
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  width: 100%;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  box-shadow: var(--shadow-lg);
}
.mt-overlay#mClone .mt-clone-folder-menu[hidden] { display: none !important; }
.mt-overlay#mClone .mt-clone-folder-menu .mt-search {
  margin: 0 0 8px;
}
.mt-overlay#mClone .mt-clone-folder-menu .input {
  height: 46px;
  min-height: 46px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  padding: 0 14px;
}
.mt-overlay#mClone .mt-clone-folder-menu ul {
  max-height: 48px;
  overflow-y: auto;
  margin: 0;
  padding: 0;
  scrollbar-width: thin;
  overscroll-behavior: contain;
}
.mt-overlay#mClone .mt-clone-folder-option {
  min-height: 48px;
  padding: 10px 8px;
  border-radius: 6px;
  font-size: 15px;
  line-height: 1.4;
}
.mt-overlay#mClone .mt-clone-folder-option:hover,
.mt-overlay#mClone .mt-clone-folder-option[aria-selected="true"] {
  background: var(--surface-3);
}
.mt-overlay#mClone .mt-clone-modal .mt-modal__foot {
  position: relative;
  padding: 0 24px 24px;
  gap: 12px;
}
.mt-overlay#mClone .mt-clone-modal .mt-modal__foot .btn-crm {
  min-height: 42px;
  border-radius: 8px;
}
@media (max-width: 600px) {
  .mt-pager{gap:0px;}
  .mt-page{padding-top: 15px;}
  .mt-overlay#mClone { padding: 16px; }
  .mt-topbar__actions{padding-bottom: 15px;}
  .mt-name-link{font-size: 13px;}
  .mt-overlay#mClone .mt-clone-modal { max-width: 450px; }
  .mt-overlay#mClone .mt-clone-modal .mt-modal__head { padding: 14px 24px; }
  .mt-overlay#mClone .mt-clone-modal .mt-modal__body { padding: 24px 24px 18px; }
  .mt-overlay#mClone .mt-clone-modal .mt-modal__foot { padding: 0 24px 24px; }
}


/* Newly-created folder rows in the Message Templates table */
.mt-folder-row .mt-folder-row__name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 500;
}
.mt-folder-row .mt-folder-row__name > .icon {
  flex: 0 0 auto;
  color: var(--brand);
}
.mt-folder-row .mt-folder-row__name > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mt-folder-row .mt-folder-name-link {
  color: var(--brand-ink);
  font-weight: 600;
}

.mt-folder-row .mt-folder-actions-btn { margin-left: auto; }
.mt-folder-row:hover .mt-folder-actions-btn,
.mt-folder-row:focus-within .mt-folder-actions-btn,
.mt-folder-row.is-menu-open .mt-folder-actions-btn,
.mt-folder-row .mt-folder-actions-btn[aria-expanded="true"] { opacity: 1; }
@media (hover: none) {
  .mt-folder-row .mt-folder-actions-btn { opacity: 1; }
}

/* Compact pagination separators */
.mt-pager__ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 32px;
  color: var(--text-subtle);
  user-select: none;
}
.mt-pager__btn svg {
  flex: 0 0 auto;
}


/* ==========================================================================
   MESSAGE TEMPLATES — NARROW CONTENT AREA FIX
   The CRM sidebar reduces the table's available width even on iPad/tablet
   viewports. Hide date columns before the viewport reaches the old 860px
   breakpoint so the name column retains usable space.
   ========================================================================== */
@media (max-width: 1100px) {
  .mt-page .mt-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }

  .mt-page .mt-table th.mt-col-date,
  .mt-page .mt-table td.mt-cell-date,
  .mt-page .mt-table .mt-col-date {
    display: none !important;
  }

  .mt-page .mt-table .mt-col-check {
    width: 48px;
  }

  .mt-page .mt-table .mt-col-owner {
    width: 130px;
  }

  .mt-page .mt-table .mt-col-name {
    width: auto;
    min-width: 0;
  }

  .mt-page .mt-table .mt-cell-name {
    display: flex;
    align-items: center;
    min-width: 0;
    width: 100%;
    gap: 10px;
  }

  .mt-page .mt-table .mt-name-link {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    overflow-wrap: normal;
    word-break: normal;
  }

  .mt-page .mt-table .mt-actions-btn {
    flex: 0 0 auto;
  }
}

@media (max-width: 640px) {
  .mt-page .mt-table .mt-col-owner,
  .mt-page .mt-table td.mt-cell-owner,
  .mt-page .mt-table th.mt-col-owner {
    display: none !important;
  }

  .mt-page .mt-table .mt-col-name {
    width: auto;
  }

  .mt-page .mt-table .mt-cell-name {
    gap: 8px;
  }
}


/* TABLET WIDTH ALLOCATION CORRECTION
   Use content-aware table sizing when the CRM sidebar leaves a narrow
   content area. The checkbox column stays fixed; the name column receives
   the remaining width instead of being squeezed by the owner column. */
@media (max-width: 1100px) {
  .mt-page .mt-table-wrap {
    width: 100%;
    min-width: 0;
  }

  .mt-page .mt-table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: auto !important;
  }

  .mt-page .mt-table th.mt-col-check,
  .mt-page .mt-table td.mt-col-check {
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
  }

  .mt-page .mt-table th.mt-col-name,
  .mt-page .mt-table td.mt-col-name {
    width: auto !important;
    min-width: 180px !important;
  }

  .mt-page .mt-table th.mt-col-owner,
  .mt-page .mt-table td.mt-cell-owner {
    width: 140px !important;
    min-width: 120px !important;
  }

  .mt-page .mt-table td.mt-col-name .mt-cell-name {
    width: 100%;
    min-width: 0;
  }

  .mt-page .mt-table td.mt-col-name .mt-name-link {
    flex: 1 1 0%;
    width: 1%;
    min-width: 0;
    width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    overflow-wrap: normal;
    word-break: normal;
  }
}

@media (max-width: 640px) {
  .mt-panel__body, .mt-radio-row{display: block;}
  .mt-listbox{width: 100%!important}
  .mt-select{font-size: 12px;}
  .mt-radio{font-size: 14px;}
  .mt-bulk{gap:3px;}
  .mt-toolbar{padding: 15px 0px 0px 0px;margin-bottom: 10px;}
  .mt-page .mt-table th.mt-col-name,
  .mt-page .mt-table td.mt-col-name {
    min-width: 0 !important;
  }
}

/* Snippets page: additions only; all inherited CRM/message-template styling remains unchanged. */
.mt-snippet-modal{width:min(600px,calc(100vw - 32px));max-height:calc(100vh - 32px);display:flex;flex-direction:column;overflow:hidden}
.mt-snippet-body{overflow-y:auto;padding:24px 40px 12px}
.mt-snippet-intro{font-size:14px;line-height:1.55;color:var(--text-muted);margin:0 0 18px}
.mt-snippet-intro .link{font-weight:600;color:var(--brand-ink);white-space:nowrap}
.mt-snippet-modal .field{margin-bottom:18px}
.mt-snippet-modal .field__label{display:block;margin-bottom:7px;font-weight:600}
.mt-snippet-modal .input{width:100%;height:40px}
.mt-snippet-editor-wrap{border:1px solid var(--border-strong);border-radius:var(--mt-field-radius);overflow:visible;background:var(--surface)}
.mt-snippet-editor{min-height:230px;max-height:340px;overflow-y:auto;padding:14px 14px 8px;border:0!important;border-radius:var(--mt-field-radius) var(--mt-field-radius) 0 0;outline:none;}
.mt-snippet-editor:empty:before{content:attr(data-mt-placeholder);color:var(--text-subtle);pointer-events:none}
.mt-snippet-toolbar{border:0!important;margin:0!important;padding:8px 12px!important;min-height:42px;display:flex;align-items:center;gap:3px;border-radius:0 0 var(--mt-field-radius) var(--mt-field-radius)}
.mt-snippet-help{font-size:13px;line-height:1.4;color:var(--text-muted);font-weight:600;margin:-2px 0 6px}
.mt-snippet-shortcut{position:relative}.mt-snippet-shortcut>span{position:absolute;left:12px;top:50%;transform:translateY(-50%);font-weight:700;font-size:18px;z-index:1}.mt-snippet-shortcut .input{padding-left:32px}
.mt-snippet-foot{justify-content:flex-start;gap:12px;padding:16px 40px 24px}
.mt-snippet-foot #snSave:disabled{opacity:.48;cursor:not-allowed}
@media(max-width:640px){.mt-snippet-body{padding:20px 18px 8px}.mt-snippet-foot{padding:14px 18px 20px}.mt-snippet-modal{max-height:calc(100vh - 16px)}}


/* Folder view navigation: uses the existing page typography and CRM link tokens. */
.mt-folder-viewbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 0 14px;
  color: var(--text);
  font-size: 14px;
}
.mt-folder-viewbar[hidden] {
  display: none !important;
}
.mt-folder-viewbar .mt-link-btn {
  color: var(--brand-ink);
}
.mt-folder-viewbar strong {
  font-weight: 600;
}
.mt-folder-row .mt-folder-name-link {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}


/* Snippets modal refinements — preserve CRM theme tokens and button classes. */
.mt-overlay#mClone,
.mt-overlay#mMove,
.mt-overlay#mDelete {
  align-items: center;
  padding: 16px;
}

#cloneFolderPrompt {
  margin: 0;
  padding:10px 15px;
  border-top: 1px solid var(--border);
  color: var(--text-subtle);
  font-size: 13px;
}
#cloneFolderPrompt[hidden] { display: none !important; }
#cloneFolderList:empty { display: none; }
.mt-overlay#mClone .mt-clone-modal {
  width: min(450px, calc(100vw - 32px));
  max-width: 450px;
  max-height: calc(100vh - 32px);
  overflow: visible;
  border-radius: 14px;
}
.mt-overlay#mClone .mt-clone-modal .mt-modal__head {
  min-height: 68px;
  padding: 16px 40px;
}
.mt-overlay#mClone .mt-clone-modal .mt-modal__head h2 {
  font-size: 20px;
  line-height: 1.3;
}
.mt-overlay#mClone .mt-clone-modal .mt-modal__body {
  display: block;
  padding: 34px 40px 20px;
  overflow: visible;
}
.mt-overlay#mClone .mt-clone-modal .field {
  margin: 0 0 22px;
}
.mt-overlay#mClone .mt-clone-modal .field:last-child { margin-bottom: 0; }
.mt-overlay#mClone .mt-clone-modal .field__label {
  display: block;
  margin-bottom: 7px;
  font-size: 14px;
  font-weight: 600;
}
.mt-overlay#mClone .mt-clone-modal .input {
  height: 40px;
  min-height: 40px;
  border-radius: 6px;
  font-size: 14px;
}
.mt-overlay#mClone .mt-clone-modal .mt-clone-folder-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  text-align: left;
}
.mt-overlay#mClone .mt-clone-modal .mt-clone-folder-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: calc(var(--mt-z-pop, 100) + 4);
  margin: 0;
  padding: 10px 0 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.mt-overlay#mClone .mt-clone-modal .mt-clone-folder-menu .mt-search {
  margin: 0;
  padding: 0 12px 10px;
}
.mt-overlay#mClone .mt-clone-modal .mt-clone-folder-menu .input {
  height: 40px;
    min-height: 40px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}
.mt-overlay#mClone .mt-clone-modal .mt-clone-folder-menu ul {
  max-height: 170px;
  padding: 0 12px;
  overflow-y: auto;
}
.mt-overlay#mClone .mt-clone-modal .mt-clone-folder-option {
  min-height: 34px;
  padding: 7px 8px;
  font-size: 14px;
}
.mt-overlay#mClone .mt-clone-modal .mt-modal__foot {
  justify-content: flex-start;
  padding: 0 40px 24px;
  gap: 12px;
}
.mt-overlay#mClone .mt-clone-modal .mt-modal__foot .btn-crm {
  min-width: 82px;
  min-height: 40px;
  border-radius: 8px;
}
.mt-overlay#mMove .mt-modal {
  width: min(450px, calc(100vw - 32px));
  max-width: 450px;
  border-radius: 14px;
}
.mt-overlay#mMove .mt-modal__head {
  min-height: 68px;
  padding: 16px 40px;
}
.mt-overlay#mMove .mt-modal__head h2 {
  font-size: 20px;
  line-height: 1.3;
}
.mt-overlay#mMove .mt-modal__body {
  display: block;
  padding: 24px 40px 8px;
}
.mt-overlay#mMove .mt-search--block {
  width: 100%;
  margin: 0 0 14px;
}
.mt-overlay#mMove .mt-search--block .input {
  height: 40px;
  min-height: 40px;
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  padding-left: 16px;
}
.mt-overlay#mMove .mt-move-context {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.45;
}
.mt-overlay#mMove .mt-move-context[hidden] { display: none !important; }
.mt-overlay#mMove .mt-folder-list {
  display: grid;
  gap: 4px;
  max-height: 270px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
}
.mt-overlay#mMove .mt-folder-item {
  min-height: 40px;
  padding: 8px 10px;
  border: 2px solid transparent;
  border-radius: 6px;
  font-size: 14px;
}
.mt-overlay#mMove .mt-folder-item[aria-selected="true"] {
  border-color: var(--brand);
  border-left: 4px solid var(--text);
  padding-left: 8px;
  background: var(--surface-3);
  color: var(--text);
}
.mt-overlay#mMove .mt-modal__foot {
  padding: 16px 40px 24px;
  gap: 12px;
}
.mt-overlay#mMove .mt-modal__foot .btn-crm {
  min-width: 86px;
  min-height: 40px;
  border-radius: 24px;
}
.mt-overlay#mDelete .mt-modal {
  width: min(540px, calc(100vw - 32px));
  max-width: 540px;
  border-radius: 14px;
}
.mt-overlay#mDelete .mt-modal__head {
  min-height: auto;
    padding: 22px;
    align-items: flex-start;
}
.mt-overlay#mDelete .mt-modal__head h2 {
    font-size: 20px;
    font-weight: 600;
    line-height: 29px;
}
.mt-overlay#mDelete .mt-modal__body {
  display: block;
  padding: 20px;
}
.mt-overlay#mDelete .mt-modal__body > .mt-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}
.mt-overlay#mDelete .mt-modal__foot {
  padding: 20px;
  gap: 12px;
}
.mt-overlay#mDelete .mt-modal__foot .btn-crm {
  min-height: 40px;
  border-radius: 8px;
}
@media (max-width: 600px) {
  .mt-overlay#mClone .mt-clone-modal .mt-modal__head,
  .mt-overlay#mMove .mt-modal__head { padding-left: 22px; padding-right: 22px; }
  .mt-overlay#mClone .mt-clone-modal .mt-modal__body,
  .mt-overlay#mMove .mt-modal__body { padding-left: 22px; padding-right: 22px; }
  .mt-overlay#mClone .mt-clone-modal .mt-modal__foot,
  .mt-overlay#mMove .mt-modal__foot { padding-left: 22px; padding-right: 22px; }
  .mt-overlay#mDelete .mt-modal__head { min-height: 0; padding: 28px 24px; }
  .mt-overlay#mDelete .mt-modal__head h2 { font-size: 17px;line-height:23px }
  .mt-overlay#mDelete .mt-modal__body { padding: 22px 24px 8px; }
  .mt-overlay#mDelete .mt-modal__foot { padding: 14px 24px 22px; }
}


/* Final Move-to-folder reference alignment. Scoped so other CRM dialogs stay unchanged. */
.mt-overlay#mMove {
  background: rgba(0, 0, 0, .40);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.mt-overlay#mMove > .mt-modal {
  width: min(450px, calc(100vw - 32px));
  max-width: 450px;
  max-height: calc(100vh - 32px);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.mt-overlay#mMove .mt-modal__head {
  min-height: 68px;
  padding: 16px 40px;
  border-bottom: 1px solid var(--border);
}
.mt-overlay#mMove .mt-modal__head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
}
.mt-overlay#mMove .mt-modal__body {
  display: block;
  padding: 24px 40px 8px;
  overflow: visible;
}
.mt-overlay#mMove .mt-search--block {
  position: relative;
  width: 100%;
  margin: 0 0 14px;
}
.mt-overlay#mMove .mt-search--block .input {
  width: 100%;
  height: 40px;
  min-height: 40px;
  padding: 0 40px 0 16px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  font-size: 14px;
}
.mt-overlay#mMove .mt-search__icon {
  right: 14px;
}
.mt-overlay#mMove .mt-move-context {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}
.mt-overlay#mMove .mt-move-context[hidden] { display: none !important; }
.mt-overlay#mMove .mt-folder-list {
  display: grid;
  gap: 4px;
  max-height: min(46vh, 430px);
  margin: 0;
  padding: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  overscroll-behavior: contain;
}
.mt-overlay#mMove .mt-folder-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 2px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  text-align: left;
}
.mt-overlay#mMove .mt-folder-item:hover {
  background: var(--surface-hover);
}
.mt-overlay#mMove .mt-folder-item[aria-selected="true"] {
  border-color: var(--brand);
  border-left: 4px solid var(--text);
  padding-left: 8px;
  background: var(--surface-3);
  color: var(--text);
  font-weight: 500;
}
.mt-overlay#mMove .mt-modal__foot {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 16px 40px 24px;
}
.mt-overlay#mMove .mt-modal__foot .btn-crm {
  min-width: 86px;
  min-height: 40px;
  border-radius: 8px;
}
.mt-overlay#mMove .mt-modal__foot .btn-crm:disabled {
  opacity: .42;
  cursor: not-allowed;
}
.mt-overlay#mMove #moveEmptyNote {
  margin: 8px 0;
  color: var(--text-muted);
  font-size: 13px;
}
@media (max-width: 600px) {
  .mt-overlay#mMove .mt-modal__head { padding: 16px 22px; }
  .mt-overlay#mMove .mt-modal__body { padding: 20px 22px 8px; }
  .mt-overlay#mMove .mt-modal__foot { padding: 14px 22px 20px; }
}

/* Make dynamically rendered snippet/folder names reliable clickable targets. */
#mtRows .mt-name-link,
#mtRows .mt-folder-name-link {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand-ink);
  font: inherit;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  pointer-events: auto;
}
#mtRows .mt-name-link:hover,
#mtRows .mt-folder-name-link:hover {
  text-decoration: underline;
}


/* Empty folder state shown after opening a newly-created folder. */
.mt-table-wrap {
  position: relative;
}
#mtTable[hidden] {
  display: none !important;
}
.mt-folder-empty {
  width: 100%;
  min-height: 182px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 38px 16px 14px;
  background: var(--surface, #fff);
  text-align: center;
}
.mt-folder-empty[hidden] {
  display: none !important;
}
.mt-folder-empty__icon {
  display: block;
  width: 112px;
  height: 96px;
  flex: 0 0 auto;
}
.mt-folder-empty p {
  margin: 10px 0 0;
  color: var(--text, #101828);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
}
#mtRows .mt-folder-row__name {
  display: flex;
  align-items: center;
  gap: 12px;
}
#mtRows .mt-folder-row__name .mt-folder-name-link {
  flex: 0 1 auto;
}


/* ==========================================================================
   SNIPPETS — MATCH MESSAGE TEMPLATES TABLE + LINKED LIST MARKER COLOR
   Uses the existing CRM theme variables so light/dark mode stay in sync.
   ========================================================================== */

/* Match the Message Templates table frame and header treatment. */
.mt-page .mt-table-wrap {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  background: var(--surface);
}

.mt-page .mt-table-wrap.is-folder-empty {
  border: 0;
  background: transparent;
}

.mt-page .mt-table {
  width: 100%;
  min-width: 900px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  background: var(--surface);
}

.mt-page .mt-table thead th {
  height: 46px;
  padding-top: 0;
  padding-bottom: 0;
  background: var(--surface-2);
  color: var(--text);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.mt-page .mt-table thead tr:first-child th:first-child {
  border-top-left-radius: 7px;
}

.mt-page .mt-table thead tr:first-child th:last-child {
  border-top-right-radius: 7px;
}

.mt-page .mt-table tbody tr {
  height: 50px;
  background: var(--surface);
  border-bottom: 0;
}

.mt-page .mt-table tbody tr + tr td {
  border-top: 1px solid var(--border);
}

.mt-page .mt-table tbody td {
  padding-top: 8px;
  padding-bottom: 8px;
  color: var(--text);
}

.mt-page .mt-table th.mt-col-name,
.mt-page .mt-table td.mt-col-name {
  border-right: 1px solid var(--border-strong);
}

.mt-page .mt-table th.mt-col-check,
.mt-page .mt-table td.mt-col-check {
  width: 60px;
  padding-left: 14px !important;
}

.mt-page .mt-table th.mt-col-owner,
.mt-page .mt-table td.mt-cell-owner {
  width: 168px;
}

.mt-page .mt-table th.mt-col-date,
.mt-page .mt-table td.mt-cell-date {
  width: 152px;
}

.mt-page .mt-table tbody tr:hover,
.mt-page .mt-table tbody tr.is-menu-open,
.mt-page .mt-table tbody tr.is-selected {
  background: var(--surface-hover);
}

.mt-page .mt-table tbody tr:last-child td {
  border-bottom: 0;
}

.mt-page .mt-table .mt-name-link {
  color: var(--brand-ink);
  font-weight: 600;
}

/* The marker inherits the LI color set by the editor's foreColor command. */
.mt-page .mt-snippet-editor li::marker {
  color: var(--mt-marker-color, inherit);
}

@media (max-width: 1100px) {
  .mt-page .mt-table {
    min-width: 760px;
  }
}

@media (max-width: 640px) {
  .mt-page .mt-table-wrap {
    border-radius: 8px;
  }
}

/* HUB-417 additions in the design's style: character counter, shortcut chip, preview line,
   import and restore lists. */
.mt-snippet-count{font-size:12px;color:var(--text-muted);font-weight:600;text-align:right;margin:-8px 0 14px}
.mt-snippet-count.is-over{color:#c01048}
.mt-table th.mt-col-name{width:38%}
.mt-name-stack{display:flex;flex:1 1 170px;flex-direction:column;align-items:flex-start;min-width:150px}
.mt-name-sub{display:block;max-width:min(230px,100%);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;color:var(--text-muted)}
.mt-import-skips{max-height:180px;overflow-y:auto;margin:8px 0 0;padding-left:18px;font-size:13px}
.mt-restore-list{max-height:320px;overflow-y:auto;margin:0;padding:0;list-style:none}
.mt-restore-list li{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 0}
.mt-restore-list li>span{min-width:0}

/* ---------------------------------------------------- go-live QA (27 Nov) */
.mt-field-error { margin: 6px 0 0; font-size: 13px; font-weight: 500; color: var(--danger); overflow-wrap: anywhere; }
.mt-snippet-foot__error { flex: 1 0 100%; margin: 0 0 4px; }
.mt-snippet-modal .input[aria-invalid="true"], .mt-clone-modal .input[aria-invalid="true"] { border-color: var(--danger); }
.mt-snippet-learn { padding: 0; border: 0; background: none; font: inherit; font-weight: 600; color: var(--brand-ink); cursor: pointer; text-decoration: underline; }
.mt-snippet-more { margin: -8px 0 18px; padding-left: 18px; list-style: disc; font-size: 13.5px; line-height: 1.55; color: var(--text-muted); }
/* A toast must never sit on a dialog's Save and Cancel: while one is open it shows at the top. */
body:has(.mt-modal) .toast-region { top: 16px; bottom: auto; }
/* HUB-751: nothing can be selected by someone who cannot change snippets. */
.mt-page.is-view-only .mt-col-check .check { visibility: hidden; }

/* Laptop widths (1280px, go-live QA): the name column keeps its room. A name is one line, its
   folder sits under it, and the other columns narrow, so nothing runs into the next column. */
.mt-page .mt-table th.mt-col-name { width: auto; }
.mt-page .mt-table .mt-name-stack { flex: 1 1 0; min-width: 0; }
.mt-page .mt-table #mtRows .mt-name-stack .mt-name-link,
.mt-page .mt-table #mtRows .mt-folder-row__name .mt-folder-name-link {
  display: block; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mt-page .mt-table .mt-name-stack .mt-folder-tag { max-width: 100%; margin-top: 3px; }
.mt-page .mt-table .mt-folder-tag > .icon { flex: none; }
.mt-page .mt-table .mt-folder-tag > span { overflow: hidden; text-overflow: ellipsis; }
.mt-page .mt-table .mt-folder-row__name .mt-actions-btn { margin-left: auto; }
@media (min-width: 1101px) and (max-width: 1440px) {
  .mt-page .mt-table { min-width: 860px; }
  .mt-page .mt-table th, .mt-page .mt-table td { padding-left: 10px; padding-right: 10px; }
  .mt-page .mt-table th.mt-col-check, .mt-page .mt-table td.mt-col-check { width: 48px; }
  .mt-page .mt-table th.mt-col-owner, .mt-page .mt-table td.mt-cell-owner { width: 122px; }
  .mt-page .mt-table th.mt-col-date, .mt-page .mt-table td.mt-cell-date { width: 120px; }
}
.mt-snippet-modal .mt-snippet-toolbar[hidden] { display: none; }
