/* The Mosaik HQ console: bots, chat and side panel. Shown on the HQ page and, as a portal into it, under the
   home page hero. The shared console parts (feed, bubbles, approvals) come from mocks.css. */

.hqc {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr) 292px;
  max-width: 1160px;
  margin-inline: auto;
  overflow: hidden;
  border: 1px solid var(--panel-line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow-lg);
  color: var(--panel-ink);
  font-size: 14px;
  text-align: start;
}
.hqc .av-frame { fill: var(--panel); }
.hqc .av-main { stroke: var(--panel-line); stroke-width: 1.5; }

.hqc-bots { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.hqc-bots li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
}
.hqc-bots li.is-active { background: var(--panel-2); }
.hqc-bots .bot-av { width: 30px; height: 30px; }
.hqc-bots b,
.hqc-bots small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hqc-bots b { font-size: 13.5px; font-weight: 600; }
.hqc-bots small { font-size: 12px; color: var(--panel-ink-3); }
.hqc-bots .hqc-label {
  display: block;
  padding: 12px 10px 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--panel-ink-3);
}
.hqc-count {
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--panel-accent);
  color: var(--panel);
  font-size: 11px;
  font-weight: 600;
}
.hqc-dot {
  width: 7px;
  height: 7px;
  margin-inline-end: 5px;
  border-radius: 50%;
  background: var(--panel-ok);
  animation: hq-pulse 1.8s ease-in-out infinite;
}
@keyframes hq-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--panel-ok) 45%, transparent); }
  50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--panel-ok) 0%, transparent); }
}

.hqc-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hqc-title .bot-av { width: 24px; height: 24px; }
.hqc-title b { flex: none; }
.hqc-title .dim {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hqc-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border-inline-start: 1px solid var(--panel-line);
  background: color-mix(in srgb, var(--panel-2) 40%, var(--panel));
}
.hqc-tabs {
  display: flex;
  gap: 3px;
  padding: 3px;
  border-radius: 10px;
  background: var(--panel-2);
  font-size: 12px;
}
.hqc-tabs span {
  flex: 1;
  padding: 5px 6px;
  overflow: hidden;
  border-radius: 7px;
  color: var(--panel-ink-3);
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hqc-tabs .is-active { background: var(--panel); color: var(--panel-ink); box-shadow: 0 0 0 1px var(--panel-line); }

.hqc-view,
.hqc-graph {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--panel-line);
  border-radius: 14px;
  background: var(--panel);
}
.hqc-view-title { font-size: 13.5px; font-weight: 600; }
.hqc-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.hqc-metrics div { min-width: 0; padding: 8px 9px; border-radius: 10px; background: var(--panel-2); }
.hqc-metrics small {
  display: block;
  overflow: hidden;
  font-size: 11px;
  color: var(--panel-ink-3);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hqc-metrics b { font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.hqc-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 12px; }
.hqc-table th {
  padding: 0 4px 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-align: start;
  text-transform: uppercase;
  color: var(--panel-ink-3);
}
.hqc-table th:first-child { width: 42%; }
.hqc-table th:nth-child(2) { width: 27%; }
.hqc-table td {
  padding: 7px 4px;
  border-top: 1px solid var(--panel-line);
  color: var(--panel-ink-2);
  line-height: 1.35;
  vertical-align: top;
}
.hqc-table td:first-child { color: var(--panel-ink); }
.hqc-table .fit { padding: 1px 7px; font-size: 11px; white-space: nowrap; }
.hqc-graph small { font-size: 11.5px; color: var(--panel-ink-3); }

@media (max-width: 1100px) {
  .hqc { grid-template-columns: 236px minmax(0, 1fr); }
  .hqc-panel { display: none; }
}
@media (max-width: 760px) {
  .hqc { grid-template-columns: minmax(0, 1fr); border-radius: 16px; }
}


/* ---------- Portal: the console under the home page hero, as a link into the HQ page ---------- */
.hq-portal {
  position: relative;
  display: block;
  max-width: 1160px;
  margin-inline: auto;
  border-radius: 22px;
  color: inherit;
  text-decoration: none;
}
.hq-portal-frame {
  display: block;
  border-radius: 20px;
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.45s ease;
}
.hq-portal .hqc { pointer-events: none; }
/* Where it leads, always visible: a bar along the bottom edge of the console. */
.hq-portal-cta {
  position: absolute;
  inset-inline: 50% auto;
  bottom: 18px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px 8px 8px;
  border: 1px solid color-mix(in srgb, var(--panel-ink) 18%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel-2) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 14px 34px -12px rgba(0, 0, 0, 0.6);
  color: var(--panel-ink);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  translate: -50% 0;
  transition: translate 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), background-color 0.25s ease, box-shadow 0.35s ease;
}
[dir="rtl"] .hq-portal-cta { padding: 8px 8px 8px 18px; translate: 50% 0; }
.hq-portal-mark .bot-av { display: block; width: 30px; height: 30px; border-radius: 9px; }
.hq-portal-cta .i { width: 16px; height: 16px; transition: transform 0.3s ease; }
@media (hover: hover) {
  .hq-portal:hover .hq-portal-frame { transform: scale(1.03); box-shadow: 0 50px 120px -40px rgba(13, 14, 19, 0.6); }
  .hq-portal:hover .hq-portal-cta { translate: -50% -10px; background: var(--panel-ink); color: var(--panel); }
  [dir="rtl"] .hq-portal:hover .hq-portal-cta { translate: 50% -10px; }
  .hq-portal:hover .hq-portal-cta .i { transform: translateX(4px); }
  [dir="rtl"] .hq-portal:hover .hq-portal-cta .i { transform: translateX(-4px); }
}
.hq-portal:focus-visible { outline: none; }
.hq-portal:focus-visible .hq-portal-frame { outline: 3px solid var(--ink); outline-offset: 6px; }
@media (max-width: 760px) {
  .hq-portal-cta { bottom: 12px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .hq-portal-frame, .hq-portal-cta, .hq-portal-cta .i { transition: none; }
}
