/* ==================================================================
   Try it without installing — static replay page.

   Two palettes live here on purpose:

   * the page around it uses the OpenRecruiterTools dark/green palette,
     lifted from openrecruitertools.github.io/styles.css, so the page
     reads as part of the org site;
   * `.popup` re-declares the *extension's own* variables, because the
     right-hand pane is a replica of the real Queue tab and it should
     look exactly like the real Queue tab, purple accent and all.

   No webfonts, no CDN, no network of any kind.
   ================================================================== */

:root {
  --bg: #0a0a0b;
  --surface: #141417;
  --surface-2: #1b1b20;
  --text: #ececf1;
  --muted: #8f8f9b;
  --border: #26262c;
  --accent: #34d27f;
  --accent-text: #06210f;
  --wire: #6ea8fe;
  --warn-bg: rgba(229, 181, 103, 0.1);
  --warn-border: rgba(229, 181, 103, 0.25);
  --warn-text: #e5b567;
  --radius: 12px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family:
    system-ui, -apple-system, 'Segoe UI', Roboto, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
}

/* ---------- honesty banner ---------- */

.banner {
  background: var(--warn-bg);
  border-bottom: 1px solid var(--warn-border);
  color: var(--warn-text);
  font-size: 14px;
  padding: 10px 20px;
  text-align: center;
}

.banner b {
  color: var(--warn-text);
}

/* ---------- header ---------- */

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

header.top {
  padding: 26px 0 18px;
  display: flex;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
}

h1 {
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.sub {
  color: var(--muted);
  font-size: 15px;
  max-width: 46rem;
  margin-top: 6px;
}

.cta {
  margin-left: auto;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.cta a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.cta a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.cta a.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.cta a.primary:hover {
  color: var(--accent-text);
  filter: brightness(1.08);
}

.cta code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
}

/* ---------- stage ---------- */

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
  align-items: start;
  padding-bottom: 18px;
}

@media (max-width: 900px) {
  .stage {
    grid-template-columns: minmax(0, 1fr);
  }
  .pane-right {
    justify-self: stretch;
  }
}

.pane-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 660;
  color: var(--muted);
  margin-bottom: 8px;
  min-height: 20px;
}

.pane-label .tag {
  color: var(--accent);
}

.pane-label .live {
  margin-left: auto;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--muted);
}

.shell {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

/* ---------- agent console (same look as console/index.html) ---------- */

.console-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--muted);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(52, 210, 127, 0.15);
  flex: 0 0 auto;
}

.console-bar b {
  color: var(--text);
  font-weight: 620;
  font-size: 13px;
}

.console-bar .right {
  margin-left: auto;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11.5px;
}

#log {
  height: 612px;
  overflow-y: auto;
  padding: 14px 16px 24px;
  background: var(--bg);
  scroll-behavior: auto;
}

.turn {
  margin-bottom: 14px;
}

.who {
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 5px;
  font-weight: 640;
}

.you .bubble {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 15.5px;
  line-height: 1.45;
}

.caret {
  display: inline-block;
  width: 8px;
  background: var(--accent);
  color: transparent;
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.note {
  font-size: 14.5px;
  margin: 0 0 9px;
}

.call {
  border: 1px solid var(--border);
  border-left: 3px solid var(--wire);
  background: var(--surface);
  border-radius: 8px;
  padding: 8px 11px;
  margin: 0 0 8px;
  font-family: ui-monospace, Consolas, 'SF Mono', monospace;
  font-size: 12.5px;
}

.call.done {
  border-left-color: var(--accent);
}

.call-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.call-name {
  color: var(--wire);
  font-weight: 700;
  font-size: 13px;
}

.call.done .call-name {
  color: var(--accent);
}

.call-verb {
  color: var(--muted);
  font-size: 11px;
}

.call-ms {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
}

.call-params {
  color: var(--muted);
  margin-top: 4px;
  white-space: pre-wrap;
  word-break: break-word;
}

.call-result {
  margin-top: 5px;
  color: var(--accent);
  font-weight: 620;
}

.call-result .pend {
  color: var(--muted);
  font-weight: 400;
}

.rows {
  margin-top: 5px;
  font-size: 12px;
}

.rows div {
  padding: 1.5px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rows .dim {
  color: var(--muted);
}

.draft {
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 8px;
  padding: 8px 11px;
  margin: 0 0 7px;
}

.draft-to {
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 3px;
}

.draft-to b {
  color: var(--text);
  font-weight: 640;
}

.draft-body {
  font-size: 13.5px;
  line-height: 1.45;
}

.draft-meta {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
  font-family: ui-monospace, Consolas, monospace;
}

.badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(52, 210, 127, 0.14);
  color: var(--accent);
  border: 1px solid rgba(52, 210, 127, 0.3);
}

.final {
  border: 1px solid rgba(52, 210, 127, 0.35);
  background: rgba(52, 210, 127, 0.07);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 15px;
  font-weight: 650;
}

.final small {
  display: block;
  margin-top: 3px;
  font-weight: 400;
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------- replay controls ---------- */

.controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
}

.ctl {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.ctl:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.ctl:disabled {
  opacity: 0.5;
  cursor: default;
}

.controls .spacer {
  margin-left: auto;
}

/* ================================================================== *
 *  Replica of the extension popup's Queue tab.
 *  Variables below are the extension's own dark-mode values.
 * ================================================================== */

.popup {
  --bg: #16161a;
  --surface: #1f1f25;
  --surface-2: #26262e;
  --text: #ececf1;
  --muted: #9c9caa;
  --border: #32323c;
  --accent: #8f8ff2;
  --accent-soft: #2b2b46;
  --accent-text: #14141a;
  --good: #4ecb95;
  --good-soft: #1d3229;
  --warn: #e0ae4e;
  --warn-soft: #33291491;
  --bad: #f0796d;
  --bad-soft: #3a201d;
  --radius-sm: 6px;

  /* The real popup is a fixed 380 x 600 box whose view scrolls; keep that,
     otherwise five queued items make this pane twice the height of the real
     one and the replica stops being a replica. */
  width: 100%;
  max-width: 380px;
  height: 612px;
  display: flex;
  flex-direction: column;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.popup .app-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.popup .app-title {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.2px;
}

.popup .app-title small {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: var(--muted);
}

.popup .head-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
}

.popup .tabbar {
  display: flex;
  flex-wrap: wrap;
  padding: 4px 4px 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.popup .tab {
  padding: 6px 7px 8px;
  font: inherit;
  font-size: 11.5px;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: default;
  white-space: nowrap;
}

.popup .tab.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.popup .view {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.popup .card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.popup .card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.popup .card-title {
  font-size: 12px;
  font-weight: 650;
}

.popup .card > .hint {
  padding: 10px 12px 0;
}

.popup .hint {
  font-size: 11px;
  color: var(--muted);
}

.popup .card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
}

.popup .status {
  font-size: 11px;
  color: var(--muted);
  padding: 0 2px;
}

.popup .empty {
  padding: 14px 4px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.popup .row {
  display: flex;
  gap: 6px;
  align-items: flex-end;
}

.popup .row > .select {
  flex: 1 1 0;
  min-width: 0;
}

.popup .select {
  padding: 6px 8px;
  font: inherit;
  font-size: 12px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.popup .textarea {
  width: 100%;
  padding: 6px 8px;
  font: inherit;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  resize: vertical;
  min-height: 48px;
}

.popup .textarea:disabled {
  opacity: 0.75;
}

.popup .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 11px;
  font: inherit;
  font-size: 12px;
  font-weight: 550;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
}

.popup .btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.popup .btn--primary {
  color: var(--accent-text);
  background: var(--accent);
  border-color: var(--accent);
}

.popup .btn--primary:hover:not(:disabled) {
  color: var(--accent-text);
  filter: brightness(1.08);
}

.popup .btn--ghost {
  background: transparent;
}

.popup .itemlist {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.popup .item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
}

.popup .item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.popup .item-title {
  font-size: 12px;
  font-weight: 600;
}

.popup .item-sub {
  font-size: 11px;
  color: var(--muted);
}

.popup .badges {
  display: flex;
  gap: 4px;
}

.popup .item-actions {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}

.popup .pill {
  display: inline-block;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  white-space: nowrap;
}

.popup .card .pill {
  background: var(--surface);
}

.popup .pill--good {
  background: var(--good-soft);
  color: var(--good);
}

.popup .pill--warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.popup .pill--bad {
  background: var(--bad-soft);
  color: var(--bad);
}

.popup .pill--info {
  background: var(--accent-soft);
  color: var(--accent);
}

.popup .app-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 12px;
  font-size: 11px;
  color: var(--muted);
  background: var(--surface);
  border-top: 1px solid var(--border);
}

/* ---------- footer ---------- */

footer.foot {
  border-top: 1px solid var(--border);
  margin-top: 10px;
  padding: 22px 0 46px;
  color: var(--muted);
  font-size: 14px;
}

footer.foot h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

footer.foot ul {
  padding-left: 1.2rem;
  max-width: 46rem;
}

footer.foot li {
  margin-bottom: 5px;
}

footer.foot code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
  padding: 1px 5px;
  background: var(--surface-2);
  border-radius: 5px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
