:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #edf3f6;
  color: #142638;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { background: #edf3f6; }
a { color: inherit; text-decoration: none; }

.hub-workspace {
  display: grid;
  grid-template-rows: 70px minmax(0, 1fr);
  width: 100%;
  height: 100%;
}

.hub-bar {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto minmax(190px, 1fr);
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid #d9e3e8;
  box-shadow: 0 4px 16px rgba(20, 38, 56, 0.08);
}

.hub-brand { display: inline-flex; align-items: center; gap: 10px; width: max-content; }
.hub-brand > span:last-child { display: flex; align-items: baseline; gap: 5px; }
.hub-brand strong { font-size: 18px; letter-spacing: -0.03em; }
.hub-brand small { color: #35aebb; font-size: 17px; font-weight: 700; }
.hub-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #132839;
  color: #fff;
  font-size: 18px;
  box-shadow: 0 6px 14px rgba(19, 40, 57, 0.18);
}
.hub-mark b { color: #fff; }
.hub-mark i { color: #52c2c8; font-style: normal; }

.product-switcher {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px;
  border: 1px solid #dde7eb;
  border-radius: 14px;
  background: #f4f8fa;
}
.product-switcher a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 10px;
  color: #536574;
  font-size: 14px;
  font-weight: 700;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}
.product-switcher a:hover { color: #132839; background: #e8f1f3; }
.product-switcher a.active {
  color: #fff;
  background: linear-gradient(135deg, #17314a, #2a526b);
  box-shadow: 0 5px 12px rgba(23, 49, 74, 0.22);
}
.nav-icon {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border-radius: 8px;
  background: rgba(45, 173, 184, 0.15);
  color: #218993;
  padding: 0 5px;
  font-size: 11px;
}
.product-switcher a.active .nav-icon { background: rgba(255,255,255,.16); color: #7ce4e5; }

.hub-state {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #667886;
  font-size: 13px;
  font-weight: 650;
}
.state-dot { width: 8px; height: 8px; border-radius: 50%; background: #2eb67d; box-shadow: 0 0 0 4px rgba(46,182,125,.12); }

.product-frame-wrap { position: relative; min-width: 0; min-height: 0; background: #fff; }
#product-frame { display: block; width: 100%; height: 100%; border: 0; background: #fff; opacity: 0; transition: opacity 180ms ease; }
#product-frame.ready { opacity: 1; }
.frame-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  background: #f5f8fa;
  color: #5d6f7c;
}
.frame-loading.hidden { display: none; }
.frame-loading p { margin: 0; }
.spinner { width: 34px; height: 34px; border: 3px solid #d7e5e8; border-top-color: #35aebb; border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 850px) {
  .hub-workspace { grid-template-rows: 118px minmax(0, 1fr); }
  .hub-bar { grid-template-columns: 1fr auto; grid-template-rows: 58px 52px; gap: 0 12px; padding: 0 14px 8px; }
  .product-switcher { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; }
  .product-switcher a { flex: 1; justify-content: center; padding: 0 8px; }
  .hub-state { grid-column: 2; grid-row: 1; }
}

@media (max-width: 520px) {
  .hub-state { display: none; }
  .hub-bar { grid-template-columns: 1fr; }
  .product-switcher a { font-size: 12px; gap: 5px; }
}
