/* Landing console, shown inside the Explore drawer (native dialog #explore-drawer).
   Tokens only: no colour literals, no images, no imports. The drawer is a solid
   right-anchored column; the page behind it is dimmed by ::backdrop. */

#explore-drawer:not([open]) { display: none; }

/* The Chat tab is a panel wrapper now: it keeps the drawer's vertical flex column and scrolls
   inside the drawer while the head and tab strip stay pinned. Scoped with :not([hidden]) so
   tabs.js can hide it (an ID selector without it would beat [hidden]). */
#panel-chat:not([hidden]) { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; overflow-y: auto; }

.explore-panel[hidden] { display: none; }

#explore-btn[hidden] { display: none !important; }

#explore-drawer {
  display: flex; flex-direction: column; margin: 0 0 0 auto; padding: 0 1rem 1rem; scroll-padding-top: 4.5rem;
  width: min(30rem, 100vw); height: 100vh; height: 100dvh; max-width: none; max-height: none;
  border: 0; border-left: 1px solid var(--border); border-radius: 0;
  background: var(--bg); color: var(--text); overflow-y: auto; box-sizing: border-box;
}

#explore-drawer::backdrop { background: var(--bg, Canvas); opacity: 0.6; }

html.explore-open { overflow: hidden; }

.explore-head {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem; background: var(--bg); padding-top: 1rem; padding-bottom: 0.5rem;
}

.explore-head h2 { margin: 0; }

.explore-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; }

.explore-btn .explore-label { display: none; }

@media (min-width: 760px) {
  .explore-btn { width: auto; padding: 0 0.9rem; border-radius: 999px; }
  .explore-btn .explore-label { display: inline; font-weight: 600; }
}

#explore-drawer .sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

#explore-drawer .console-intro { margin: 0 0 0.75rem; }

#explore-drawer .out-links {
  display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; margin: 0 0 1rem; padding: 0;
}

#explore-drawer .out-links a {
  display: inline-block; padding: 0.3rem 0.85rem; border: 1px solid var(--border);
  border-radius: 999px; color: var(--link); text-decoration: none; font-size: 0.95rem;
}

#console-form {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0 0 0.4rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

#console-form .console-prompt { color: var(--link); font-weight: 700; }

#console-input {
  flex: 1 1 12rem; min-width: 0; font-size: 1rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--text); background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.5rem 0.75rem;
}

#console-form button[type="submit"] {
  padding: 0.45rem 1rem; border: 1px solid var(--border); border-radius: 999px;
  background: transparent; color: var(--link); font: inherit; font-weight: 700; cursor: pointer;
}

#console-form button[type="submit"]:hover { background: var(--surface); }

#explore-drawer .console-hint { display: block; margin: 0 0 0.6rem; color: var(--muted); font-size: 0.85rem; }

#console-chips,
#explore-drawer .out-chips {
  display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 0.9rem;
}

.console-chip {
  padding: 0.25rem 0.65rem; border: 1px solid var(--border); border-radius: 999px;
  background: transparent; color: var(--link); cursor: pointer; font-size: 0.85rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.console-chip:hover { background: var(--surface); }

#console-output {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.75rem; overflow: auto; margin-top: 0.75rem; overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92rem;
  color: var(--text);
}

#console-output:not([data-empty="true"]) { flex: 1 1 auto; min-height: 8rem; overflow: auto; }

#console-output[data-empty="true"] {
  flex: 0 0 0; min-height: 0; height: 0; margin: 0; padding: 0; border: 0; overflow: hidden;
}

#console-output .console-entry + .console-entry {
  margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--border);
}

#console-output p { margin: 0.25rem 0; }

#explore-drawer .out-cmd { color: var(--link); font-weight: 700; }

#explore-drawer .out-heading { font-weight: 700; }

#explore-drawer .out-error { color: var(--text); }

#explore-drawer .out-error::before { content: 'error: '; font-weight: 700; }

#explore-drawer .out-list { margin: 0.25rem 0; padding-left: 1.2rem; }

#explore-drawer .out-list li { margin: 0.1rem 0; }

#console-output a { color: var(--link); }

#explore-drawer .out-table {
  width: 100%; border-collapse: collapse; margin: 0.4rem 0; font-size: 0.85rem;
}

#explore-drawer .out-table th,
#explore-drawer .out-table td {
  padding: 0.3rem 0.5rem; border: 1px solid var(--border); text-align: left;
  vertical-align: top; overflow-wrap: anywhere;
}

#explore-drawer .out-table th { font-weight: 700; color: var(--text); }

@media (max-width: 720px) {
  #explore-drawer { width: 100vw; }
  #console-form { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.4rem; align-items: center; }
  #console-input { min-width: 0; }
  #console-form button[type="submit"] { grid-column: 1 / -1; }
  #console-output { padding: 0.6rem 0.75rem; }
  #explore-drawer .out-table { font-size: 0.8rem; }
}

@media (prefers-reduced-motion: no-preference) {
  #explore-drawer[open] { animation: explore-slide 180ms ease-out; }
  @keyframes explore-slide {
    from { transform: translateX(2rem); opacity: 0; }
    to { transform: none; opacity: 1; }
  }
}

@media print {
  #explore-drawer, #explore-drawer::backdrop, #explore-btn { display: none !important; }
}
