.tb-card, .tb-sample {
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid var(--warm-line);
  border-radius: 8px;
  background: linear-gradient(145deg, var(--warm-wash), var(--paper));
}
.tb-card h3, .tb-dialog h2, .tb-dialog h3 { margin: 0 0 .7rem; line-height: 1.4; }
.tb-card .tb-note, .tb-sample .tb-note, .tb-dialog .tb-note {
  margin: .65rem 0 .85rem;
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.65;
}
.tb-sample > summary { font-size: .95rem; font-weight: 700; color: var(--warm); cursor: pointer; }
.tb-sample-body { margin-top: .8rem; }
.tb-canvas { display: block; width: 100%; max-width: 600px; height: auto; margin: .5rem auto; }
.tb-sample .tb-canvas { max-width: 420px; }
.tb-code { margin: .6rem 0; font-family: ui-monospace, monospace; font-size: .95rem; color: var(--warm); }
.tb-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.tb-card button, .tb-dialog button { min-height: 40px; border-radius: 5px; font-weight: 650; cursor: pointer; }
.tb-action, .tb-dialog .tb-action { border: 1px solid var(--control); background: var(--paper); color: var(--ink); padding: .46rem .8rem; }
.tb-primary, .wf .tb-primary, .tb-dialog .tb-primary {
  padding: .5rem .9rem; border: 1px solid var(--blue); background: var(--blue); color: var(--paper);
}
.tb-action:hover, .tb-dialog .tb-action:hover { background: var(--pale); border-color: var(--blue); }
.tb-primary:hover, .wf button.tb-primary:hover:not(:disabled), .tb-dialog .tb-primary:hover { background: var(--deep-blue); color: var(--paper); }
.tb-card button:disabled { opacity: .6; cursor: wait; }
.tb-message { margin: .65rem 0; color: var(--text); }
.tb-error { color: var(--error); }
.tb-url, .tb-input { padding: .55rem .7rem; width: 100%; min-width: 0; font-size: 1rem; color: var(--ink); border: 1px solid var(--control); background: var(--paper); border-radius: 5px; }
.tb-url { margin-top: .65rem; }
.tb-dialog { box-sizing: border-box; box-shadow: var(--dialog-shadow); width: min(36rem, calc(100vw - 1.75rem)); max-height: 86dvh; color: var(--text); background: var(--paper); border: 1px solid var(--control); border-radius: 12px; padding: clamp(1rem,4vw,1.5rem); }
.tb-dialog .tb-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: .8rem; }
.tb-dialog h2 { font-size: clamp(1.12rem, 3.5vw, 1.55rem); }
.tb-lookup-form { display: flex; flex-wrap: wrap; align-items: end; gap: .65rem; }
.tb-label { display: grid; flex: 1 1 13rem; gap: .35rem; font-size: .94rem; font-weight: 600; }
.tb-input { font-family: ui-monospace, monospace; }
.tb-dialog .tb-lookup-result:not(:empty) { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: 1rem; }
.tb-record { display: grid; grid-template-columns: auto 1fr; column-gap: 1rem; row-gap: .65rem; }
.tb-record dt { color: var(--muted); font-size: .9rem; }
.tb-record dd { overflow-wrap: anywhere; margin: 0; font-size: .96rem; }
.tb-record dd:first-of-type { color: var(--warm); font-weight: 750; font-size: 1.08rem; }
@media(max-width:450px) {
  .tb-record { grid-template-columns: 1fr; gap: .15rem; }
  .tb-record dd { margin-bottom: .55rem; }
  .tb-dialog .tb-primary { flex: 1 1 auto; }
}
