.workspace:has(.hub-tools) {
  background: radial-gradient(ellipse at 40% 0%, #11241e, #0a1511 55%);
  color: #f2eee4;
}

.workspace:has(.hub-tools) > .topbar {
  border-color: #253831;
  background: #0b1814;
}

.workspace:has(.hub-tools) :is(.breadcrumb, .topbar-date, .private-tag) { color: #bac8be; }
.workspace:has(.hub-tools) .breadcrumb strong { color: #f4f5ec; }
.workspace:has(.hub-tools) :is(.feedback-trigger, .menu-toggle) {
  border-color: #344a3e;
  background: #14271f;
  color: #e6eee4;
}

.hub-tools {
  --hub-text: #f2eee4;
  --hub-muted: #b2c1b6;
  --hub-border: #2d4338;
  --hub-gold: #efd39b;
  color: var(--hub-text);
  color-scheme: dark;
}

.hub-tools [hidden] { display: none; }
.hub-tools :is(button, input):focus-visible { outline: 2px solid var(--hub-gold); outline-offset: 3px; }
.hub-masthead, .hub-directory-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.hub-masthead { margin: 0 0 21px; }
.hub-masthead h1 {
  margin: 0;
  font-size: clamp(34px, 4.5vw, 65px);
  letter-spacing: -.06em;
  line-height: 1;
}

.hub-masthead h1 span { color: var(--hub-gold); }
.hub-search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-height: 43px;
  padding: 8px 11px;
  border: 1px solid var(--hub-border);
  border-radius: 9px;
  background: #172a22;
  color: var(--hub-text);
  font-size: 13px;
  white-space: nowrap;
}
.hub-search-trigger:hover { border-color: #748c79; background: #1d3429; }
.hub-search-trigger .icon { width: 17px; height: 17px; color: #9dbbac; }
.hub-search-trigger kbd {
  padding: 3px 6px;
  border: 1px solid #3a5144;
  border-radius: 4px;
  color: var(--hub-muted);
  font: 11px/1.25 ui-monospace, "Courier New", monospace;
}

.hub-console {
  background: #111f19;
  border: 1px solid #3a5242;
  border-radius: 17px;
  box-shadow: 0 24px 65px #0309076b, inset 0 1px #c6f1d31a;
}

.hub-stage {
  --signal: #88eac4;
  --dial-size: clamp(210px, 30vw, 345px);
  --lab-opacity: .76;
  position: relative;
  z-index: 0;
  overflow: hidden;
  isolation: isolate;
  min-height: 345px;
  display: grid;
  align-items: center;
  border-radius: 16px 16px 0 0;
  background: radial-gradient(ellipse at 65% 20%, #1c4633, #101f18 58%);
}

.hub-stage[data-scene="simulator"] { --signal: #dcee96; --lab-opacity: .3; }
.hub-stage[data-scene="owner-simulator"] { --signal: #eed495; --lab-opacity: .3; }
.hub-stage[data-scene="aliases"] { --signal: #a9d9ea; --lab-opacity: .3; }
.hub-stage::before, .hub-stage::after {
  position: absolute;
  inset: 0;
  z-index: -2;
  content: '';
  pointer-events: none;
}
.hub-stage::before {
  background: linear-gradient(90deg, #101d18 5%, #101d18d9 32%, #0b191326 70%),
    url('/assets/hub/perfumaria-lab.webp') center 50% / cover no-repeat;
  opacity: var(--lab-opacity);
  transition: opacity .35s ease;
}
.hub-stage::after {
  z-index: -1;
  background:
    linear-gradient(0deg, #091711 0%, transparent 30% 78%, #101c1780),
    linear-gradient(90deg, #0c1914 0%, #0c191477 36%, transparent 74%);
}

.hub-preview { position: relative; z-index: 2; min-width: 0; padding: clamp(23px, 4.7vw, 55px); }
.hub-preview-content {
  display: grid;
  justify-items: start;
  gap: 14px;
  max-width: min(420px, 52%);
  animation: hub-module-enter .33s ease-out both;
}
.hub-preview h2 {
  margin: 0;
  font: 400 clamp(35px, 4.3vw, 62px) / .98 Georgia, "Times New Roman", serif;
  letter-spacing: -.05em;
  overflow-wrap: anywhere;
}
.hub-preview p { margin: 0; color: #d2e2d5; font-size: clamp(13px, 1.25vw, 16px); }
.hub-preview .hub-radar-status { min-height: 18px; color: #bdcdbf; font: 11px/1.4 ui-monospace, "Courier New", monospace; }
.hub-preview-symbol, .hub-tool-symbol {
  display: grid;
  width: 41px;
  height: 41px;
  place-items: center;
  border: 1px solid #426454;
  border-radius: 9px;
  color: #a9dcbd;
  background: #2c483c99;
}
.hub-preview-symbol { color: var(--signal); box-shadow: 0 0 22px #83edb521; }
.hub-launch, .hub-motion {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 8px 15px;
  border-radius: 7px;
  color: #182318;
  background: var(--hub-gold);
  font-size: 13px;
  font-weight: 750;
  transition: background .18s ease, transform .18s ease;
}
.hub-launch:hover { background: #ffe7b9; transform: translateY(-2px); }
.hub-launch:active { transform: translateY(1px); }
.hub-motion {
  position: absolute;
  z-index: 3;
  top: 16px;
  right: 16px;
  width: 37px;
  min-height: 37px;
  padding: 0;
  border: 1px solid #728879;
  background: #091912cc;
  color: #deebdf;
}
.hub-motion:hover { background: #22392d; }
.hub-motion .icon { width: 17px; height: 17px; }

.hub-dial {
  position: absolute;
  z-index: 1;
  top: 50%;
  right: 24%;
  width: var(--dial-size);
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid #80d8b273;
  border-radius: 50%;
  background: radial-gradient(circle, #143c2d15 33%, #0a241a8c);
  transform: translateY(-50%);
  box-shadow: 0 0 0 7px #9cd4b215, 0 0 0 8px #8ad8af37, inset 0 0 40px #062a1d59;
  opacity: .86;
  pointer-events: none;
  transition: opacity .3s;
}
.hub-stage:not([data-scene="radar"]) .hub-dial { opacity: .56; }
.hub-dial-grid, .hub-dial-sweep {
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
.hub-dial-grid {
  background:
    repeating-radial-gradient(circle, transparent 0 17%, #9ad9bb66 17.2% 17.7%, transparent 18% 24%),
    linear-gradient(0deg, transparent 49.7%, #8ad8ac77 49.8% 50.2%, transparent 50.3%),
    linear-gradient(90deg, transparent 49.7%, #8ad8ac77 49.8% 50.2%, transparent 50.3%);
}
.hub-dial-sweep {
  background: conic-gradient(from 0deg, transparent 0deg 298deg, #7bf4b920 329deg, #a2ffd67a 357deg, var(--signal) 359deg, transparent);
  animation: hub-sweep 8s linear infinite;
}
.hub-dial-center, .hub-dial-blip {
  position: absolute;
  width: 7px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 13px var(--signal);
}
.hub-dial-center { top: calc(50% - 3px); left: calc(50% - 3px); }
.hub-dial-blip { top: 30%; left: 67%; animation: hub-blip 8s ease-out infinite; }
.hub-dial-blip:nth-child(5) { top: 72%; left: 34%; animation-delay: -3.75s; }
.hub-dial-blip:nth-child(6) { top: 38%; left: 27%; animation-delay: -1.7s; }
@keyframes hub-sweep { to { transform: rotate(1turn); } }
@keyframes hub-blip {
  0%, 100% { opacity: .24; }
  10% { opacity: 1; transform: scale(1.35); }
  37% { opacity: .24; transform: scale(1); }
}
@keyframes hub-module-enter {
  from { opacity: .6; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}
.hub-tools.is-paused :is(.hub-dial-sweep, .hub-dial-blip) { animation-play-state: paused; }
.hub-tools.is-paused .hub-preview-content { animation: none; }

.hub-switcher {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  border-top: 1px solid #344a3d;
  border-radius: 0 0 16px 16px;
  background: #12231c;
}
.hub-tab {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  min-height: 59px;
  padding: 9px;
  border-top: 2px solid transparent;
  border-left: 1px solid #2c4035;
  background: transparent;
  color: var(--hub-muted);
  font-size: 13px;
  font-weight: 650;
  text-align: center;
  transition: border-color .18s ease, color .18s ease, background .18s ease;
}
.hub-tab:first-child { border-left-color: transparent; border-radius: 0 0 0 16px; }
.hub-tab:last-child { border-radius: 0 0 16px 0; }
.hub-tab:hover { background: #254337; color: var(--hub-text); }
.hub-tab[aria-selected="true"] { border-top-color: #b4efc4; background: #284538; color: #f4f7eb; }
.hub-tab .icon { width: 18px; height: 18px; }
.hub-tab[aria-selected="true"] .icon { color: #c8f3ce; }

.hub-tools-operations { margin-top: 30px; }
.hub-directory-head { margin-bottom: 14px; }
.hub-directory-head h2 { margin: 0; font: 400 27px/1.1 Georgia, "Times New Roman", serif; }
.hub-filters { display: flex; gap: 5px; flex-wrap: wrap; }
.hub-filters button {
  min-height: 33px;
  padding: 5px 10px;
  background: transparent;
  border: 1px solid var(--hub-border);
  border-radius: 6px;
  color: var(--hub-muted);
  font-size: 12px;
  transition: background .16s ease, border-color .16s ease;
}
.hub-filters button:hover { border-color: #6b8975; }
.hub-filters button[aria-pressed="true"] { background: #2e4b3c; color: #edf7e9; border-color: #64836c; }

.hub-tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 10px; }
.hub-tool {
  min-width: 0;
  min-height: 94px;
  padding: 12px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 17px;
  align-items: center;
  gap: 10px;
  text-align: left;
  color: var(--hub-text);
  border: 1px solid var(--hub-border);
  border-radius: 9px;
  background: #13241d;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.hub-tool:hover { border-color: #729482; background: #1e372b; transform: translateY(-2px); }
.hub-tool-symbol { width: 38px; height: 38px; }
.hub-tool-symbol .icon, .hub-tool-arrow .icon { width: 17px; height: 17px; }
.hub-tool-content { display: grid; gap: 4px; overflow-wrap: anywhere; }
.hub-tool-content strong { font-size: 13px; line-height: 1.3; }
.hub-tool-content > span { color: var(--hub-muted); font-size: 11.5px; line-height: 1.4; }
.hub-tool-arrow { display: flex; color: #add9bc; transition: transform .16s ease; }
.hub-tool:hover .hub-tool-arrow { transform: translateX(2px); }

.hub-command {
  width: min(530px, calc(100% - 26px));
  max-height: min(640px, calc(100% - 26px));
  padding: 16px;
  margin: min(13vh, 120px) auto auto;
  overflow: auto;
  background: #12241b;
  color: var(--hub-text);
  border: 1px solid #577463;
  border-radius: 13px;
  box-shadow: 0 30px 94px #020806bf;
}
.hub-command[open] { animation: hub-module-enter .2s ease-out both; }
.hub-command::backdrop { background: #020906b9; backdrop-filter: blur(5px); }
.hub-command-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.hub-command-head h2 { margin: 0; }
.hub-command-close, .hub-command-result { background: #192d23; color: var(--hub-text); }
.hub-command-close { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 6px; }
.hub-command-close:hover, .hub-command-result:is(:hover, :focus-visible) { background: #2c4839; }
.hub-command-field { display: flex; align-items: center; gap: 8px; margin: 0 0 11px; padding-left: 11px; border: 1px solid #76907e; border-radius: 7px; background: #0b1a12; color: #b6debd; }
.hub-command-field:focus-within { border-color: var(--hub-gold); }
.hub-command-field input { background: transparent; color: var(--hub-text); border: 0; padding-left: 1px; }
.hub-command-field input:focus-visible { outline: none; }
.hub-command-field input::placeholder { color: #9fb6a6; }
.hub-command-results { display: grid; gap: 5px; }
.hub-command-result {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 20px;
  justify-items: start;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 7px 9px;
  border-radius: 6px;
  text-align: left;
  font-size: 13px;
}
.hub-command-result .icon { color: #a9dcc1; width: 17px; height: 17px; }
.hub-command-empty { margin: 10px 0 4px; color: var(--hub-muted); }

@media (max-width: 880px) {
  .hub-dial { right: 17%; }
}
@media (max-width: 640px) {
  .hub-masthead { margin-bottom: 15px; }
  .hub-stage { min-height: 316px; }
  .hub-stage::before {
    background-image: linear-gradient(90deg, #06150ed9 0% 34%, transparent 84%), url('/assets/hub/perfumaria-lab.webp');
    background-position: right 49%;
  }
  .hub-stage::after { background: linear-gradient(90deg, #0a1914ea, #0a191488 55%, #0a19140d 90%); }
  .hub-dial { right: -75px; --dial-size: 250px; opacity: .64; }
  .hub-preview { padding: 39px 19px 25px; }
  .hub-preview-content { max-width: min(280px, 79%); gap: 12px; }
  .hub-preview h2 { font-size: clamp(29px, 8.7vw, 48px); }
  .hub-switcher { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hub-tab { min-height: 50px; border-bottom: 1px solid #2c4035; font-size: 11.5px; border-radius: 0; }
  .hub-tab:first-child, .hub-tab:last-child { border-radius: 0; }
  .hub-tab:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .hub-tools-operations { margin-top: 22px; }
  .hub-directory-head { gap: 12px; }
  .hub-search-trigger kbd { display: none; }
}
@media (max-width: 380px) {
  .workspace:has(.hub-tools) :is(.topbar-left, .breadcrumb, .breadcrumb strong) { min-width: 0; }
  .workspace:has(.hub-tools) .breadcrumb { gap: 0; font-size: 0; }
  .workspace:has(.hub-tools) .breadcrumb > span { display: none; }
  .workspace:has(.hub-tools) .breadcrumb strong { font-size: 11px; overflow-wrap: anywhere; }
  .workspace:has(.hub-tools) .topbar-right { flex-shrink: 0; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .hub-tools *, .hub-tools *::before, .hub-tools *::after { animation: none !important; transition: none !important; }
  .hub-motion { display: none; }
}
