/* hub — sidebar + main layout (SPA shell) */

#hub-root {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.site-footer {
  margin-top: auto;
}

.hub-shell {
  flex: 1 0 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 260px 1fr;
  background: var(--color-bg);
}

@media (max-width: 900px) {
  .hub-shell {
    grid-template-columns: 1fr;
  }
}

.hub-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 60;
}

.hub-sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow: auto;
  border-right: 1px solid var(--color-border-subtle);
  background: color-mix(in oklab, var(--color-surface) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: var(--space-6);
  z-index: 70;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in oklab, var(--color-text-muted) 55%, transparent)
    color-mix(in oklab, var(--color-surface) 55%, transparent);
}

.hub-sidebar::-webkit-scrollbar {
  width: 10px;
}

.hub-sidebar::-webkit-scrollbar-track {
  margin: 6px 0;
  background: color-mix(in oklab, var(--color-surface) 40%, transparent);
  border-radius: 999px;
  border: 1px solid color-mix(in oklab, var(--color-border-subtle) 70%, transparent);
}

.hub-sidebar::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    color-mix(in oklab, var(--color-text-primary) 22%, transparent),
    color-mix(in oklab, var(--color-text-muted) 35%, transparent)
  );
  border: 1px solid color-mix(in oklab, var(--color-border-subtle) 75%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 6px 18px rgba(0, 0, 0, 0.18);
}

.hub-sidebar::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    180deg,
    color-mix(in oklab, var(--color-text-primary) 30%, transparent),
    color-mix(in oklab, var(--color-text-muted) 45%, transparent)
  );
}

html[data-theme="light"] .hub-sidebar {
  scrollbar-color: color-mix(in oklab, var(--color-text-muted) 65%, transparent)
    color-mix(in oklab, var(--color-surface) 70%, transparent);
}

html[data-theme="light"] .hub-sidebar::-webkit-scrollbar-thumb {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 6px 18px rgba(15, 23, 42, 0.12);
}

@media (max-width: 900px) {
  .hub-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(86vw, 320px);
    transform: translateX(-110%);
    transition: transform 0.22s var(--ease-out);
    box-shadow: 0 28px 60px rgba(0, 0, 0, 0.45);
  }

  .hub-shell.is-drawer-open .hub-sidebar {
    transform: translateX(0);
  }

  .hub-shell.is-drawer-open .hub-drawer-backdrop {
    display: block;
  }
}

.hub-sidebar__top {
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--color-border-subtle);
  margin-bottom: var(--space-5);
}

.hub-brand {
  display: flex;
  gap: var(--space-4);
  align-items: center;
}

.hub-brand {
  text-decoration: none;
  color: inherit;
}

.hub-brand:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-xl);
}

.hub-brand__logo {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  border: 1px solid var(--color-border-subtle);
  box-shadow: var(--shadow-glass);
}

.hub-brand__name {
  font-size: var(--text-base);
  font-weight: 750;
  letter-spacing: var(--tracking-tight);
  color: var(--color-text-primary);
  line-height: 1.15;
}

.hub-brand__sub {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
}

.hub-nav__group + .hub-nav__group {
  margin-top: var(--space-6);
}

.hub-nav__title {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--color-text-muted);
  margin: 0 0 var(--space-3);
}

a.hub-nav__item {
  text-decoration: none;
  box-sizing: border-box;
}

.hub-nav__item {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  font-weight: 650;
  cursor: pointer;
  transition:
    background var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}

.hub-nav__item:hover {
  background: var(--color-surface-hover);
  color: var(--color-text-primary);
  border-color: var(--color-border-subtle);
}

.hub-nav__item:active {
  transform: scale(0.99);
}

.hub-nav__item[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

.hub-nav__item[aria-disabled="true"]:hover {
  background: transparent;
  border-color: transparent;
  color: var(--color-text-secondary);
}

.hub-nav__item.is-active {
  background: var(--color-accent-soft);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--color-text-primary);
}

html[data-theme="light"] .hub-nav__item.is-active {
  border-color: rgba(15, 23, 42, 0.12);
}

.hub-main {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto 1fr;
}

.hub-adfit {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  box-sizing: border-box;
  border-bottom: 1px solid var(--color-border-subtle);
  background: color-mix(in oklab, var(--color-bg) 92%, transparent);
}

.hub-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--color-border-subtle);
  background: color-mix(in oklab, var(--color-surface) 84%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

@media (min-width: 901px) {
  .hub-topbar__icon#hub-menu-btn {
    display: none;
  }
}

.hub-topbar__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-subtle);
  background: var(--color-surface);
  color: var(--color-text-primary);
  cursor: pointer;
  transition:
    background var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}

.hub-topbar__icon:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-border-strong);
}

.hub-topbar__icon:active {
  transform: scale(0.98);
}

.hub-burger {
  width: 20px;
  height: 14px;
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
}

.hub-burger span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.9;
}

.hub-topbar__kicker {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
}

.hub-topbar__name {
  margin-top: 1px;
  font-size: var(--text-lg);
  font-weight: 750;
  letter-spacing: var(--tracking-tight);
  color: var(--color-text-primary);
}

.hub-content {
  padding: var(--space-8) var(--space-6) var(--space-16);
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

.tool-container {
  min-height: 40vh;
}

/* in-tool tabs (glass) */
.tool-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
  margin: 0 0 var(--space-8);
}

.tool-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 650;
  border: 1px solid var(--color-border-subtle);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition:
    background var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out);
}

.tool-tab:hover {
  background: var(--color-surface-hover);
  color: var(--color-text-primary);
}

.tool-tab[aria-current="page"] {
  background: var(--color-accent-soft);
  border-color: var(--color-accent);
  color: var(--color-text-primary);
}

.tool-pane {
  display: none;
}

.tool-pane.is-active {
  display: block;
  animation: spaSectionIn 0.42s var(--ease-out) both;
}

