/* Recipes, leaderboard and agents pages (loads after styles.css) */

.pill--oss { background: var(--fill); color: var(--ink); }
.pill--down { background: var(--fill); color: var(--muted); }
.pill--modeled { background: #fff; color: var(--muted); border: 1px solid var(--line); font-weight: 400; }

.stats-row { margin: 22px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14px; color: var(--muted); }
.stats-row strong { font-family: var(--mono); font-weight: 500; color: var(--ink); }
.evidence { margin-top: 18px; display: flex; gap: 10px; align-items: flex-start; max-width: 860px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.evidence svg { flex: none; margin-top: 2px; }
.evidence strong { color: var(--ink); font-weight: 600; }

/* controls */
.rc-controls { position: sticky; top: 0; z-index: 5; background: var(--ground); border-bottom: 1px solid var(--line); padding: 14px 0; }
.rc-controls .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.rc-search { flex: 1 1 320px; position: relative; }
.rc-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.rc-search input { width: 100%; height: 46px; padding: 0 14px 0 42px; border: 1px solid #17181C22; border-radius: 10px; background: #fff;
  font: inherit; font-size: 15px; color: var(--ink); }
.rc-search input:focus, .rc-select:focus { outline: 2px solid var(--green); outline-offset: 1px; border-color: transparent; }
.rc-select { height: 46px; padding: 0 34px 0 12px; border: 1px solid #17181C22; border-radius: 10px; background: #fff; font: inherit; font-size: 14px; color: var(--ink);
  appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23585B63' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid #17181C22; background: #fff; font: inherit; font-size: 13px; font-weight: 500;
  color: var(--ink); cursor: pointer; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.toggle input { width: 16px; height: 16px; accent-color: var(--green); }
.rc-count { font-size: 13px; color: var(--muted); font-family: var(--mono); margin-left: auto; }

/* recipe table */
.rc-list { padding: 18px 0 56px; }
.rc-head, .rc-sum { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr) minmax(0, 1.3fr) 150px 24px; gap: 18px; align-items: center; }
.rc-head { padding: 0 18px 10px; font-size: 12px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.rc-head span:nth-child(4) { text-align: right; }
.rc-item { background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-top: 8px; }
.rc-item[open] { border-color: #17181C33; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); }
.rc-item[hidden] { display: none; }
.rc-sum { padding: 16px 18px; cursor: pointer; list-style: none; }
.rc-sum::-webkit-details-marker { display: none; }
.rc-sum:hover .rc-title { color: var(--green); }
.rc-vendor { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rc-vendor strong { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.rc-vendor span { font-size: 12.5px; color: var(--muted); }
.rc-title { font-size: 15px; font-weight: 500; line-height: 1.35; }
.rc-feats { margin-top: 5px; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.rc-types { display: flex; flex-wrap: wrap; gap: 4px; }
.rc-save { text-align: right; font-family: var(--mono); font-size: 15px; color: var(--green); white-space: nowrap; }
.rc-save small { display: block; font-size: 11.5px; color: var(--muted); }
.rc-save.none { color: var(--muted); font-size: 12.5px; white-space: normal; line-height: 1.35; font-family: var(--sans); }
.rc-chev { color: var(--muted); transition: transform 0.15s; }
.rc-item[open] .rc-chev { transform: rotate(180deg); }
.rc-empty { padding: 40px 0; text-align: center; color: var(--muted); }

.rc-body { border-top: 1px solid var(--line); padding: 20px 18px 22px; display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 28px; }
.rc-facts h3, .rc-paths h3 { margin: 0 0 8px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.rc-facts ul { margin: 0 0 18px; padding: 0 0 0 18px; font-size: 14px; line-height: 1.5; }
.rc-facts ul.x li::marker { content: "– "; color: var(--muted); }
.rc-facts .agent-hint { font-size: 13px; line-height: 1.5; color: var(--muted); }
.rc-facts code, .lb-note code, .ag code { font-family: var(--mono); font-size: 12.5px; background: var(--fill); padding: 1px 5px; border-radius: 5px; overflow-wrap: anywhere; }
.path { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 10px; }
.path-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.path-name { font-weight: 600; font-size: 15px; color: var(--ink); text-decoration: none; }
a.path-name:hover { color: var(--green); text-decoration: underline; }
.path-money { margin-left: auto; font-family: var(--mono); font-size: 14px; color: var(--green); white-space: nowrap; }
.path-money.neg { color: var(--amber); }
.path-money.none { color: var(--muted); font-size: 12.5px; }
.path-meta { margin-top: 6px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.path-meta b { color: var(--ink); font-weight: 500; }
.path-pc { margin-top: 8px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 18px; font-size: 13px; line-height: 1.45; }
.path-pc ul { margin: 0; padding-left: 16px; }
.path-pc .pro li::marker { color: var(--green); }
.path-pc .con li::marker { color: var(--amber); }
.path-src { margin-top: 8px; font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.path-src a { color: var(--muted); }
.path-actions { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.btn--tiny { height: 36px; padding: 0 14px; font-size: 13.5px; border-radius: 8px; }

@media (max-width: 900px) {
  .rc-head { display: none; }
  .rc-sum { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "v s" "t t" "y y"; gap: 8px 12px; }
  .rc-sum .rc-vendor { grid-area: v; } .rc-sum .rc-what { grid-area: t; } .rc-sum .rc-types { grid-area: y; } .rc-sum .rc-save { grid-area: s; } .rc-sum .rc-chev { display: none; }
  .rc-body { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .path-pc { grid-template-columns: minmax(0, 1fr); }
  .path-money { margin-left: 0; width: 100%; }
  .rc-count { margin-left: 0; }
  .rc-controls { position: static; }
  .rc-controls .wrap > label:not(.rc-search):not(.toggle) { flex: 1 1 140px; }
  .rc-controls .rc-select { width: 100%; }
}

/* leaderboard */
.lb-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-top: 8px; overflow-x: auto; }
.lb-tab { height: 44px; padding: 0 14px; border: 0; background: none; font: inherit; font-size: 15px; font-weight: 500; color: var(--muted);
  border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.lb-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--green); }
.lb-list { list-style: none; margin: 16px 0 0; padding: 0; }
.lb-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 190px; gap: 16px; align-items: center; padding: 16px 18px; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; }
.lb-row[hidden] { display: none; }
.lb-rank { font-family: var(--serif); font-size: 30px; line-height: 1; color: var(--muted); text-align: center; }
.lb-row:nth-child(-n+3):not([hidden]) .lb-rank { color: var(--green); }
.lb-main { min-width: 0; }
.lb-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 15.5px; }
.lb-line .from { font-weight: 600; }
.lb-line .arrow { color: var(--muted); }
.lb-line .to { font-weight: 600; color: var(--ink); }
.lb-scope { margin-top: 5px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.lb-num { text-align: right; }
.lb-num .big { display: block; font-family: var(--mono); font-size: 20px; color: var(--green); }
.lb-num .sub { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); font-family: var(--mono); }
.lb-num a { font-size: 12.5px; }
.lb-note { margin: 14px 0 0; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.lb-empty { padding: 28px 18px; background: #fff; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.cat-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cat-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; text-decoration: none; color: var(--ink); display: block; }
.cat-card:hover { border-color: var(--ink); color: var(--ink); }
.cat-card .c { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.cat-card .t { margin-top: 6px; font-size: 15px; font-weight: 600; line-height: 1.35; }
.cat-card .m { margin-top: 8px; font-family: var(--mono); font-size: 14px; color: var(--green); }
.lb-section { padding: 40px 0; border-top: 1px solid var(--line); }
@media (max-width: 900px) { .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .lb-row { grid-template-columns: 30px minmax(0, 1fr); padding: 14px; }
  .lb-num { grid-column: 2; text-align: left; }
  .lb-rank { font-size: 24px; }
  .cat-grid { grid-template-columns: minmax(0, 1fr); }
}

/* home teaser */
.lb-teaser .lb-list { margin-top: 22px; }
.teaser-foot { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; font-size: 14px; }

/* agents */
.ag { padding: 36px 0; border-top: 1px solid var(--line); }
.ag-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 18px; }
.endpoint { margin-top: 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.endpoint code.big { font-size: 18px; padding: 12px 16px; border-radius: 10px; background: #fff; border: 1px solid var(--line); }
pre.snip { margin: 10px 0 0; padding: 14px 16px; background: var(--ink); color: #F5F3EE; border-radius: 10px; font-family: var(--mono); font-size: 12.5px;
  line-height: 1.55; overflow-x: auto; white-space: pre; }
.snip-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; min-width: 0; }
.snip-card h3 { margin: 0; font-size: 15px; font-weight: 600; }
.snip-card p { margin: 6px 0 0; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.copy { margin-top: 8px; }
.tools-table { width: 100%; margin-top: 16px; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-size: 14px; }
.tools-table th, .tools-table td { text-align: left; padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: top; line-height: 1.45; }
.tools-table thead th { border-top: 0; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; background: var(--fill); }
.tools-table td:first-child { font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.tools-table td:last-child { color: var(--muted); }
@media (max-width: 800px) {
  .ag-grid { grid-template-columns: minmax(0, 1fr); }
  .tools-table td:last-child, .tools-table th:last-child { display: none; }
  .tools-table td:first-child { white-space: normal; overflow-wrap: anywhere; }
}
.lb-teaser { padding: 64px 0; }

/* share row, recipe permalink pages */
.share-row { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.share-row > span { font-size: 13px; font-weight: 600; color: var(--muted); margin-right: 4px; }
.web-crumbs { display: flex; gap: 8px; font-size: 13.5px; color: var(--muted); margin-bottom: 14px; }
.web-crumbs a { color: var(--muted); }
.rc-single { margin-top: 0; }
.rc-single .rc-body { border-top: 0; }
.rel-list { list-style: none; margin: 14px 0 0; padding: 0; columns: 2; column-gap: 32px; }
.rel-list li { break-inside: avoid; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.rel-list .mono { font-family: var(--mono); color: var(--green); font-size: 13px; }
@media (max-width: 700px) { .rel-list { columns: 1; } }
