.tc-menu-btn,
.tc-mobile-only-action,
.tc-drawer-backdrop,
.tc-drawer {
  display: none;
}

.tc-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tc-action-link {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: var(--surface2);
  border: 1px solid var(--line);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: border-color .15s, color .15s, background .15s;
}

.tc-action-link:hover {
  color: var(--text);
  border-color: var(--accent);
}

.tc-site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 22px 24px !important;
  background: color-mix(in srgb, var(--surface) 92%, var(--bg)) !important;
  border-top: 1px solid var(--line) !important;
  color: var(--muted) !important;
  font-size: 13px !important;
  line-height: 1.5;
}

.tc-site-footer nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

.tc-site-footer a {
  margin: 0 !important;
  color: var(--muted) !important;
  text-decoration: none;
  font-weight: 700;
}

.tc-site-footer a:hover {
  color: var(--text) !important;
}

.tc-site-copy {
  color: var(--muted);
  font-weight: 600;
}

@media (max-width: 900px) {
  .tc-topbar {
    min-height: 64px;
    padding: 8px 10px !important;
    display: grid !important;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
  }

  .tc-menu-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface2);
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  .tc-menu-btn svg,
  .tc-action-link svg {
    width: 18px;
    height: 18px;
  }

  .tc-brand {
    min-width: 0;
    justify-content: center;
    gap: 8px;
  }

  .tc-brand img {
    width: 28px !important;
    height: 28px !important;
  }

  .tc-brand span {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px !important;
  }

  .tc-nav-links {
    display: none !important;
  }

  .tc-actions {
    gap: 6px !important;
  }

  .tc-actions select {
    width: 58px;
    min-width: 58px;
    padding: 7px 6px !important;
    font-size: 12px !important;
    text-align: center;
  }

  .tc-actions button,
  .tc-action-link {
    width: 40px !important;
    height: 40px !important;
    border-radius: 11px !important;
    flex: 0 0 auto;
  }

  .tc-mobile-only-action {
    display: inline-flex;
  }

  .tc-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 180;
    background: rgba(0,0,0,.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }

  .tc-drawer {
    position: fixed;
    z-index: 181;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(82vw, 320px);
    padding: 18px;
    background: var(--surface);
    border-right: 1px solid var(--line);
    box-shadow: 18px 0 45px rgba(0,0,0,.35);
    transform: translateX(-105%);
    transition: transform .2s ease;
    display: block;
  }

  .tc-drawer.is-open {
    transform: translateX(0);
  }

  .tc-drawer-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
    display: block;
  }

  .tc-drawer-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 14px;
    font-weight: 800;
  }

  .tc-drawer-head img {
    width: 34px;
    height: 34px;
  }

  .tc-drawer a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
  }

  .tc-drawer a.active,
  .tc-drawer a:hover {
    color: var(--text);
    background: var(--surface2);
  }
}

@media (max-width: 520px) {
  .tc-topbar {
    grid-template-columns: 44px minmax(112px, 1fr) auto;
    gap: 5px;
  }

  .tc-brand span {
    max-width: 118px;
  }

  .tc-actions {
    gap: 4px !important;
  }

  .tc-actions select {
    width: 52px;
    min-width: 52px;
  }

  .tc-actions button,
  .tc-action-link {
    width: 36px !important;
    height: 36px !important;
  }

  .tc-site-footer {
    padding: 20px 16px 24px !important;
    flex-direction: column;
    gap: 10px;
    font-size: 12px !important;
  }

  .tc-site-footer nav {
    gap: 16px;
  }
}
