/* bamlcode: LeetCode for BAML. Dark only, on the site's tokens from
   app/(home)/globals.css: --ground and --raised surfaces, --rule hairlines,
   Clover (--accent) for the accent and for passing tests, and the site's
   destructive red (--color-destructive) for failures. */

/* ── Index: sidebar | table | rail, inside the page column ─────── */
.bc-app {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 32px;
}
.bc-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bc-sidebar-item {
  padding: 8px 12px;
  font-size: 14px;
  border-radius: 8px;
}
.bc-sidebar-active {
  color: var(--ink);
  background: var(--raised);
}
.bc-sidebar-muted {
  color: var(--muted);
}
.bc-sidebar-section {
  padding: 0 12px;
  margin: 28px 0 10px;
  color: var(--muted);
}

.bc-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 28px;
}
.bc-board-main {
  min-width: 0;
}

.bc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.bc-chip {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 5px 12px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: 999px;
  transition: border-color 120ms ease;
}
.bc-chip:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}
.bc-chip-on {
  color: var(--accent);
  border-color: var(--accent);
}
.bc-chip-count {
  font-size: 11px;
  color: var(--muted);
}

.bc-difftabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}
.bc-difftab {
  padding: 6px 14px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  background: transparent;
  border: none;
  border-radius: 8px;
}
.bc-difftab:hover {
  color: var(--ink);
}
.bc-difftab-on {
  color: var(--ink);
  background: var(--raised);
}

.bc-toolbar {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.bc-search {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 360px;
  padding: 9px 14px;
  font-size: 14px;
  color: var(--ink);
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: 8px;
}
.bc-search::placeholder {
  color: var(--muted);
}
.bc-search:focus {
  outline: none;
  border-color: var(--accent);
}
.bc-solved-inline {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.bc-solved-ring {
  width: 16px;
  height: 16px;
  background: conic-gradient(var(--accent) var(--pct), var(--rule) var(--pct));
  border-radius: 50%;
  -webkit-mask: radial-gradient(circle 4px, transparent 98%, #000 100%);
  mask: radial-gradient(circle 4px, transparent 98%, #000 100%);
}

.bc-table {
  padding: 0;
  margin: 0;
  overflow: hidden;
  list-style: none;
  border: 1px solid var(--rule);
  border-radius: 12px;
}
.bc-trow + .bc-trow {
  border-top: 1px solid var(--rule);
}
.bc-trow-alt {
  background: color-mix(in srgb, var(--raised) 60%, transparent);
}
.bc-tlink {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 56px 76px 28px;
  gap: 16px;
  align-items: center;
  padding: 13px 16px;
  color: inherit;
  text-decoration: none;
  transition: background 120ms ease;
}
.bc-tlink:hover {
  background: var(--raised);
}
.bc-tstatus {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  text-align: center;
}
.bc-ttitle {
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 15px;
  color: var(--ink-2);
  white-space: nowrap;
}
.bc-tlink:hover .bc-ttitle {
  color: var(--head);
}
.bc-tacc {
  font-size: 13px;
  color: var(--muted);
  text-align: right;
}
.bc-tfreq {
  display: flex;
  gap: 2px;
  align-items: flex-end;
  height: 16px;
}
.bc-tfreq-bar {
  width: 3px;
  background: color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: 1px;
}
.bc-tempty {
  padding: 40px 16px;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}

/* Difficulty: one, two, or three lit pips (Difficulty.tsx). */
.bc-diff {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
}
.bc-pips {
  display: inline-flex;
  gap: 2px;
  align-items: flex-end;
}
.bc-pips i {
  width: 4px;
  background: var(--faint);
  border-radius: 1px;
}
.bc-pips i:nth-child(1) {
  height: 6px;
}
.bc-pips i:nth-child(2) {
  height: 9px;
}
.bc-pips i:nth-child(3) {
  height: 12px;
}
.bc-diff[data-level="1"] .bc-pips i:nth-child(-n + 1),
.bc-diff[data-level="2"] .bc-pips i:nth-child(-n + 2),
.bc-diff[data-level="3"] .bc-pips i {
  background: var(--accent);
}

.bc-rail {
  min-width: 0;
}
.bc-progress-card {
  padding: 20px;
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: 16px;
}
.bc-progress-head {
  margin-bottom: 14px;
  color: var(--muted);
}
.bc-progress-big {
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.bc-progress-num {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--head);
  letter-spacing: -0.03em;
}
.bc-progress-den {
  font-size: 14px;
  color: var(--muted);
}
.bc-progress-bar {
  height: 6px;
  margin: 12px 0 16px;
  overflow: hidden;
  background: var(--rule);
  border-radius: 999px;
}
.bc-progress-bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
}
.bc-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
}
.bc-progress-frac {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

@media (max-width: 1023px) {
  .bc-app {
    grid-template-columns: minmax(0, 1fr);
  }
  .bc-sidebar {
    display: none;
  }
  .bc-board {
    grid-template-columns: minmax(0, 1fr);
  }
  .bc-rail {
    display: none;
  }
}
@media (max-width: 639px) {
  .bc-tlink {
    grid-template-columns: 16px minmax(0, 1fr) 62px;
    gap: 10px;
  }
  .bc-tacc,
  .bc-tfreq {
    display: none;
  }
}

/* ── Solve page: Nav on top, the workbench fills the rest ──────── */
/* The page grid's rails would cut through the full-width panels. */
body:has(.bc-solve-page) .grid-rails {
  display: none;
}
.bc-solve-page {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}
.bc-solve {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}
.bc-solve-head {
  flex: 0 0 auto;
  padding: 14px var(--frame-pad);
  border-bottom: 1px solid var(--rule);
}
.bc-back {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: color 120ms ease;
}
.bc-back:hover {
  color: var(--accent);
}
.bc-solve-title {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  margin-top: 6px;
}
.bc-solve-title h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--head);
  letter-spacing: -0.02em;
}
.bc-num {
  font-size: 13px;
  color: var(--muted);
}
.bc-cat {
  font-size: 14px;
  color: var(--muted);
}

.bc-solve-main {
  flex: 1 1 auto;
  min-height: 0;
}
.bc-solve-body {
  height: 100%;
}
.bc-statement {
  height: 100%;
  padding: 24px;
  overflow-y: auto;
}
.bc-workspace {
  height: 100%;
  min-height: 0;
}
.bc-editor {
  height: 100%;
  min-height: 0;
  background: var(--raised);
}
.bc-editor-loading {
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--muted);
}
.bc-bottom {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

/* Resize handles */
.bc-handle {
  flex: 0 0 auto;
  background: var(--rule);
  transition: background 120ms ease;
}
.bc-handle:hover,
.bc-handle[data-resize-handle-state="drag"] {
  background: var(--accent);
}
.bc-handle-v {
  width: 1px;
  cursor: col-resize;
}
.bc-handle-h {
  height: 1px;
  cursor: row-resize;
}
/* A wider grab area than the 1px line. */
.bc-handle {
  position: relative;
}
.bc-handle::after {
  position: absolute;
  inset: -3px;
  content: "";
}

.bc-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}
.bc-actions-right {
  display: flex;
  gap: 10px;
}

/* Buttons: the shapes of components/home/ui.tsx's Button, sized for a tool
   bar. Primary (the accent fill) is Submit, the one main action in view. */
.bc-btn {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  white-space: nowrap;
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  transition:
    background 120ms ease,
    border-color 120ms ease,
    color 120ms ease;
}
.bc-btn:active:not(:disabled) {
  transform: translateY(1px);
}
.bc-btn:disabled {
  cursor: default;
  opacity: 0.5;
}
.bc-btn-ghost {
  color: var(--muted);
}
.bc-btn-ghost:hover:not(:disabled) {
  color: var(--ink);
}
.bc-btn-secondary {
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}
.bc-btn-secondary:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
}
.bc-btn-primary {
  color: var(--on-accent);
  background: var(--accent);
}
.bc-btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.bc-verdict {
  flex: 0 0 auto;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
}
.bc-verdict-accepted {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.bc-verdict-rejected {
  color: var(--color-destructive);
  background: color-mix(in srgb, var(--color-destructive) 12%, transparent);
}
.bc-compile-error {
  flex: 0 0 auto;
  max-height: 30%;
  padding: 10px 16px;
  overflow-y: auto;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--color-destructive);
  white-space: pre-wrap;
  background: color-mix(in srgb, var(--color-destructive) 12%, transparent);
}
.bc-compile-error-label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}

.bc-results {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  border-top: 1px solid var(--rule);
}
.bc-results-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  padding: 10px 16px;
  font-size: 12px;
  color: var(--muted);
  background: var(--ground);
}
.bc-tabs {
  display: flex;
  gap: 4px;
}
.bc-tab {
  padding: 2px 8px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  background: transparent;
  border: none;
  border-radius: 5px;
}
.bc-tab:hover {
  color: var(--ink);
}
.bc-tab-on {
  color: var(--ink);
  background: var(--raised);
}

/* Console (baml run / describe) */
.bc-console {
  padding: 12px 16px 16px;
}
.bc-console-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.bc-console-prompt {
  font-size: 12px;
  color: var(--accent);
  white-space: nowrap;
}
.bc-console-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 6px 10px;
  font-size: 12.5px;
  color: var(--ink);
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: 6px;
}
.bc-console-input:focus {
  outline: none;
  border-color: var(--accent);
}
.bc-console .bc-btn {
  height: 30px;
  padding: 0 12px;
  font-size: 13px;
}
.bc-console-out {
  padding: 10px 12px;
  margin: 12px 0 0;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: 6px;
}
.bc-console-value {
  color: var(--accent);
}
.bc-console-error {
  color: var(--color-destructive);
}
.bc-console-describe {
  color: var(--ink-2);
}
.bc-console-hint {
  color: var(--muted);
}

.bc-case {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 7px 16px;
  font-size: 12px;
  border-top: 1px solid color-mix(in srgb, var(--rule) 60%, transparent);
}
.bc-case-icon {
  width: 14px;
  color: var(--muted);
  text-align: center;
}
.bc-case-pass .bc-case-icon {
  color: var(--accent);
}
.bc-case-fail .bc-case-icon,
.bc-case-error .bc-case-icon {
  color: var(--color-destructive);
}
.bc-case-call {
  color: var(--ink-2);
}
.bc-case-expect {
  color: var(--muted);
}
.bc-case-err {
  max-width: 40%;
  margin-left: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--color-destructive);
  white-space: nowrap;
}

.bc-signature {
  margin-top: 24px;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 12px;
}
.bc-sig-label {
  padding: 9px 12px;
  color: var(--muted);
  background: var(--raised);
  border-bottom: 1px solid var(--rule);
}
.bc-signature pre {
  padding: 12px;
  margin: 0;
  overflow-x: auto;
  font-size: 13px;
  color: var(--accent);
}

/* Markdown statement */
.bc-md {
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-2);
}
.bc-md p {
  margin: 0 0 14px;
}
.bc-md strong {
  font-weight: 600;
  color: var(--head);
}
.bc-md h1,
.bc-md h2,
.bc-md h3,
.bc-md h4 {
  margin: 22px 0 10px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  color: var(--head);
}
.bc-md ul,
.bc-md ol {
  padding-left: 1.3em;
  margin: 0 0 14px;
}
.bc-md ul {
  list-style: disc;
}
.bc-md ol {
  list-style: decimal;
}
.bc-md code {
  padding: 1px 5px;
  font-family: var(--font-jetbrains-mono), ui-monospace, monospace;
  font-size: 0.86em;
  color: var(--accent);
  background: var(--raised);
  border-radius: 4px;
}
.bc-md pre {
  padding: 12px 14px;
  margin: 0 0 14px;
  overflow-x: auto;
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: 8px;
}
.bc-md pre code {
  padding: 0;
  color: var(--ink-2);
  background: none;
}

/* ── Feedback (inline, collapsible, beneath the description) ────── */
.bc-fbinline {
  margin-top: 24px;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 12px;
}
.bc-fbinline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  background: var(--raised);
  border: none;
}
.bc-fbinline-head:hover {
  color: var(--accent);
}
.bc-fbinline-chev {
  font-size: 11px;
  color: var(--muted);
}
.bc-fbinline-body {
  padding: 14px;
  border-top: 1px solid var(--rule);
}
.bc-fb-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bc-fb-prompt {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--body);
}
.bc-fb-input,
.bc-fb-textarea {
  padding: 8px 10px;
  font-size: 14px;
  color: var(--ink);
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: 8px;
}
.bc-fb-input::placeholder,
.bc-fb-textarea::placeholder {
  color: var(--muted);
}
.bc-fb-input:focus,
.bc-fb-textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.bc-fb-textarea {
  min-height: 72px;
  line-height: 1.5;
  resize: vertical;
}
.bc-fb-hp {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
}
.bc-fb-submit {
  align-self: flex-start;
  margin-top: 2px;
}
.bc-fb-error {
  margin: 0;
  font-size: 13px;
  color: var(--color-destructive);
}
.bc-fb-thanks {
  margin: 6px 0;
  font-size: 14px;
  color: var(--accent);
}

/* ── BAML syntax reference (resizable column) ──────────────────── */
.bc-refcol {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  background: var(--ground);
}
.bc-ref-head {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
}
.bc-ref-body {
  flex: 1 1 auto;
  padding: 8px 16px 32px;
  overflow-y: auto;
}
.bc-ref-describe {
  padding: 14px 0 16px;
  border-bottom: 1px solid var(--rule);
}
.bc-ref-describe-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.bc-ref-describe-prompt {
  font-size: 11.5px;
  color: var(--accent);
  white-space: nowrap;
}
.bc-ref-describe-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 6px 9px;
  font-size: 12px;
  color: var(--ink);
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: 6px;
}
.bc-ref-describe-input::placeholder {
  color: var(--muted);
}
.bc-ref-describe-input:focus {
  outline: none;
  border-color: var(--accent);
}
.bc-ref-describe-hint {
  margin: 10px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

.bc-ref-section {
  padding: 14px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--rule) 60%, transparent);
}
.bc-ref-title {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--accent);
}
.bc-ref-snippet {
  margin-bottom: 10px;
}
.bc-ref-snippet pre {
  padding: 8px 10px;
  margin: 0;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-2);
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: 6px;
}
.bc-ref-note {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

/* ---- baml describe results (real stdlib docs) ---- */
.bc-doc-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.bc-doc {
  padding: 11px 12px;
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: 8px;
}
.bc-doc-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
}
.bc-doc-kind {
  flex: 0 0 auto;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-radius: 999px;
}
.bc-doc-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  word-break: break-word;
}
.bc-doc-sig {
  padding: 7px 9px;
  margin: 9px 0 0;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.5;
  color: var(--accent);
  word-break: break-word;
  white-space: pre-wrap;
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  border-radius: 6px;
}
.bc-doc-doc {
  margin: 9px 0 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--body);
  white-space: pre-wrap;
}
.bc-doc-methods {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 10px;
  margin-top: 11px;
  border-top: 1px solid color-mix(in srgb, var(--rule) 70%, transparent);
}
.bc-doc-method-sig {
  display: block;
  overflow-x: auto;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-2);
  word-break: break-word;
  white-space: pre-wrap;
}
.bc-doc-method-doc {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--muted);
}
.bc-doc-methods-count {
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--muted);
}
.bc-doc-loc {
  margin-top: 10px;
  font-size: 10.5px;
  color: var(--muted);
}

/* Phones and small tablets: the three resizable columns don't fit, so the
   page scrolls and the statement, editor, and docs stack. */
@media (max-width: 820px) {
  .bc-solve-page {
    height: auto;
    min-height: 100dvh;
  }
  .bc-solve-main .bc-solve-body {
    flex-direction: column !important;
    height: auto;
  }
  .bc-solve-main .bc-solve-body > [data-panel] {
    flex: 0 0 auto !important;
    overflow: visible !important;
  }
  .bc-solve-main .bc-handle {
    display: none;
  }
  .bc-statement {
    height: auto;
    overflow: visible;
    border-bottom: 1px solid var(--rule);
  }
  /* The panel library sets height: 100% inline. */
  .bc-workspace {
    height: 640px !important;
  }
  .bc-refcol {
    height: 70vh;
    border-top: 1px solid var(--rule);
  }
}

