:root {
  --tm-as-bg: #DAD9D9;          /* серый фон панели */
  --tm-as-card: #fff;           /* карточка */
  --tm-as-br: #000000;          /* границы */
  --tm-as-text: #000;           /* текст */
  --tm-as-accent: #000;         /* акцент/иконки */
  --tm-as-focus: #0a66ff;       /* фокус */
  --tm-as-cursor-white: auto;
  --tm-as-cursor-black: auto;
}

/* ===== FAB ===== */
.tm-as-fab {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 5;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: #000;
  color: #fff;
  border: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .25);
  cursor: pointer;
  transition: .2s ease-in-out;
  border: 4px dotted transparent;
}

.tm-as-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .28);
  border-color: white;
  border-style: dotted;
}

.tm-as-fab img {
  width: 31.47px;
  height: 37.39px;
  display: block;
}

/* ===== PANEL ===== */
.tm-as-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(470px, 92vw);
  background: var(--tm-as-bg);
  color: var(--tm-as-text);
  z-index: 2147483646;
  /* box-shadow: -20px 0 40px rgba(0, 0, 0, .18); */
  transform: translateX(100%);
  transition: transform .28s ease;
  display: flex;
  flex-direction: column;
  /* font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; */
  font-family: 'Segoe UI', sans-serif, Roboto;
  font-weight: 400;
}

.tm-as-panel.open {
  transform: translateX(0);
}

.tm-as-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 34px 33px;
  /* border-bottom: 1px solid var(--tm-as-br); */
  background: transparent;
}

.tm-as-title {
  font-weight: 700;
  font-size: 25px;
  line-height: 25px;
}

.tm-as-close {
  appearance: none;
  border: 0;
  background: #000;
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;

}

.tm-as-close img {
  width: 16.82px;
  height: 16.99px;
  display: block;
  transition: .2s ease-in-out;
}

.tm-as-close:hover img {
  transform: rotate(90deg);
}

.tm-as-body {
  padding: 28px;
  overflow: auto;
  padding-top: 0px;
}

.tm-as-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ===== карточки ===== */
.tm-as-card {
  background: var(--tm-as-card);
  /* border: 1px solid transparent; */
  border-radius: 8px;
  padding: 8px 10px;
  min-height: 80px;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  user-select: none;
  text-align: center;
  justify-content: center;
  position: relative;
}

.tm-as-card:focus {
  outline: 2px solid var(--tm-as-focus);
  outline-offset: 2px;
}

.tm-as-card.active {
  box-shadow: inset 0 0 0 3px #000000;
}

/* ===== иконка + заголовок/подпись ===== */
.tm-as-ico {
  flex: 0 0 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tm-as-ico img {
  min-width: 22px;
  width: 22px;
  height: 22px;
  display: block;
  width: auto;
  height: auto;
}

.tm-as-ttl {
  font-weight: 600;
  font-size: 18px;
}

.tm-as-sub {
  font-size: 12px;
  opacity: .85;
}

/* ===== двойные контролы ===== */
.tm-as-dual {
  display: grid;
  /* grid-template-columns: 26px 1fr 26px;
  gap: 6px; */
  align-items: center;
  margin-top: 6px;
  display: flex;
  width: max-content;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.tm-as-dual button {
  appearance: none;
  border: 0;
  background: #000;
  color: #fff;
  height: 26px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  line-height: 26px;
}

.tm-as-dual .val {
  /* background: #efefef; */
  /* border: 1px solid var(--tm-as-br); */
  height: 30px;
  /* border-radius: 6px; */
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.tm-as-dual > button:first-child {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 21px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 8px 0 0 8px;
}

.tm-as-dual > button:nth-child(3) {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 21px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 0 8px 8px 0;
}

/* ===== футер ===== */
.tm-as-footer {
  margin-top: 12px;
}

.tm-as-reset {
  width: 100%;
  height: auto;
  min-height: 70px;
  border-radius: 8px;
  border: 0;
  cursor: pointer;
  font-weight: 600;
  background: #000;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  font-size: 18px;
  text-align: left;
  padding-left: 25px;
  padding-right: 25px;
  margin-top: 44px;
  transition: .2s ease-in-out;
}

.tm-as-reset:hover {
  transform: translateY(-3px);
}

.tm-as-reset img {
  width: 31px;
  height: auto;
  display: block;
  transition: .2s ease-in-out;
}

.tm-as-reset:hover img {
  transform: rotate(180deg);
}

/* ===== Functional classes ===== */
html.tm-as-fs-0 { font-size: 100% !important; }
html.tm-as-fs-1 { font-size: 110% !important; }
html.tm-as-fs-2 { font-size: 120% !important; }
html.tm-as-fs-3 { font-size: 135% !important; }
html.tm-as-fs-4 { font-size: 150% !important; }

/* Zoom только для контента */
#tm-as-site-wrap {
  transition: zoom .25s ease;
}

#tm-as-site-wrap .tm-as-panel,
#tm-as-site-wrap .tm-as-fab {
  zoom: 1 !important;
}

/* Noir-Blanc */
html.tm-as-nb {
  filter: grayscale(1) !important;
}

/* Dyslexie */
@font-face {
  font-family: 'OpenDyslexic';
  src: url('./fonts/OpenDyslexic-Regular.woff2') format("woff2");
  font-display: swap;
}

html.tm-as-dyslexia body {
  font-family: 'OpenDyslexic', Verdana, Arial, sans-serif !important;
  letter-spacing: .02em;
  word-spacing: .06em;
  line-height: 1.6;
}

/* Liens / titres */
html.tm-as-underline-links a {
  text-decoration: underline !important;
}

html.tm-as-underline-headings h1,
html.tm-as-underline-headings h2,
html.tm-as-underline-headings h3,
html.tm-as-underline-headings h4,
html.tm-as-underline-headings h5,
html.tm-as-underline-headings h6 {
  text-decoration: underline !important;
}

/* Reading mask */
.tm-as-reading-mask {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2147483645;
  --top: 0px;
  --height: 140px;
  background: linear-gradient(
    #0008 0 var(--top),
    transparent var(--top) calc(var(--top) + var(--height)),
    #0008 calc(var(--top) + var(--height)) 100%
  );
}

/* Alt badge overlays */
.tm-as-altwrap {
  position: relative;
  /* display: inline-block; */
}

.tm-as-altbadge {
  position: absolute;
  left: 6px;
  bottom: 6px;
  z-index: 2147483000;
  background: #000;
  color: #fff;
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 11px;
  line-height: 1.2;
  max-width: min(80vw, 360px);
}

.tm-as-altbadge[data-missing="1"] {
  background: #c90000;
}

/* Cursors */


/* Белый курсор */
html.tm-as-cursor-white *{
  cursor: var(--tm-as-cursor-white) !important;
}

/* Чёрный курсор */
html.tm-as-cursor-black *{
  cursor: var(--tm-as-cursor-black) !important;
}

/* overlay-затемнение под панель для клика по фону */
.tm-as-backdrop {
  position: fixed;
  inset: 0;
  background: transparent;
  z-index: 2147483645;
  display: none;
  pointer-events: none; /* <— добавили */
}

.tm-as-backdrop.open {
  display: block;
}

/* admin bar guard */
.admin-bar .tm-as-panel {
  top: 32px;
  height: calc(100% - 32px);
}

.tm-as-dual button.is-disabled{
  opacity:.45;
  cursor:not-allowed;
  pointer-events:none;
}


@media (max-width: 480px) {
  .tm-as-card[data-t='fs'] .tm-as-ttl, .tm-as-card[data-t='zoom'] .tm-as-ttl {
    max-width: calc(100% - 22px);
    margin-left: auto;
    margin-right: auto;
    width: 100%;
  }
}
