/* proof miner — plain hypertext on stone paper, terminal accents. System fonts only. */
:root {
  --bg: #edeae2;     /* stone paper */
  --panel: #f6f4ee;
  --fg: #1c1c1c;
  --hi: #000;
  --dim: #74746f;
  --rule: #cfcabd;
  --link: #7a3e00;   /* ore brown */
  --visited: #5c4632;
  --ok: #00874a;     /* phosphor, darkened for paper */
  --warn: #a66a00;
  --hot: #b85c00;    /* head lamp */
  --bad: #c8102e;
  --term-bg: #0b0b0b;
  --term-fg: #3dff9a;
  --serif: "Times New Roman", Times, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; color: var(--fg); font: 17px/1.45 var(--serif); }
a { color: var(--link); }
a:visited { color: var(--visited); }
a:hover { color: var(--hi); background: #f3dfb8; }
::selection { background: var(--hot); color: #fff; }
h2 { font: bold 22px var(--serif); color: var(--hi); margin: 0 0 8px; }
h4 { font: bold 13px var(--mono); color: var(--hi); margin: 18px 0 4px; text-transform: lowercase; }
p { margin: 0 0 12px; }
.mono { font-family: var(--mono); }
.small { font-size: 14px; }
.dim { color: var(--dim); }
.ok { color: var(--ok); } .warn { color: var(--warn); } .hot { color: var(--hot); } .bad { color: var(--bad); }
.r { text-align: right; }

/* top bar (marketplace style) */
.bar { display: flex; align-items: center; gap: 14px; padding: 8px 14px; border-bottom: 1px solid var(--rule); font: 13px var(--mono); position: sticky; top: 0; background: rgba(237,234,226,.95); z-index: 5; }
.logo { font: bold 18px var(--serif); color: var(--hi) !important; text-decoration: none; letter-spacing: .02em; }
.logo:hover { background: none; }
.tick { color: var(--ok); border: 1px solid var(--ok); padding: 0 5px; font-size: 11px; }
.search { display: flex; margin-left: 8px; }
.search input { background: #fff; border: 1px solid #b5b5b0; color: var(--hi); font: 13px var(--mono); padding: 4px 8px; width: 240px; outline: none; }
.search input:focus { border-color: var(--link); }
.search button { background: #e0e0dc; color: var(--fg); border: 1px solid #b5b5b0; border-left: 0; font: 13px var(--mono); padding: 4px 10px; cursor: pointer; }
.stats { margin-left: auto; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stats b { color: var(--fg); font-weight: normal; }
.stats .ok { color: var(--ok); }

/* the painting */
.painting { margin: 0; position: relative; border-bottom: 1px solid var(--rule); background: #000; }
.painting img { display: block; width: 100%; height: auto; max-height: 78vh; object-fit: cover; object-position: center 45%; }
.overlay { position: absolute; left: 18px; top: 14px; z-index: 1; display: flex; flex-direction: column; font: 13px/1.6 var(--mono); color: #f2f2f2; text-shadow: 0 0 6px #000, 0 0 2px #000; }
.overlay span:first-child { font: italic 30px/1.2 var(--serif); }
.overlay b { color: var(--term-fg); font-weight: normal; }
.cursor { font-style: normal; color: var(--term-fg); animation: blink 1.1s steps(1) infinite; margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }
figcaption { font-size: 12px; color: var(--dim); padding: 4px 14px 6px; font-style: normal; background: var(--bg); }
figcaption a { color: var(--dim); }

/* layout */
.wrap { display: grid; grid-template-columns: 210px minmax(0, 1fr); max-width: 1180px; margin: 0 auto; }
.side { padding: 6px 14px 30px; border-right: 1px solid var(--rule); font-size: 15px; }
.side ul { list-style: none; padding: 0; margin: 0; }
.side li { padding: 1px 0; }
.side .n { color: var(--dim); font: 12px var(--mono); }
.side a.on { color: #fff; background: #1c1c1c; text-decoration: none; padding: 0 3px; }
main { padding: 14px 22px 40px; min-width: 0; }
section { margin-bottom: 34px; scroll-margin-top: 52px; }
.intro p { max-width: 720px; }

.snippet { background: var(--term-bg); border: 1px solid #000; border-left: 3px solid var(--term-fg); padding: 10px 12px; font: 13px/1.6 var(--mono); color: var(--term-fg); white-space: pre-wrap; margin: 0 0 6px; }

/* tables */
table.list { width: 100%; border-collapse: collapse; font-size: 15px; }
.list th { font: 12px var(--mono); color: var(--dim); text-align: left; padding: 4px 6px; border-bottom: 1px solid #999; font-weight: normal; }
.list td { padding: 4px 6px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.list tr.row { cursor: pointer; }
.list tr.row:hover td { background: var(--panel); }
.list td.mono, .list td.r { font: 13px var(--mono); }
.list td.price { color: var(--fg); font: 13px var(--mono); text-align: right; white-space: nowrap; }
.list td.st { width: 18px; font-family: var(--mono); }
.legend { margin-top: 6px; }

/* feed */
.filters a { text-decoration: none; }
.filters a.on { color: var(--hi); text-decoration: underline; }
.live { color: var(--dim); font-size: 12px; vertical-align: middle; }
.live.up { color: var(--ok); animation: blink 2s steps(1) infinite; }
.feed { list-style: none; padding: 0; margin: 0; font: 13px/1.55 var(--mono); max-height: 520px; overflow-y: auto; border-top: 1px solid var(--rule); }
.feed li { padding: 2px 0; border-bottom: 1px solid #dededa; display: grid; grid-template-columns: 70px 130px 74px 1fr; gap: 10px; }
.feed li.click { cursor: pointer; }
.feed li.click:hover { background: var(--panel); }
.feed li.new { animation: flash 1.5s; }
@keyframes flash { from { background: #ffd6f0; } }
.feed .t { color: var(--dim); }
.feed .who { color: var(--link); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .tag { color: var(--dim); }
.feed .tag.ok { color: var(--ok); } .feed .tag.bad { color: var(--bad); } .feed .tag.hot { color: var(--hot); } .feed .tag.warn { color: var(--warn); }
.feed .msg { color: var(--hi); font-family: var(--serif); font-size: 15px; font-style: italic; }
.feed li.dim { display: block; }

.tombs { padding-left: 22px; margin: 0; font-size: 15px; }
.tombs li { margin-bottom: 3px; cursor: pointer; }
.tombs li:hover { color: var(--hi); }
.tombs .m { font: 12px var(--mono); color: var(--dim); }

.epoch { margin-bottom: 18px; }
.epoch .h { font: 13px var(--mono); color: var(--hi); margin-bottom: 4px; }

footer { border-top: 1px solid var(--rule); padding-top: 10px; }

/* detail dialog */
dialog { background: var(--panel); color: var(--fg); border: 1px solid #888; max-width: 860px; width: 94vw; max-height: 88vh; padding: 16px 22px; }
dialog::backdrop { background: rgba(30,30,30,.55); }
dialog h3 { font: bold 22px var(--serif); color: var(--hi); margin: 4px 0 8px; }
dialog pre { background: #fff; border: 1px solid var(--rule); padding: 10px; font: 12.5px/1.5 var(--mono); white-space: pre-wrap; overflow-x: auto; color: var(--fg); }
dialog pre.err { color: var(--bad); border-color: #e8b4bd; background: #fff5f6; }
dialog .att { border-top: 1px dashed #aaa; margin-top: 14px; padding-top: 10px; }
dialog .meta { font: 12px var(--mono); color: var(--dim); }

@media (max-width: 820px) {
  .wrap { grid-template-columns: 1fr; }
  .side { border-right: 0; border-bottom: 1px solid var(--rule); columns: 2; }
  .side h4 { break-after: avoid; }
  .search input { width: 130px; }
  .stats { display: none; }
  .feed li { grid-template-columns: 56px 1fr; }
  .feed li .tag, .feed li .what { grid-column: span 1; }
  .overlay span:first-child { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }

/* ---------------- the proof graph (docs/GRAPH.md §16.8) */
/* top bar, banner */
#toplinks { font: 13px var(--mono); }
.banner { margin: 0; padding: 6px 14px; border-bottom: 1px solid var(--bad); color: var(--bad); font: 13px var(--mono); background: var(--panel); }
/* color fixes: money and the target tag are never green or magenta */
.list .grand, .tag-target { color: var(--fg); font: 11px var(--mono); border: 1px solid #999; padding: 0 3px; }
.list td.price, .tree .m .price { color: var(--fg); }
.tag-planned { color: var(--dim); font: 12px var(--mono); }
/* /graph */
.painting.short img { max-height: 24vh; }
.wrap.wide { max-width: 1480px; grid-template-columns: 210px minmax(0, 1fr); }
.gmain { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 26px; }
.gmain.has-card { grid-template-columns: minmax(0, 1fr) minmax(340px, 420px); }
.judge { font: 12px/1.6 var(--mono); color: var(--dim); margin: 0 0 10px; }
.facts { max-width: 760px; }
ol.tree { list-style: none; margin: 0 0 6px; padding: 0; font-size: 16px; line-height: 1.35; }
.tree li { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: start; column-gap: 6px; padding: 0 4px 0 0; }
.tree li:hover { background: var(--panel); }
.tree li.sel { background: #e0e0dc; }
.tree li:focus { outline: none; }
.tree li:focus-visible { outline: 1px dotted var(--hi); outline-offset: -1px; }
.tree li.new { animation: flash 1.5s; }
.tree .g { display: flex; align-self: stretch; min-height: 22px; }
.tree .g i { flex: 0 0 1.25em; position: relative; }
.tree .g i::before { content: ''; position: absolute; left: .45em; top: 0; bottom: 0; border-left: 1px solid #bdbdb8; }
.tree .g i.d::before { border-left: 1px dashed var(--warn); }
.tree .tw { flex: 0 0 1.1em; font: 11px/22px var(--mono); color: var(--dim); text-align: center; cursor: pointer; user-select: none; }
.tree .st { font: 13px/22px var(--mono); width: 1em; text-align: center; }
.tree .t { padding: 1px 0; overflow-wrap: anywhere; }
.tree .t code { font: 13px var(--mono); }
.tree .m { font: 12px/22px var(--mono); color: var(--dim); white-space: nowrap; text-align: right; }
.tree .ctx .t, .tree .ctx .t a { color: var(--dim); }
.tree .ref, .noeasier { color: var(--dim); font: 12px var(--mono); }
.tree li.route .t, .tree li.uses .t, .tree li.more .t, .tree li.deeper .t { font: 13px/22px var(--mono); color: var(--dim); padding: 0; }
.tree li.dup .t a { text-decoration: line-through; }
.sub { font: bold 17px var(--serif); color: var(--hi); margin: 22px 0 2px; }
.card { border-left: 1px solid var(--rule); padding: 0 0 30px 20px; position: sticky; top: 52px; align-self: start; max-height: calc(100vh - 60px); overflow-y: auto; }
.card h3 { font: bold 22px var(--serif); color: var(--hi); margin: 4px 0 8px; }
.card h5 { font: 12px var(--mono); color: var(--dim); margin: 16px 0 4px; font-weight: normal; border-bottom: 1px solid var(--rule); }
.card .meta { font: 12px var(--mono); color: var(--dim); }
.card pre { background: #fff; border: 1px solid var(--rule); padding: 8px 10px; font: 12.5px/1.5 var(--mono); white-space: pre-wrap; overflow-x: auto; margin: 0 0 8px; }
.card pre.err { color: var(--bad); border-color: #e8b4bd; background: #fff5f6; }
.prose { font-style: italic; border-left: 1px dashed #aaa; padding-left: 10px; }
.crumbs { font: 12px/1.7 var(--mono); color: var(--dim); }
@media (max-width: 1100px) {
  .gmain.has-card { grid-template-columns: minmax(0, 1fr); }
  .gmain.has-card .outline { display: none; }
  .card { border-left: 0; padding-left: 0; position: static; max-height: none; }
}
@media (max-width: 820px) {
  .wrap.wide { grid-template-columns: 1fr; }
  ol.tree { font-size: 15px; }
  .tree li { grid-template-columns: auto auto minmax(0, 1fr); }
  .tree .m { grid-column: 3; text-align: left; white-space: normal; line-height: 1.4; padding-bottom: 3px; }
  .tree .g i { flex-basis: .8em; }
  .tree .g i::before { left: .3em; }
  .tree .tw { flex-basis: 1.6em; font-size: 13px; }
}

/* additions of the front end (not in §16.8): small helpers for the map, the card, the homepage and /how */
.side a.on:visited { color: #fff; }
.tree li.hdr, .tree li.empty { display: block; font: 12px/1.8 var(--mono); color: var(--dim); padding: 6px 0 0; }
.tree li.hdr:hover, .tree li.empty:hover { background: none; }
.tree li.route .t a, .tree li.more .t a, .tree li.deeper .t a { font: inherit; }
.tree a.ref { color: var(--dim); }
.card summary { font: 12px var(--mono); color: var(--dim); margin: 16px 0 4px; border-bottom: 1px solid var(--rule); cursor: pointer; }
.card .att { border-top: 1px dashed #aaa; margin-top: 8px; padding-top: 6px; }
.card p { margin: 0 0 8px; }
#card-proposal { margin-top: 10px; }
#card-proposal p { margin: 0 0 4px; }
.digest { list-style: none; margin: 0 0 10px; padding: 0; font: 13px/1.7 var(--mono); }
#map .tree { margin-top: 6px; }
#map .sub { margin-top: 14px; }
pre.goals { background: #fff; border: 1px solid var(--rule); padding: 8px 10px; font: 12.5px/1.5 var(--mono); white-space: pre-wrap; overflow-x: auto; margin: 0 0 8px; max-width: 760px; }
.how p, .how li { max-width: 760px; }
.how section h2 { margin-top: 4px; }
.how ol.tree { max-width: 760px; margin: 6px 0 12px; }
.how .steps > li { margin-bottom: 10px; }
.how .words p { margin: 0 0 4px; }
.how code { font: 13px var(--mono); }
@media (min-width: 1101px) { .narrow-only { display: none; } }
@media (max-width: 820px) {
  .bar { flex-wrap: wrap; }
  .card pre, pre.goals, dialog pre { max-width: 100%; }
}
@media (max-width: 560px) {
  .list th, .list td { padding-left: 3px; padding-right: 3px; }
  #agents .list th:first-child, #agents .list tr > td:first-child:not([colspan]) { display: none; }
  #agents .list td:nth-child(2), #agents .list td:nth-child(3) { overflow-wrap: anywhere; min-width: 56px; }
  #agents .list td { font-size: 12px; }
}
.price .small { font: 11px var(--mono); }
@media (max-width: 560px) {
  #problems .list th:nth-child(5), #problems .list td:nth-child(5) { display: none; }
  #problems .list td .mono { overflow-wrap: anywhere; }
}
.qed { color: #d08a1d; }
.lead { font-size: 24px; line-height: 1.3; }
.painting img { image-rendering: auto; }


/* problem kind and impact */
.ptype { font-family: var(--mono); font-size: 11px; padding: 0 5px; border: 1px solid var(--rule); white-space: nowrap; }
.ptype.formal { color: var(--link); }
.impact { color: var(--hi); }
.mine-list { margin: 4px 0 10px 18px; padding: 0; }
.mine-list li { margin: 4px 0; }
