/* ChatHive 通信壳：左图标栏 + 可选中间栏（#tt-chathive-aside）+ 主区。
   中间栏空时主区只让导航宽；插件 Teleport 填入后按 nav + aside。
   vendor `transition: all` 特异性很高，必须对等选择器 + !important，否则进壳会方变圆、主区抖。 */

.chathive-navigation-brand.tt-appcenter-btn {
  width: 100%;
  height: 3.5rem;
  border-radius: 0;
}

html[data-tt-shell="chathive"] .chathive-navigation .nav-pills {
  --chathive-nav-pills-border-radius: 50%;
}

html[data-tt-shell="chathive"] body .chathive-navigation,
html[data-tt-shell="chathive"] body .chathive-navigation .chathive-navigation-body .nav-item .nav-link,
html[data-tt-shell="chathive"] body .chathive-navigation .chathive-navigation-body .nav-item .nav-link:hover,
html[data-tt-shell="chathive"] body .chathive-navigation .chathive-navigation-footer .nav-link,
html[data-tt-shell="chathive"] body .chathive-content,
html[data-tt-shell="chathive"] body .chathive-content .chathive-content-body {
  transition: none !important;
}

html[data-tt-shell="chathive"] body .chathive-content {
  margin-left: var(--chathive-navigation-width, 6rem) !important;
}

html[data-tt-shell="chathive"] body:has(#tt-chathive-aside > *) .chathive-content {
  margin-left: calc(var(--chathive-navigation-width, 6rem) + var(--chathive-asidebar-width, 25rem)) !important;
}

html[data-tt-shell="chathive"] #tt-chathive-aside:not(:has(*)) {
  display: none !important;
}

html[data-tt-shell="chathive"] .tt-chathive-aside-toggler {
  display: none;
}

html[data-tt-shell="chathive"] body:has(#tt-chathive-aside > *) .tt-chathive-aside-toggler {
  display: inline-flex;
}

@media (min-width: 1200px) {
  html[data-tt-shell="chathive"] .tt-chathive-aside-toggler {
    display: none !important;
  }
}

@media (max-width: 1199.98px) {
  html[data-tt-shell="chathive"] body:has(#tt-chathive-aside > *) .chathive-content {
    margin-left: var(--chathive-navigation-width, 6rem) !important;
  }
}

@media (max-width: 991.98px) {
  html[data-tt-shell="chathive"] body .chathive-content {
    margin-left: 0 !important;
  }
}

html[data-tt-shell="chathive"] body .chathive-navigation .chathive-navigation-body .nav-item .nav-link,
html[data-tt-shell="chathive"] body .chathive-navigation .chathive-navigation-footer .nav-link {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 3rem !important;
  height: 3rem !important;
  min-width: 3rem;
  min-height: 3rem;
  padding: 0.5rem !important;
  border-radius: 50% !important;
}

body .chathive-navigation .chathive-navigation-body .nav-item .nav-link .bi,
body .chathive-navigation .chathive-navigation-footer .nav-link .bi,
body .chathive-navigation .chathive-navigation-body .nav-item .nav-link .tt-icon,
body .chathive-navigation .chathive-navigation-footer .nav-link .tt-icon {
  display: inline-block;
  line-height: 1;
  font-size: 1.25rem;
  width: 1.25rem;
  height: 1.25rem;
  color: inherit;
}

body .chathive-navigation .chathive-navigation-body .nav-item .nav-link.active,
body .chathive-navigation .chathive-navigation-body .nav-item .nav-link.active .bi,
body .chathive-navigation .chathive-navigation-body .nav-item .nav-link.active .tt-icon {
  color: var(--chathive-nav-pills-link-active-color, #fff);
}

html[data-tt-shell="chathive"] .chathive-navigation .chathive-chat-badge {
  position: absolute;
  top: 0.1rem;
  right: 0.05rem;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.22rem;
  border-radius: 999px;
  background: var(--bs-danger, #dc3545);
  color: #fff;
  font-size: 0.625rem;
  line-height: 1rem;
  font-weight: 600;
  text-align: center;
  pointer-events: none;
}

.chathive-main-header-right .tt-chrome {
  margin-left: auto;
}

.ch-stage {
  padding: 1rem 1.25rem 1.5rem;
  min-height: calc(100vh - var(--chathive-header-height, 5rem));
}

html[data-tt-shell="chathive"] main.chathive-content:has(.jmx-todo-page),
html[data-tt-shell="chathive"] main.chathive-content:has(.jmx-cal-page),
html[data-tt-shell="chathive"] main.chathive-content:has(.jmx-notice-page),
html[data-tt-shell="chathive"] main.chathive-content:has(.jmx-chat-page),
html[data-tt-shell="chathive"] main.chathive-content:has(.jmx-meeting-page) {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

html[data-tt-shell="chathive"] main.chathive-content:has(.jmx-todo-page) > .chathive-main-header,
html[data-tt-shell="chathive"] main.chathive-content:has(.jmx-cal-page) > .chathive-main-header,
html[data-tt-shell="chathive"] main.chathive-content:has(.jmx-notice-page) > .chathive-main-header,
html[data-tt-shell="chathive"] main.chathive-content:has(.jmx-chat-page) > .chathive-main-header,
html[data-tt-shell="chathive"] main.chathive-content:has(.jmx-meeting-page) > .chathive-main-header {
  flex-shrink: 0;
}

html[data-tt-shell="chathive"] .ch-stage:has(.jmx-todo-page),
html[data-tt-shell="chathive"] .ch-stage:has(.jmx-cal-page),
html[data-tt-shell="chathive"] .ch-stage:has(.jmx-notice-page),
html[data-tt-shell="chathive"] .ch-stage:has(.jmx-chat-page),
html[data-tt-shell="chathive"] .ch-stage:has(.jmx-meeting-page) {
  padding: 0;
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

html[data-tt-shell="chathive"] .ch-stage:has(.jmx-todo-page) .micro-slot,
html[data-tt-shell="chathive"] .ch-stage:has(.jmx-todo-page) .jmx-todo-page,
html[data-tt-shell="chathive"] .ch-stage:has(.jmx-cal-page) .micro-slot,
html[data-tt-shell="chathive"] .ch-stage:has(.jmx-cal-page) .jmx-cal-page,
html[data-tt-shell="chathive"] .ch-stage:has(.jmx-notice-page) .micro-slot,
html[data-tt-shell="chathive"] .ch-stage:has(.jmx-notice-page) .jmx-notice-page,
html[data-tt-shell="chathive"] .ch-stage:has(.jmx-chat-page) .micro-slot,
html[data-tt-shell="chathive"] .ch-stage:has(.jmx-chat-page) .jmx-chat-page,
html[data-tt-shell="chathive"] .ch-stage:has(.jmx-meeting-page) .micro-slot,
html[data-tt-shell="chathive"] .ch-stage:has(.jmx-meeting-page) .jmx-meeting-page {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

html[data-tt-shell="chathive"] .tt-plugin-stage > .hello,
html[data-tt-shell="chathive"] .tt-plugin-stage > .page {
  max-width: none;
  width: 100%;
  color: inherit;
  font-family: inherit;
  display: grid;
  gap: 1rem;
  padding: 1.25rem 1.5rem 1.5rem;
  background-color: var(--tt-tone-surface, var(--chathive-card-bg, var(--bs-body-bg)));
  border: 1px solid var(--tt-tone-border, var(--chathive-border-color, var(--bs-border-color)));
  border-radius: 0.75rem;
}

html[data-tt-shell="chathive"] .tt-plugin-stage > .tt-plugin-page {
  max-width: none;
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  font-family: inherit;
}

html[data-tt-shell="chathive"] .tt-plugin-page .card {
  background: var(--tt-tone-surface, var(--chathive-card-bg, var(--bs-body-bg)));
  border-radius: 0.75rem;
}

html[data-tt-shell="chathive"] .tt-plugin-stage .hello h1,
html[data-tt-shell="chathive"] .tt-plugin-stage .page h1,
html[data-tt-shell="chathive"] .tt-plugin-stage .ctrl-head h1 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
  color: inherit;
}

html[data-tt-shell="chathive"] .tt-plugin-stage .muted,
html[data-tt-shell="chathive"] .tt-plugin-stage .ctrl-head p {
  color: var(--bs-secondary-color, #6c757d);
  font-size: 0.875rem;
  margin: 0;
}

html[data-tt-shell="chathive"] .tt-plugin-stage nav.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

html[data-tt-shell="chathive"] .tt-plugin-stage nav.nav a {
  padding: 0.35rem 0.85rem;
  border-radius: 1.25rem;
  color: var(--bs-secondary-color, #6c757d);
  text-decoration: none;
  font-size: 0.875rem;
}

html[data-tt-shell="chathive"] .tt-plugin-stage nav.nav a.router-link-exact-active,
html[data-tt-shell="chathive"] .tt-plugin-stage nav.nav a.router-link-active {
  color: var(--bs-primary);
  background: color-mix(in srgb, var(--bs-primary) 12%, transparent);
  font-weight: 600;
}

html[data-tt-shell="chathive"] .tt-plugin-stage form.row,
html[data-tt-shell="chathive"] .tt-plugin-stage form.stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  align-items: center;
}

html[data-tt-shell="chathive"] .tt-plugin-stage form.stack {
  flex-direction: column;
  align-items: stretch;
  max-width: 28rem;
}

html[data-tt-shell="chathive"] .tt-plugin-stage .hello input:not([type="checkbox"]):not([type="radio"]),
html[data-tt-shell="chathive"] .tt-plugin-stage .page input:not([type="checkbox"]):not([type="radio"]),
html[data-tt-shell="chathive"] .tt-plugin-stage .hello select,
html[data-tt-shell="chathive"] .tt-plugin-stage .page select,
html[data-tt-shell="chathive"] .tt-plugin-stage .hello textarea,
html[data-tt-shell="chathive"] .tt-plugin-stage .page textarea {
  flex: 1 1 12rem;
  min-height: 2.35rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--tt-tone-border, var(--bs-border-color));
  border-radius: 1.25rem;
  background: var(--tt-tone-bg, var(--bs-body-bg));
  color: inherit;
}

html[data-tt-shell="chathive"] .tt-plugin-stage .hello button:not(.link):not(.ghost):not(.tt-shell-home-card),
html[data-tt-shell="chathive"] .tt-plugin-stage .page button:not(.link):not(.ghost):not(.tt-shell-home-card) {
  min-height: 2.35rem;
  padding: 0.4rem 1rem;
  border: 0;
  border-radius: 1.25rem;
  background: var(--bs-primary);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

html[data-tt-shell="chathive"] .tt-plugin-stage .hello button.link,
html[data-tt-shell="chathive"] .tt-plugin-stage .page button.link,
html[data-tt-shell="chathive"] .tt-plugin-stage .page a.link {
  background: none;
  color: var(--bs-primary);
  border: 0;
  padding: 0 0.35rem;
}

html[data-tt-shell="chathive"] .tt-plugin-stage .hello button.ghost,
html[data-tt-shell="chathive"] .tt-plugin-stage .page button.ghost {
  background: transparent;
  color: inherit;
  border: 1px solid var(--tt-tone-border, var(--bs-border-color));
  border-radius: 1.25rem;
  min-height: 2.35rem;
  padding: 0.4rem 1rem;
}

html[data-tt-shell="chathive"] .tt-plugin-stage .hello table,
html[data-tt-shell="chathive"] .tt-plugin-stage .page table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
}

html[data-tt-shell="chathive"] .tt-plugin-stage .hello th,
html[data-tt-shell="chathive"] .tt-plugin-stage .hello td,
html[data-tt-shell="chathive"] .tt-plugin-stage .page th,
html[data-tt-shell="chathive"] .tt-plugin-stage .page td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--tt-tone-border, var(--bs-border-color));
  text-align: left;
  font-size: 0.875rem;
  background: transparent;
  color: inherit;
}

html[data-tt-shell="chathive"] .tt-plugin-stage a.hit,
html[data-tt-shell="chathive"] .tt-plugin-stage a.tile,
html[data-tt-shell="chathive"] .tt-plugin-stage .tile {
  display: grid;
  gap: 0.15rem;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--tt-tone-border, var(--bs-border-color));
  background: var(--tt-tone-surface, var(--bs-body-bg));
  text-decoration: none;
  color: inherit;
}

html[data-tt-shell="chathive"] .tt-plugin-stage .bubble {
  background: var(--tt-tone-muted, var(--bs-tertiary-bg, #f8f9fa));
  border: 1px solid var(--tt-tone-border, var(--bs-border-color));
  border-radius: 1rem;
  padding: 0.75rem 1rem;
}

html[data-tt-shell="chathive"] .tt-plugin-stage .bubble.me {
  border-color: color-mix(in srgb, var(--bs-primary) 35%, var(--tt-tone-border, #dee2e6));
  background: color-mix(in srgb, var(--bs-primary) 10%, transparent);
}

html[data-tt-shell="chathive"] .tt-plugin-stage .error {
  color: var(--bs-danger);
}
