:root {
  --bg: #eae7dc;
  --bg-2: #d8c3a5;
  --fg: #3a342f;
  --muted: #8e8d8a;
  --accent: #e85a4f;
  --accent-2: #e98074;
  --card: #f7f2e8;
  --border: #d8c3a5;
  --radius: 0px;
  --space: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  color-scheme: light;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(circle at 12% 18%, rgba(232,128,116,0.14), transparent 35%),
    radial-gradient(circle at 88% 10%, rgba(232,90,79,0.12), transparent 32%),
    var(--bg);
  color: var(--fg);
  min-height: 100vh;
}

.tm-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space);
  align-items: center;
  padding: 14px 16px;
  background: rgba(234, 231, 220, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.tm-header__brand {
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  cursor: pointer;
}
.tm-header__search input {
  width: 100%;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0;
  color: var(--fg);
}
.tm-header__search input:focus { outline: 2px solid var(--accent); }
.tm-burger {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 8px 10px;
  border-radius: 0;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}
.tm-burger:hover {
  background: rgba(232,90,81,0.1);
  border-color: var(--accent);
}

.tm-nav {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px,1fr));
  gap: 14px;
  padding: 14px 16px 0;
}
.tm-main {
  padding: 14px 16px 48px;
}
.tm-ad-container {
  padding: 16px;
  text-align: center;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.tm-ad-container #yandex_rtb_R-A-18044876-1 {
  margin: 0 auto;
}

.tm-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 320px;
  height: 100vh;
  background: var(--card);
  border-right: 1px solid var(--border);
  box-shadow: 4px 0 20px rgba(0,0,0,0.1);
  z-index: 100;
  transform: translateX(-100%);
  transition: transform 250ms ease;
  overflow-y: auto;
}
body.sidebar-open .tm-sidebar {
  transform: translateX(0);
}
.tm-sidebar__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 1;
}
.tm-sidebar__header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}
.tm-sidebar__close {
  background: transparent;
  border: none;
  font-size: 28px;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  transition: background 150ms ease, color 150ms ease;
}
.tm-sidebar__close:hover {
  background: rgba(232,90,81,0.1);
  color: var(--accent);
}
.tm-sidebar__nav {
  padding: 8px;
}
.tm-sidebar__all {
  display: block;
  padding: 12px 14px;
  margin-bottom: 8px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  border-radius: 0;
  transition: background 150ms ease;
}
.tm-sidebar__all:hover {
  background: rgba(232,90,81,0.1);
}
.tm-sidebar__category {
  margin-bottom: 8px;
}
.tm-sidebar__category-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: transparent;
  border: none;
  border-radius: 0;
  color: var(--fg);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: background 150ms ease;
  text-align: left;
}
.tm-sidebar__category-btn:hover {
  background: rgba(232,90,81,0.08);
}
.tm-sidebar__count {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  background: rgba(232,90,81,0.1);
  padding: 2px 8px;
  border-radius: 0;
}
.tm-sidebar__tools {
  padding-left: 24px;
  padding-top: 4px;
  display: none;
}
.tm-sidebar__category.active .tm-sidebar__tools {
  display: block;
}
.tm-sidebar__tool {
  display: block;
  padding: 8px 12px;
  color: var(--muted);
  text-decoration: none;
  border-radius: 0;
  font-size: 14px;
  transition: background 150ms ease, color 150ms ease;
  margin-bottom: 2px;
}
.tm-sidebar__tool:hover {
  background: rgba(232,90,81,0.08);
  color: var(--accent);
}

.tm-sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease;
}
body.sidebar-open .tm-sidebar-overlay {
  opacity: 1;
  pointer-events: all;
}

.tm-home {
  max-width: 1200px;
  margin: 0 auto;
}
.tm-home__hero {
  text-align: center;
  padding: 48px 16px 32px;
}
.tm-home__title {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: 1px;
  margin: 0 0 12px;
  color: var(--fg);
}
.tm-home__subtitle {
  font-size: 18px;
  color: var(--muted);
  margin: 0;
}
.tm-home__categories {
  padding: 0 16px 48px;
}
.tm-home__catalog {
  padding: 0 16px 48px;
}
.tm-catalog-section {
  margin-bottom: 48px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.tm-catalog-section:last-child {
  margin-bottom: 0;
}
.tm-catalog-section__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border);
}
.tm-catalog-section__title {
  font-size: 28px;
  font-weight: 700;
  margin: 0;
  color: var(--fg);
  display: flex;
  align-items: center;
  gap: 12px;
}
.tm-catalog-section__icon {
  font-size: 32px;
  line-height: 1;
}
.tm-catalog-section__count {
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}
.tm-catalog-section__tools {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.tm-category {
  margin-bottom: 48px;
}
.tm-category__title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 20px;
  color: var(--fg);
}
.tm-category__tools {
  gap: 16px;
}

.tm-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 140ms ease, border 140ms ease, box-shadow 140ms ease;
}
.tm-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 14px 32px rgba(232, 128, 116, 0.18); }
.tm-card__title { font-weight: 700; margin: 0 0 6px; }
.tm-card__desc { margin: 0; color: var(--muted); font-size: 14px; }

.tm-card.no-hover { cursor: default; }
.tm-card.no-hover:hover { transform: none; border-color: var(--border); }

.tm-tool {
  max-width: 980px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.tm-tool__seo {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  color: var(--fg);
  line-height: 1.7;
}
.tm-tool__seo h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 24px 0 12px;
  color: var(--fg);
}
.tm-tool__seo h2:first-child {
  margin-top: 0;
}
.tm-tool__seo h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 20px 0 10px;
  color: var(--fg);
}
.tm-tool__seo p {
  margin: 12px 0;
  color: var(--fg);
}
.tm-tool__seo ul,
.tm-tool__seo ol {
  margin: 12px 0;
  padding-left: 24px;
}
.tm-tool__seo li {
  margin: 6px 0;
  color: var(--fg);
}
.tm-tool__seo strong {
  font-weight: 600;
  color: var(--fg);
}
.tm-tool__header { margin-bottom: 12px; }
.tm-tool__title { margin: 0 0 4px; letter-spacing: 0.4px; }
.tm-tool__subtitle { margin: 0; color: var(--muted); }
.tm-tool__actions { display: flex; gap: 8px; margin-bottom: 12px; }
.tm-tool__section { margin-top: 12px; }
.tm-row { display: grid; gap: 10px; }

.tm-input, .tm-select, .tm-textarea {
  width: 100%;
  padding: 10px 12px;
  background: #fdfaf5;
  border: 1px solid var(--border);
  border-radius: 0;
  color: var(--fg);
}
.tm-textarea { min-height: 120px; resize: vertical; }
.tm-btn {
  padding: 10px 14px;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  border: none;
  color: #fdfaf5;
  font-weight: 700;
  border-radius: 0;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 140ms ease, filter 140ms ease;
}
.tm-btn.secondary {
  background: var(--card);
  color: var(--fg);
  border: 1px solid var(--border);
  transition: transform 120ms ease, border 140ms ease, box-shadow 140ms ease;
}
.tm-btn:hover { box-shadow: 0 10px 24px rgba(232, 128, 116, 0.22); transform: translateY(-1px); }
.tm-btn:active { transform: translateY(0); filter: brightness(0.97); }
.tm-btn.secondary:hover { border-color: var(--accent); box-shadow: 0 8px 18px rgba(0,0,0,0.08); }
.tm-btn.secondary:active { transform: translateY(0); }
.tm-btn.secondary:focus-visible, .tm-btn:focus-visible, .tm-input:focus-visible, .tm-select:focus-visible, .tm-textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.tm-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #f3ecdf;
  border-radius: 0;
  border: 1px solid var(--border);
  font-size: 13px;
}

.tm-preview {
  height: 120px;
  border-radius: 0;
  border: 1px solid var(--border);
  background: repeating-conic-gradient(#eae7dc 0% 25%, #d8c3a5 0% 50%) 50% / 16px 16px;
  position: relative;
  overflow: hidden;
}
.tm-preview__color {
  position: absolute;
  inset: 0;
}

.tm-grid-2 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.tm-grid-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.tm-grid-4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

.cg-tab, .tt-tab {
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease;
}
.cg-tab:hover, .tt-tab:hover { color: var(--fg); }
.cg-tab.active, .tt-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tm-toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  background: #fff;
  color: var(--fg);
  padding: 10px 14px;
  border-radius: 0;
  border: 1px solid var(--border);
  box-shadow: 0 12px 28px rgba(0,0,0,0.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease, transform 150ms ease;
  transform: translateY(6px);
}
.tm-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 640px) {
  .tm-header {
    grid-template-columns: 1fr auto;
    grid-template-areas: "brand burger" "search search";
  }
  .tm-header__brand { grid-area: brand; }
  .tm-header__search { grid-area: search; }
  .tm-burger { display: block; grid-area: burger; }
  .tm-nav { grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); }
  .tm-sidebar { width: 280px; }
  .tm-home__title { font-size: 36px; }
  .tm-home__subtitle { font-size: 16px; }
  .tm-catalog-section__tools { grid-template-columns: 1fr; }
  .tm-category__tools { grid-template-columns: 1fr; }
  .tm-tools-grid { grid-template-columns: 1fr; }
}

