/* Round21: compact Apple-style tool and saved-message pages. */
html[data-mobile-tools-ready="true"] #settings-shortcuts > h3,
html[data-mobile-tools-ready="true"] #template-card.mobile-tools-template-card > .card__head h2 {
  display: none !important;
}

html[data-mobile-tools-ready="true"] #settings-shortcuts .mobile-tool-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  text-align: left;
  white-space: normal;
}

html[data-mobile-tools-ready="true"] #settings-shortcuts .mobile-tool-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 10px;
  background: var(--mobile-tool-icon-color, #007aff);
  color: white;
}

html[data-mobile-tools-ready="true"] #settings-shortcuts .mobile-tool-icon[data-mobile-tool-icon="countdown"] {
  background: linear-gradient(145deg, #ffb340, #ff8a00);
}

html[data-mobile-tools-ready="true"] #settings-shortcuts .mobile-tool-icon[data-mobile-tool-icon="schedule"] {
  background: linear-gradient(145deg, #4aa3ff, #0877e8);
}

html[data-mobile-tools-ready="true"] #settings-shortcuts .mobile-tool-icon svg {
  display: block;
  width: 20px;
  height: 20px;
}

html[data-mobile-tools-ready="true"] #settings-shortcuts .mobile-tool-copy {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

html[data-mobile-tools-ready="true"] #settings-shortcuts .mobile-tool-name {
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

html[data-mobile-tools-ready="true"] #settings-shortcuts .mobile-tool-description {
  display: block;
  min-width: 0;
  color: #858b97;
  font-size: 11px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

html[data-mobile-tools-ready="true"] #settings-shortcuts .mobile-tool-count {
  flex: none;
}

html[data-mobile-tools-ready="true"] #settings-shortcuts .mobile-tool-arrow {
  flex: none;
  color: #a1a6b0;
  font-size: 22px;
  line-height: 1;
}

html[data-mobile-tools-ready="true"] .mobile-tools-library-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  margin: 4px 2px 8px;
}

html[data-mobile-tools-ready="true"] .mobile-tools-library-heading h3 {
  min-width: 0;
  margin: 0;
  color: #303744;
  font-size: 14px;
  font-weight: 650;
}

html[data-mobile-tools-ready="true"] .mobile-tools-current {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #e8eaf0;
  border-radius: 14px;
  background: #fff;
}

html[data-mobile-tools-ready="true"] .mobile-tools-current-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  margin-bottom: 8px;
}

html[data-mobile-tools-ready="true"] .mobile-tools-current-head h3 {
  min-width: 0;
  margin: 0;
  color: #303744;
  font-size: 13px;
  font-weight: 600;
}

html[data-mobile-tools-ready="true"] .mobile-tools-current-text {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-height: 176px;
  margin: 0;
  padding: 10px;
  overflow: auto;
  border-radius: 10px;
  background: #f5f6f9;
  color: #272e3a;
  font: inherit;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

html[data-mobile-tools-ready="true"] .mobile-tools-save-current {
  width: 100%;
  min-width: 0;
  margin-top: 10px;
  border: 1px solid #e8eaf0;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

html[data-mobile-tools-ready="true"] .mobile-tools-save-current > summary {
  min-height: 48px;
  padding: 14px 12px;
  color: #303744;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 700px) {
  html[data-mobile-tools-ready="true"] #display-card[data-detail="template-card"] {
    margin: 0 !important;
    padding: 0 !important;
  }

  html[data-mobile-tools-ready="true"] #display-card[data-detail="template-card"] .settings-header {
    margin: 0 0 4px !important;
  }

  html[data-mobile-tools-ready="true"] #settings-shortcuts {
    min-width: 0;
    overflow: hidden;
    padding: 12px;
    border: 0;
    border-radius: 16px;
    background: transparent;
    box-shadow: none;
  }

  html[data-mobile-tools-ready="true"] #settings-shortcuts > h3 {
    display: none !important;
  }

  html[data-mobile-tools-ready="true"] #settings-shortcuts .settings-shortcuts__row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
    width: 100%;
    min-width: 0;
    margin: 0;
  }

  html[data-mobile-tools-ready="true"] #settings-shortcuts .mobile-tool-row {
    display: grid !important;
    grid-template-columns: 42px minmax(0, 1fr) auto 16px;
    align-items: center;
    justify-content: initial !important;
    gap: 11px;
    box-sizing: border-box;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 68px;
    padding: 10px 12px !important;
    overflow: hidden;
    border: 1px solid #e8eaf0 !important;
    border-radius: 15px !important;
    background: #fff !important;
    color: #202633 !important;
    text-align: left;
    box-shadow: 0 2px 8px rgb(20 35 60 / 4%);
    white-space: normal !important;
  }

  html[data-mobile-tools-ready="true"] #settings-shortcuts .mobile-tool-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--mobile-tool-icon-color, #007aff);
    color: white;
    flex: none;
  }

  html[data-mobile-tools-ready="true"] #settings-shortcuts .mobile-tool-icon[data-mobile-tool-icon="countdown"] {
    background: linear-gradient(145deg, #ffb340, #ff8a00);
  }

  html[data-mobile-tools-ready="true"] #settings-shortcuts .mobile-tool-icon[data-mobile-tool-icon="schedule"] {
    background: linear-gradient(145deg, #4aa3ff, #0877e8);
  }

  html[data-mobile-tools-ready="true"] #settings-shortcuts .mobile-tool-icon svg {
    display: block;
    width: 23px;
    height: 23px;
  }

  html[data-mobile-tools-ready="true"] #settings-shortcuts .mobile-tool-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
    line-height: 1.35;
  }

  html[data-mobile-tools-ready="true"] #settings-shortcuts .mobile-tool-name {
    min-width: 0;
    color: #202633;
    font-size: 15px;
    font-weight: 600;
    overflow-wrap: anywhere;
  }

  html[data-mobile-tools-ready="true"] #settings-shortcuts .mobile-tool-description {
    min-width: 0;
    color: #858b97;
    font-size: 11.5px;
    font-weight: 400;
    line-height: 1.4;
    overflow-wrap: anywhere;
  }

  html[data-mobile-tools-ready="true"] #settings-shortcuts .mobile-tool-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: #eef4ff;
    color: #0877e8;
    font-size: 11px;
    font-weight: 700;
  }

  html[data-mobile-tools-ready="true"] #settings-shortcuts .mobile-tool-arrow {
    color: #a1a6b0;
    font-size: 23px;
    font-weight: 400;
    line-height: 1;
    text-align: right;
  }

  html[data-mobile-tools-ready="true"] #template-card.mobile-tools-template-card {
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    padding: 14px;
    overflow: hidden;
    border: 0;
    border-radius: 16px;
    background: transparent;
    box-shadow: none;
  }

  html[data-mobile-tools-ready="true"] #template-card.mobile-tools-template-card > .card__head {
    display: none !important;
  }

  html[data-mobile-tools-ready="true"] #template-card .hintline {
    margin: 0 0 12px !important;
    color: #737985;
    font-size: 12px;
    line-height: 1.5;
  }

  html[data-mobile-tools-ready="true"] .mobile-tools-library-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    margin: 4px 2px 8px;
  }

  html[data-mobile-tools-ready="true"] .mobile-tools-library-heading h3 {
    min-width: 0;
    margin: 0;
    color: #303744;
    font-size: 14px;
    font-weight: 650;
  }

  html[data-mobile-tools-ready="true"] .mobile-tools-quota {
    flex: none;
    max-width: 50%;
    font-size: 11px;
  }

  html[data-mobile-tools-ready="true"] #tpl-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    width: 100%;
    min-width: 0;
    margin: 0;
  }

  html[data-mobile-tools-ready="true"] #tpl-list > .tpl {
    display: flex;
    align-items: center;
    gap: 9px;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 10px;
    border: 1px solid #e8eaf0;
    border-radius: 13px;
    background: #fff;
  }

  html[data-mobile-tools-ready="true"] #tpl-list .tpl__main {
    flex: 1 1 auto;
    min-width: 0;
  }

  html[data-mobile-tools-ready="true"] #tpl-list .tpl__name,
  html[data-mobile-tools-ready="true"] #tpl-list .tpl__meta {
    overflow-wrap: anywhere;
  }

  html[data-mobile-tools-ready="true"] #tpl-list .tpl__acts {
    display: flex;
    flex: none;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px;
    min-width: 0;
  }

  html[data-mobile-tools-ready="true"] #tpl-list .tpl__acts button {
    width: auto;
    min-width: 0;
    min-height: 36px;
    padding: 5px 8px;
    font-size: 12px;
  }

  html[data-mobile-tools-ready="true"] #tpl-list .tpl-empty {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    padding: 12px;
    border: 1px solid #eceef2;
    border-radius: 13px;
    background: #f7f8fa;
    color: #818793;
    font-size: 12px;
    line-height: 1.55;
    overflow-wrap: anywhere;
  }

  html[data-mobile-tools-ready="true"] .mobile-tools-current {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    margin-top: 14px;
    padding: 12px;
    border: 1px solid #e8eaf0;
    border-radius: 14px;
    background: #fff;
  }

  html[data-mobile-tools-ready="true"] .mobile-tools-current-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    margin-bottom: 8px;
  }

  html[data-mobile-tools-ready="true"] .mobile-tools-current-head h3 {
    min-width: 0;
    margin: 0;
    color: #303744;
    font-size: 13px;
    font-weight: 600;
  }

  html[data-mobile-tools-ready="true"] .mobile-tools-edit-content {
    flex: none;
    width: auto;
    min-height: 34px;
    padding: 4px 2px 4px 8px;
    border: 0;
    background: transparent;
    color: #0877e8;
    font-size: 12px;
    font-weight: 550;
    white-space: nowrap;
  }

  html[data-mobile-tools-ready="true"] .mobile-tools-current-text {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-height: 176px;
    margin: 0;
    padding: 10px;
    overflow: auto;
    border-radius: 10px;
    background: #f5f6f9;
    color: #272e3a;
    font: inherit;
    font-size: 14px;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    overscroll-behavior: contain;
    -webkit-user-select: text;
    user-select: text;
  }

  html[data-mobile-tools-ready="true"] .mobile-tools-current.is-empty .mobile-tools-current-text {
    color: #969ca7;
  }

  html[data-mobile-tools-ready="true"] .mobile-tools-preview-note {
    margin: 7px 1px 0;
    color: #858b97;
    font-size: 11px;
    line-height: 1.45;
  }

  html[data-mobile-tools-ready="true"] .mobile-tools-save-current {
    width: 100%;
    min-width: 0;
    margin-top: 10px;
    border: 1px solid #e8eaf0;
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
  }

  html[data-mobile-tools-ready="true"] .mobile-tools-save-current > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    padding: 0 12px;
    color: #303744;
    font-size: 14px;
    font-weight: 600;
    list-style: none;
    cursor: pointer;
  }

  html[data-mobile-tools-ready="true"] .mobile-tools-save-current > summary::-webkit-details-marker {
    display: none;
  }

  html[data-mobile-tools-ready="true"] .mobile-tools-save-current > summary::before {
    content: none !important;
    display: none !important;
  }

  html[data-mobile-tools-ready="true"] .mobile-tools-save-current > summary::after {
    content: "" !important;
    display: block;
    box-sizing: border-box;
    width: 9px;
    height: 9px;
    flex: none;
    border: 0 !important;
    border-right: 1.8px solid #8e949e !important;
    border-bottom: 1.8px solid #8e949e !important;
    color: #8e949e;
    margin-right: 4px;
    transform: rotate(-45deg) !important;
    transition: transform 160ms ease;
  }

  html[data-mobile-tools-ready="true"] .mobile-tools-save-current[open] > summary::after {
    transform: rotate(45deg) !important;
  }

  html[data-mobile-tools-ready="true"] .mobile-tools-save-body {
    display: grid;
    gap: 8px;
    padding: 0 12px 12px;
  }

  html[data-mobile-tools-ready="true"] .mobile-tools-save-body > label {
    margin: 2px 0 0;
    color: #565e6b;
    font-size: 12px;
    font-weight: 500;
  }

  html[data-mobile-tools-ready="true"] .mobile-tools-empty-guidance {
    margin: 0;
    padding: 8px 9px;
    border-radius: 9px;
    background: #fff7e5;
    color: #805b13;
    font-size: 12px;
    line-height: 1.45;
    overflow-wrap: anywhere;
  }

  html[data-mobile-tools-ready="true"] .mobile-tools-save-body #tpl-name {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 9px 11px;
    border: 1px solid #e1e4eb;
    border-radius: 11px;
    background: #f7f8fa;
    color: #252c38;
    font-size: 16px;
  }

  html[data-mobile-tools-ready="true"] .mobile-tools-save-body .mobile-tools-save-spacer {
    display: none !important;
  }

  html[data-mobile-tools-ready="true"] .mobile-tools-save-body .split {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    margin: 0;
  }

  html[data-mobile-tools-ready="true"] .mobile-tools-save-body #tpl-save-btn,
  html[data-mobile-tools-ready="true"] .mobile-tools-save-body #tpl-overwrite-btn {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 8px 10px;
    border-radius: 11px;
    font-size: 13px;
  }

  html[data-mobile-tools-ready="true"] .mobile-tools-save-body #tpl-save-btn:disabled {
    opacity: 0.52;
    cursor: not-allowed;
  }

  html[data-mobile-tools-ready="true"] .mobile-tools-save-body #tpl-save-btn,
  html[data-mobile-tools-ready="true"] .mobile-tools-save-body #tpl-overwrite-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  html[data-mobile-tools-ready="true"] .mobile-tools-save-body #tpl-lock {
    margin: 0;
    overflow-wrap: anywhere;
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-mobile-tools-ready="true"] .mobile-tools-save-current > summary::after {
    transition: none;
  }
}
