/* hid-compare.css — Compare tray + side-by-side overlay. Global theme tokens only. */

/* ---- bottom tray ---- */
.hid-cmp-tray {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: calc(100vw - 1.5rem);
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-full, 999px);
  background: var(--surface, #fff);
  box-shadow: var(--shadow-lg, 0 18px 44px rgba(15, 23, 42, 0.26));
  font-size: 0.82rem;
}
.hid-cmp-tray[hidden] { display: none; }
.hid-cmp-tray-lbl {
  font-family: var(--mono, monospace);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted, #64748b);
  padding-left: 0.4rem;
}
.hid-cmp-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  max-width: 11rem;
  padding: 0.28rem 0.3rem 0.28rem 0.6rem;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-full, 999px);
  background: var(--ice-100, #eef3fb);
  color: var(--text, #0f172a);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hid-cmp-chip b { color: var(--blue, #2563eb); font-family: var(--mono, monospace); }
.hid-cmp-chip button {
  flex: 0 0 auto;
  width: 18px; height: 18px;
  border: 0; border-radius: 50%;
  background: transparent;
  color: var(--muted, #64748b);
  font-size: 0.72rem; line-height: 1; cursor: pointer;
}
.hid-cmp-chip button:hover { background: var(--red-bg, #fee2e2); color: var(--red, #dc2626); }
.hid-cmp-hint { color: var(--muted, #64748b); font-size: 0.74rem; font-style: italic; }
.hid-cmp-go {
  border: 0; border-radius: var(--radius-full, 999px);
  background: var(--blue, #2563eb); color: #fff;
  font: inherit; font-weight: 800; font-size: 0.8rem;
  padding: 0.42rem 0.85rem; cursor: pointer;
}
.hid-cmp-go[disabled] { background: var(--surface-2, #f1f5f9); color: var(--muted, #94a3b8); cursor: not-allowed; }
.hid-cmp-go:not([disabled]):hover { filter: brightness(1.06); }
.hid-cmp-clr {
  border: 1px solid var(--border, #e2e8f0); border-radius: var(--radius-full, 999px);
  background: var(--surface, #fff); color: var(--muted, #64748b);
  font: inherit; font-size: 0.74rem; font-weight: 700;
  padding: 0.38rem 0.6rem; cursor: pointer;
}
.hid-cmp-clr:hover { color: var(--text, #0f172a); border-color: var(--border-2, #cbd5e1); }

/* ---- overlay ---- */
.hid-cmp { position: fixed; inset: 0; z-index: 1100; }
.hid-cmp[hidden] { display: none; }
.hid-cmp-backdrop { position: absolute; inset: 0; background: rgba(8, 12, 26, 0.58); backdrop-filter: blur(2px); }
.hid-cmp-panel {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(640px, 94vw);
  max-height: 88vh;
  display: flex; flex-direction: column;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-lg, 16px);
  box-shadow: var(--shadow-lg, 0 24px 60px rgba(15, 23, 42, 0.3));
  overflow: hidden;
}
.hid-cmp-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border, #e2e8f0);
}
.hid-cmp-topbar b {
  font-family: var(--mono, monospace);
  font-size: 0.72rem; font-weight: 800;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted, #64748b);
}
.hid-cmp-x {
  border: 1px solid var(--border, #e2e8f0); border-radius: 6px;
  background: var(--surface, #fff); color: var(--muted, #64748b);
  font-family: var(--mono, monospace); font-size: 0.66rem; font-weight: 700;
  padding: 0.22rem 0.42rem; cursor: pointer;
}
.hid-cmp-body { overflow-y: auto; padding: 1rem 1.1rem 1.2rem; }

.hid-cmp-heads {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.hid-cmp-col { position: relative; text-align: center; min-width: 0; }
.hid-cmp-drop {
  position: absolute; top: -0.3rem;
  width: 22px; height: 22px;
  border: 1px solid var(--border, #e2e8f0); border-radius: 50%;
  background: var(--surface, #fff); color: var(--muted, #64748b);
  font-size: 0.7rem; line-height: 1; cursor: pointer;
}
.hid-cmp-col[data-side="a"] .hid-cmp-drop { left: 0; right: auto; }
.hid-cmp-col[data-side="b"] .hid-cmp-drop { right: 0; left: auto; }
.hid-cmp-drop:hover { background: var(--red-bg, #fee2e2); color: var(--red, #dc2626); border-color: var(--red, #dc2626); }
.hid-cmp-photo {
  width: 64px; height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border, #e2e8f0);
  background: var(--surface-2, #f1f5f9);
  margin: 0 auto 0.4rem;
  display: block;
}
.hid-cmp-photo-empty {
  display: grid; place-items: center;
  font-family: var(--mono, monospace); font-weight: 800;
  color: var(--muted, #64748b);
}
.hid-cmp-rk {
  font-family: var(--mono, monospace);
  font-size: 0.8rem; font-weight: 800;
  color: var(--blue, #2563eb);
}
.hid-cmp-nm {
  font-size: 1.02rem; font-weight: 800;
  color: var(--text, #0f172a);
  line-height: 1.15;
  overflow: hidden; text-overflow: ellipsis;
}
.hid-cmp-sub {
  font-size: 0.76rem; color: var(--muted, #64748b);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hid-cmp-vs {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-full, 999px);
  background: var(--surface-2, #f1f5f9);
  font-family: var(--mono, monospace);
  font-size: 0.66rem; font-weight: 800;
  color: var(--muted, #64748b);
  text-transform: uppercase;
}

.hid-cmp-tbl { width: 100%; border-collapse: collapse; }
.hid-cmp-tbl tr { border-top: 1px solid var(--border, #e2e8f0); }
.hid-cmp-tbl tr:first-child { border-top: 0; }
.hid-cmp-tbl th[scope="row"] {
  width: 33%;
  padding: 0.5rem 0.4rem;
  text-align: center;
  font-family: var(--mono, monospace);
  font-size: 0.6rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted, #64748b);
}
.hid-cmp-tbl td {
  padding: 0.5rem 0.55rem;
  font-size: 0.86rem; font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text, #0f172a);
}
.hid-cmp-av { text-align: right; }
.hid-cmp-bv { text-align: left; }
.hid-cmp-tbl td.is-lead {
  color: var(--text, #0f172a);
  font-weight: 800;
}
.hid-cmp-tbl td.is-lead::after {
  content: "●";
  font-size: 0.55rem;
  color: var(--blue, #2563eb);
  margin-left: 0.32rem;
}
.hid-cmp-note {
  margin: 0.9rem 0 0;
  color: var(--muted, #64748b);
  font-size: 0.74rem;
  line-height: 1.45;
}

@media (max-width: 760px) {
  /* keep the tray clear of the fixed mobile control bar (bar bottom 10px +
     measured bar height ~66px + 8px gap) */
  body.hid-has-mobile-controls .hid-cmp-tray {
    bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 560px) {
  .hid-cmp-tray { flex-wrap: wrap; justify-content: center; border-radius: var(--radius-lg, 16px); width: calc(100vw - 1rem); }
  .hid-cmp-chip { max-width: 8.5rem; }
  .hid-cmp-panel { width: 100vw; height: 100%; max-height: 100vh; border-radius: 0; top: 0; left: 0; transform: none; }
  .hid-cmp-photo { width: 52px; height: 52px; }
  .hid-cmp-tbl td { font-size: 0.8rem; }
}

@media (max-width: 500px) {
  /* compact pill row anchored above the mobile control bar */
  .hid-cmp-tray {
    flex-wrap: nowrap;
    justify-content: flex-start;
    width: auto;
    max-width: calc(100vw - 0.75rem);
    min-height: 44px;
    gap: 0.35rem;
    padding: 0.25rem 0.35rem;
    border-radius: var(--radius-full, 999px);
  }
  .hid-cmp-tray-lbl,
  .hid-cmp-hint { display: none; }
  .hid-cmp-chip { flex: 0 1 auto; min-width: 0; max-width: 7.5rem; }
  .hid-cmp-go { padding: 0.4rem 0.7rem; font-size: 0.76rem; }
  .hid-cmp-clr { padding: 0.36rem 0.5rem; }
}
