/* Replica layer on top of the home.hx snapshot: info bar, hover cards, Fleet tab, small screens. */

li.service { cursor: help; outline: none; }
li.service:focus-visible > div { border-color: #a8a29e !important; }
.information-widget-greeting,
.information-widget-resource,
.information-widget-datetime,
.information-widget-openmeteo { cursor: help; }
.service-title, .service-title * { cursor: inherit !important; }
.service-tag { cursor: inherit !important; }

/* ── bottom bar: what this page is ── */
.replica-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0.6rem 0.55rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.replica-bar b { color: var(--text-primary); font-weight: 500; }
.replica-bar .back {
  flex: none;
  color: var(--text-primary);
  text-decoration: none;
  padding: 0.3rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg-primary);
  transition: background 0.15s;
}
.replica-bar .back:hover { background: var(--bg-card-hover); }

/* ── hover card ── */
#hx-tip {
  position: fixed;
  z-index: 100;
  width: min(340px, calc(100vw - 24px));
  padding: 0.95rem 1.05rem 1rem;
  background: #1d1c1b;
  border: 1px solid #3b3937;
  border-radius: 16px;
  box-shadow: 0 18px 50px -12px rgba(0, 0, 0, 0.7);
  color: var(--text-primary);
  font-size: 0.84rem;
  line-height: 1.5;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}
#hx-tip.on { opacity: 1; transform: none; }
#hx-tip .tip-head { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.55rem; }
#hx-tip .tip-icon { width: 28px; height: 28px; flex: none; display: grid; place-items: center; }
#hx-tip .tip-icon > * { width: 28px !important; height: 28px !important; }
#hx-tip .tip-name { font-size: 0.98rem; font-weight: 600; line-height: 1.2; }
#hx-tip .tip-where { font-size: 0.72rem; color: var(--text-muted); letter-spacing: 0.02em; }
#hx-tip p { margin: 0; color: #d6d3d1; }
#hx-tip p + p { margin-top: 0.5rem; }
#hx-tip .ours {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.6rem;
  padding: 0.18rem 0.6rem 0.18rem 0.45rem;
  border-radius: 999px;
  background: rgba(134, 239, 172, 0.1);
  border: 1px solid rgba(134, 239, 172, 0.25);
  color: #bbf7d0;
  font-size: 0.72rem;
  font-weight: 500;
}
#hx-tip .ours::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #86efac; }
#hx-tip .note { margin-top: 0.6rem; font-size: 0.72rem; color: var(--text-muted); }

/* ── Fleet tab ── */
#fleet-groups { display: none; flex: 1 1 auto; min-height: 0; }
body.tab-fleet #layout-groups { display: none !important; }
body.tab-fleet #fleet-groups { display: grid; }
#fleet-groups {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: minmax(0, 0.8fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
#fleet-groups li.service:first-child { grid-column: 1 / -1; }
#fleet-groups .service-card { padding: 1rem 1.1rem !important; }
#fleet-groups .service-icon > div { width: 32px; height: 32px; background: linear-gradient(180deg, rgb(var(--color-logo-start)), rgb(var(--color-logo-stop))); }

/* ── small screens: let it scroll like a normal page ── */
@media (max-width: 1023px) {
  html, body, #__next, #page_wrapper, #inner_wrapper, #inner_wrapper > div {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }
  #inner_wrapper { overflow-x: hidden !important; }
  #widgets-wrap { flex-wrap: wrap !important; row-gap: 0.4rem; }
  #widgets-wrap > .widget-container > div { flex-wrap: wrap !important; }
  #information-widgets-right { justify-content: flex-start !important; }
  .services-group, .services-group.flex-1 { flex: 1 1 100% !important; }
  li.service { height: auto !important; }
  li.service > div { min-height: 84px; }
  #fleet-groups { grid-template-columns: 1fr; grid-template-rows: none; grid-auto-rows: auto; }
  .replica-bar { flex-direction: column; align-items: flex-start; }
}
