/* The Object-Oriented Paradigm: method lookup explorer.
   Uses the theme's custom properties so light and dark mode both work. */
.oop-widget {
  --oop-hit: #cfe8d6;   --oop-hit-ink: #123d26;
  --oop-miss: #ece6d6;  --oop-miss-ink: #5a5346;
  --oop-err: #f6c4bd;   --oop-err-ink: #5c1410;
  --oop-sup: #f6e0a8;   --oop-sup-ink: #4a3300;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.1rem 1.2rem;
  margin: 1.5rem 0;
  box-shadow: var(--shadow-sm);
  color: var(--text-primary);
}
[data-theme="dark"] .oop-widget {
  --oop-hit: #21503a;   --oop-hit-ink: #d8f3e3;
  --oop-miss: #34322d;  --oop-miss-ink: #c9c2b2;
  --oop-err: #6b2a26;   --oop-err-ink: #fde0dc;
  --oop-sup: #5d4a12;   --oop-sup-ink: #fdecb8;
}
.oop-widget h4 { margin: 0 0 .25rem; font-size: 1.05rem; }
.oop-widget .oop-lead { margin: 0 0 1rem; color: var(--text-secondary); font-size: .92rem; }
.oop-widget fieldset { border: 0; margin: 0 0 .9rem; padding: 0; min-width: 0; }
.oop-widget legend { font-weight: 700; font-size: .85rem; padding: 0; margin-bottom: .35rem; color: var(--text-primary); }

.oop-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.oop-choices { display: flex; flex-wrap: wrap; gap: .4rem; }
.oop-choice { position: relative; }
.oop-choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.oop-choice span {
  display: block; padding: .4rem .7rem; border-radius: var(--radius-md); cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--bg-tertiary); font-size: .88rem;
  font-family: var(--font-mono);
}
.oop-choice input:checked + span { background: var(--primary); color: var(--text-inverse, #fff); border-color: var(--primary); }
.oop-choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.oop-checks { display: grid; gap: .3rem; }
.oop-check { display: flex; align-items: center; gap: .5rem; font-size: .88rem; font-family: var(--font-mono); cursor: pointer; }
.oop-check input { width: 1.05rem; height: 1.05rem; flex: none; }
.oop-check input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Class hierarchy */
.oop-tree { display: grid; gap: .5rem; }
.oop-class {
  border: 2px solid var(--border-strong); border-radius: var(--radius-md); background: var(--bg-tertiary);
  padding: .45rem .6rem; transition: background .2s, border-color .2s;
}
.oop-class .oop-cname { font-weight: 700; font-size: .9rem; display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.oop-class .oop-meth { font-family: var(--font-mono); font-size: .78rem; color: var(--text-secondary); margin-top: .15rem; overflow-wrap: anywhere; }
.oop-class .oop-meth s { opacity: .6; }
.oop-class[data-state="hit"] { background: var(--oop-hit); border-color: #3f7d5c; color: var(--oop-hit-ink); }
.oop-class[data-state="hit"] .oop-meth { color: inherit; }
.oop-class[data-state="miss"] { background: var(--oop-miss); color: var(--oop-miss-ink); border-style: dashed; }
.oop-class[data-state="miss"] .oop-meth { color: inherit; }
.oop-class[data-state="err"] { background: var(--oop-err); border-color: #c8372d; color: var(--oop-err-ink); }
.oop-class[data-state="err"] .oop-meth { color: inherit; }
.oop-kids { display: grid; gap: .5rem; margin-left: 1.1rem; padding-left: .7rem; border-left: 2px solid var(--border-strong); }
.oop-badge {
  min-width: 1.5rem; height: 1.5rem; padding: 0 .35rem; border-radius: 999px; display: inline-grid; place-items: center;
  font-size: .75rem; font-weight: 700; background: var(--text-primary); color: var(--surface); flex: none;
}
.oop-badge:empty { display: none; }

/* Result */
.oop-call { font-family: var(--font-mono); font-size: .92rem; background: var(--tr-code-bg, #1c1a17); color: var(--tr-code-text, #efe7d6); padding: .55rem .7rem; border-radius: var(--radius-md); overflow-wrap: anywhere; }
.oop-steps { margin: .7rem 0 .7rem; padding-left: 1.3rem; font-size: .9rem; }
.oop-steps li { margin: .25rem 0; }
.oop-steps code { font-size: .82rem; }
.oop-result { padding: .6rem .7rem; border-radius: var(--radius-md); font-size: .92rem; background: var(--oop-hit); color: var(--oop-hit-ink); }
.oop-result.is-error { background: var(--oop-err); color: var(--oop-err-ink); }
:root[data-theme] .oop-widget .oop-result code { background: transparent; color: inherit; overflow-wrap: anywhere; box-shadow: none; }
.oop-note { margin: .6rem 0 0; font-size: .85rem; color: var(--text-secondary); }

@media (max-width: 720px) {
  .oop-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .oop-class { transition: none; }
}

/* Labs built on the shared kit (css/labs.css) */
.oop-snip { margin: .6rem 0 0; font-size: .82rem; max-width: 34rem; }
.oop-attr { margin: .15rem 0; font-size: .82rem; overflow-wrap: anywhere; }
.oop-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .5rem; }
.oop-card { text-align: left; padding: .6rem .7rem; border: 2px solid var(--border-strong); border-radius: var(--radius-md); background: var(--bg-tertiary); cursor: pointer; font: inherit; color: var(--text-primary); display: grid; gap: .25rem; }
.oop-card.is-sel { border-color: var(--primary); background: var(--lab-info); color: var(--lab-info-ink); }
.oop-card b { font: 700 .8rem var(--font-mono); overflow-wrap: anywhere; }
.oop-card ul { margin: 0; padding-left: 1.1rem; font-size: .84rem; }
.oop-none { list-style: none; margin-left: -1.1rem; color: var(--text-secondary); font-style: italic; }
.oop-count { font: 700 .76rem var(--font-body); }
.oop-count.is-bad { color: var(--lab-bad-ink); background: var(--lab-bad); border-radius: 999px; padding: .05rem .5rem; justify-self: start; }
.oop-acts { margin-top: .2rem; }
.oop-log .oop-call { margin: 0 0 .4rem; font-size: .84rem; white-space: pre-wrap; overflow-wrap: anywhere; }
