/* Opportunities → Markets (piece 8b). Scoped to .mk-* so it touches nothing else. */
.mk-shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; }
.mk-tree { border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: var(--card, #fff); position: sticky; top: 8px; }
.mk-tree-head { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 8px; }
.mk-global { width: 100%; text-align: left; border: 1px dashed var(--line); background: none; border-radius: 8px; padding: 6px 8px; margin-bottom: 10px; cursor: pointer; font: inherit; color: var(--ink); }
.mk-state { margin-bottom: 10px; }
.mk-state-name { font-weight: 700; margin: 4px 0; }
.mk-node { display: flex; flex-wrap: wrap; gap: 4px; justify-content: space-between; width: 100%; text-align: left; border: none; background: none; padding: 6px 8px; border-radius: 6px; cursor: pointer; font: inherit; color: var(--ink); }
.mk-node:hover { background: rgba(0,0,0,.04); }
.mk-node.on { background: rgba(245,166,35,.16); font-weight: 600; }
.mk-node.off { color: var(--muted); }
.mk-nc { font-size: 11px; color: var(--muted); }
.mk-page { min-width: 0; }
.mk-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.mk-head h2 { margin: 0; }
.mk-sections { display: flex; flex-wrap: wrap; gap: 4px; margin: 10px 0; border-bottom: 1px solid var(--line); }
.mk-sec { border: none; background: none; padding: 7px 10px; cursor: pointer; font: inherit; color: var(--muted); border-bottom: 2px solid transparent; }
.mk-sec.on { color: var(--ink); border-bottom-color: #f5a623; font-weight: 600; }
.mk-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 12px; }
.mk-tile { border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mk-tile span { font-size: 12px; color: var(--muted); }
.mk-tile strong { font-size: 20px; overflow-wrap: anywhere; }
.mk-tile small { color: var(--muted); overflow-wrap: anywhere; }
.mk-hist { display: flex; flex-direction: column; gap: 4px; max-width: 520px; }
.mk-bar { display: grid; grid-template-columns: 20px 1fr 64px; align-items: center; gap: 8px; }
.mk-track { height: 12px; background: rgba(0,0,0,.06); border-radius: 6px; overflow: hidden; }
.mk-fill { display: block; height: 100%; background: #5a626c; }
.mk-g-A { background: #1e8e3e; } .mk-g-B { background: #5fa35f; } .mk-g-C { background: #d8a200; } .mk-g-D { background: #e37400; } .mk-g-F { background: #c5221f; }
.mk-v { text-align: right; font-variant-numeric: tabular-nums; }
.mk-chip { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; font-size: 12px; margin: 2px; color: var(--ink); text-decoration: none; }
.mk-chip-off { color: var(--muted); border-style: dashed; }
.mk-files, .mk-cats { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.mk-rules td, .mk-runs td { vertical-align: top; overflow-wrap: break-word; }
.mk-check-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.mk-check-form label { display: flex; flex-direction: column; font-size: 12px; min-width: 200px; flex: 1; }
.mk-empty { border: 1px dashed var(--line); border-radius: 10px; padding: 14px; color: var(--muted); }
.mk-empty b { color: var(--ink); display: block; margin-bottom: 4px; }
.mk-err { color: #c5221f; }
.mk-missing { margin: 6px 0 8px 18px; }
.mk-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.mk-card { border: 1px solid var(--line); border-radius: 8px; padding: 8px; min-width: 0; overflow-wrap: anywhere; }
.mk-links { margin-top: 8px; }
@media (max-width: 760px) {
  .mk-shell { grid-template-columns: minmax(0, 1fr); }
  .mk-tree { position: static; }
  .mk-sections { overflow-x: auto; flex-wrap: nowrap; }
  .mk-sec { white-space: nowrap; }
}
/* piece 6: discovery sources + draft review */
.mk-quote { margin: 6px 0; padding: 6px 10px; border-left: 3px solid var(--border, #ccc); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.mk-di-err { font-size: 12px; overflow-wrap: anywhere; }
#mk-di-sources td { vertical-align: top; }
#mk-di-sources .mk-di-act { margin: 2px 0; display: block; }


/* ---- Markets → Rules: decision panel, readable summary, detail drawer ---- */
.mk-decide { border: 1px solid var(--line); border-top: 3px solid var(--gold, #f5a623); border-radius: 10px; padding: 12px 14px; background: var(--panel, #fff); }
.mk-decide-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-bottom: 8px; }
.mk-decide h4, .mk-say h4 { margin: 0; }
.mk-order { font-size: 12px; font-weight: 600; color: #b45309; background: #fff4e5; border-radius: 10px; padding: 2px 8px; }
.mk-none { color: var(--muted); font-size: 13px; }
.mk-dlist { display: flex; flex-direction: column; gap: 8px; }
.mk-dlist:empty { display: none; }
.mk-ditem { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-width: 0; overflow-wrap: anywhere; }
.mk-dline { font-size: 13px; }
.mk-dmore { font-size: 12.5px; margin-top: 2px; }
.mk-impact { font-size: 12.5px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
/* The moved Rulebook card: keep only its actions + preview; the summary above says what it does. */
.mk-card-in { padding: 0; border: 0; }
.mk-card-in > .rb-rule-head, .mk-card-in > .rb-change, .mk-card-in > .muted-note { display: none; }
.mk-card-in .rb-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.mk-card-in .rb-confirm { flex-basis: 100%; font-size: 12.5px; }
.mk-pvdet summary { cursor: pointer; font-size: 12px; color: var(--muted); margin-top: 4px; }
.mk-pvdet .rb-preview { overflow-x: auto; }
.mk-dsub { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 10px 0 4px; }
.mk-open-list { margin: 0 0 4px 18px; padding: 0; font-size: 13px; }
.mk-open-list li { margin: 3px 0; overflow-wrap: anywhere; }
.mk-open-list li .muted-note { font-size: 12px; }
/* The technical "what happens now" text sits behind a click. */
.mk-now > summary { cursor: pointer; color: var(--muted, #6b7280); font-size: 12px; padding: 6px 0; }
.mk-now > div { margin: 2px 0 6px; }
.mk-imports { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid #f0f1f3; }
.mk-imports:empty { display: none; }
.mk-imp { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin: 0; }
.mk-imp .muted-note { font-size: 12px; flex: 1 1 260px; }
#mk-dn .m-note { margin-bottom: 8px; }

.mk-say-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0; }
.mk-say-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; }
.mk-rq { min-width: 0; width: 240px; max-width: 100%; padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.mk-rq:focus { outline: none; border-color: var(--gold, #f5a623); }
.mk-toggle { display: inline-flex; }
.mk-toggle .btn-ghost { border-radius: 0; }
.mk-toggle .btn-ghost:first-child { border-radius: 8px 0 0 8px; }
.mk-toggle .btn-ghost:last-child { border-radius: 0 8px 8px 0; margin-left: -1px; }
.mk-say-note { margin-bottom: 8px; font-size: 12.5px; }
.mk-qs { border: 1px solid var(--line); border-radius: 10px; background: var(--panel, #fff); }
.mk-q { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px; padding: 9px 12px; border-top: 1px solid #f0f1f3; }
.mk-q:first-child { border-top: 0; }
.mk-q-l { font-weight: 700; font-size: 13px; padding-top: 3px; }
.mk-q-empty .mk-q-l { color: var(--muted); font-weight: 600; }
.mk-q-empty .mk-q-v { padding-top: 3px; font-size: 12.5px; }
.mk-fl { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.mk-fl + .mk-fl { margin-top: 5px; }
.mk-fl-l { font-size: 12px; color: var(--muted); min-width: 130px; }
.mk-fl-v { display: flex; flex-wrap: wrap; gap: 4px 14px; min-width: 0; flex: 1; }
.mk-grp { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; }
.mk-band { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); margin-right: 2px; }
.mk-band.mk-b-allowed { color: #15803d; } .mk-band.mk-b-conditional { color: #b45309; } .mk-band.mk-b-closed { color: #b42318; }
.mk-rc { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 2px 9px; font: inherit; font-size: 12.5px; cursor: pointer; color: var(--ink); max-width: 100%; overflow-wrap: anywhere; text-align: left; }
.mk-rc:hover, .mk-rc.on { border-color: var(--gold, #f5a623); box-shadow: 0 0 0 2px rgba(245,166,35,.25); }
.mk-rc.mk-b-allowed { background: #eaf7ee; border-color: #bfe5cb; }
.mk-rc.mk-b-conditional { background: #fff4e5; border-color: #f6d9ae; }
.mk-rc.mk-b-closed { background: #fdecec; border-color: #f3c2c0; }
.mk-rc.mk-b-unclear, .mk-rc.mk-rc-muted { background: #f3f4f6; color: var(--muted); }
.mk-rc.mk-rc-open { border-style: dashed; border-color: #b45309; }
.mk-rc-v { color: var(--muted); }
.mk-rc-demo { cursor: default; font-size: 11px; padding: 0 6px; }
.mk-legend { margin-top: 6px; font-size: 12px; }
.mk-rules .mk-tcat td { background: #f7f7f8; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.mk-rules .mk-tr { cursor: pointer; }
.mk-rules .mk-tr:hover td, .mk-rules .mk-tr.on td { background: #fffdf6; }
.mk-rules tr.mk-open td:first-child { box-shadow: inset 3px 0 0 #b45309; }
.mk-rules td { font-size: 12.5px; vertical-align: top; }
.mk-rules td:nth-child(1) { min-width: 110px; }
.mk-rules .mk-cit { max-width: 280px; }
.mk-src { white-space: nowrap; }
.mk-src-txt { display: inline-block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.mk-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 400px; max-width: 100vw; background: var(--panel, #fff); border-left: 1px solid var(--line);
  box-shadow: -8px 0 24px rgba(0,0,0,.12); padding: 16px 18px; overflow-y: auto; z-index: 1200; overflow-wrap: anywhere; }
.mk-drawer.mk-inline { position: static; width: auto; box-shadow: none; border: 1px solid var(--gold, #f5a623); border-radius: 10px; margin: 6px 12px; padding: 12px; }
.mk-dr-head { display: flex; justify-content: space-between; align-items: start; gap: 8px; }
.mk-dr-head b { font-size: 16px; }
.mk-dr-val { font-size: 20px; font-weight: 800; margin: 8px 0 10px; white-space: pre-wrap; }
.mk-dl { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 6px 10px; margin: 0; font-size: 13px; }
.mk-dl dt { color: var(--muted); font-size: 12px; }
.mk-dl dd { margin: 0; min-width: 0; }
.mk-dl .mk-src-txt { max-width: 100%; white-space: normal; }
.mk-dr-conf { margin-top: 10px; padding: 8px; background: #fff8ec; border-radius: 8px; font-size: 13px; }
.mk-dr-act { margin-top: 12px; }
.mk-adv summary { cursor: pointer; list-style: none; }
.mk-adv summary::-webkit-details-marker { display: none; }
.mk-adv summary h4 { display: inline; color: var(--muted); }
.mk-adv summary::before { content: '▸ '; color: var(--muted); }
.mk-adv[open] summary::before { content: '▾ '; }
@media (max-width: 760px) {
  .mk-open-list li { white-space: normal; }
  .mk-q { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .mk-fl-l { min-width: 0; flex-basis: 100%; }
  .mk-rq { width: 100%; }
  .mk-say-tools { width: 100%; }
  .mk-dl { grid-template-columns: 90px minmax(0, 1fr); }
}
.mk-drawer .mk-check-form { flex-direction: column; align-items: stretch; margin-top: 10px; }
.mk-drawer .mk-check-form label { min-width: 0; flex: none; gap: 3px; }
.mk-drawer .mk-check-form input { height: auto; min-height: 0; padding: 6px 8px; font: inherit; font-size: 13px; }
.mk-drawer .mk-check-form .btn-gold { align-self: flex-start; }

.mk-none-all summary { cursor: pointer; }
.mk-none-all[open] summary { margin-bottom: 4px; }

/* Plain-English rule lines */
.mk-plain .mk-pcat{margin:0 0 12px}
.mk-plain .mk-pcat h5{margin:0 0 4px;font-size:14px}
.mk-plain .mk-plist{list-style:none;margin:0;padding:0}
.mk-plain .mk-pr{display:block;width:100%;text-align:left;background:none;border:0;border-left:3px solid var(--line,#e3e6ea);padding:3px 8px;margin:2px 0;font:inherit;cursor:pointer}
.mk-plain .mk-pr:hover,.mk-plain .mk-pr.on{background:var(--muted-bg,#eceef1)}
.mk-plain .mk-pr.mk-b-allowed{border-left-color:var(--go,#1f8a4c)}
.mk-plain .mk-pr.mk-b-conditional{border-left-color:var(--gold,#f5a623)}
.mk-plain .mk-pr.mk-b-closed{border-left-color:var(--no,#b4232a)}
.mk-plain .mk-pr.mk-rc-open{border-left-style:dashed}
