.tr-widget {
    --tr-ink: #172033;
    --tr-muted: #64748b;
    --tr-line: #dbe3ee;
    --tr-blue: #245b9e;
    --tr-blue-soft: #edf5ff;
    --tr-green: #26704a;
    --tr-green-soft: #edf8f1;
    --tr-amber: #9a5b09;
    --tr-amber-soft: #fff7e8;
    margin: 1.25rem 0;
    padding: clamp(1rem, 2.4vw, 1.5rem);
    border: 1px solid var(--tr-line);
    border-radius: 18px;
    background: #fbfdff;
    color: var(--tr-ink);
    box-shadow: 0 10px 28px rgba(15, 35, 65, 0.07);
}
.tr-widget * { box-sizing: border-box; }
.tr-widget-heading { display: flex; justify-content: space-between; align-items: start; gap: 1rem; margin-bottom: 1rem; }
.tr-eyebrow { margin: 0 0 .25rem; color: var(--tr-blue); font-size: .74rem; font-weight: 800; letter-spacing: .1em; }
.tr-widget-heading h3 { margin: 0; font-size: 1.3rem; line-height: 1.25; }
.tr-progress { margin: .2rem 0 0; color: var(--tr-muted); font-size: .9rem; font-weight: 700; text-align: right; }
.tr-input-choice { margin: 0 0 1rem; padding: .8rem 1rem; border-radius: 12px; background: #f1f5f9; }
.tr-input-choice p { margin: 0 0 .55rem; }
.tr-input-choice button { min-height: 40px; margin-right: .4rem; padding: .5rem .8rem; border: 1px solid #b9c7d8; border-radius: 9px; background: #fff; color: var(--tr-ink); font: inherit; font-weight: 700; cursor: pointer; }
.tr-input-choice button[aria-pressed="true"] { border-color: var(--tr-blue); background: var(--tr-blue); color: #fff; }
.tr-main-grid { display: grid; grid-template-columns: minmax(250px, .95fr) minmax(250px, 1.05fr); gap: .75rem; }
.tr-panel { min-width: 0; padding: .85rem 1rem; border: 1px solid var(--tr-line); border-radius: 12px; background: #fff; }
.tr-panel h4 { margin: 0 0 .55rem; font-size: .92rem; }
.tr-program { max-height: 355px; overflow: auto; margin: 0; padding: 0; list-style: none; font: .84rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.tr-program li { display: grid; grid-template-columns: 3.2rem 1fr; gap: .45rem; padding: .08rem .35rem; border-radius: 5px; white-space: nowrap; }
.tr-pc { color: var(--tr-muted); text-align: right; }
.tr-program li.is-active { background: var(--tr-blue-soft); color: var(--tr-blue); font-weight: 800; box-shadow: inset 3px 0 var(--tr-blue); }
.tr-state-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.tr-state-grid div { display: flex; flex-direction: column; gap: .2rem; min-width: 0; padding: .6rem; border-radius: 9px; background: #f4f7fb; }
.tr-state-grid strong { color: var(--tr-muted); font-size: .76rem; }
.tr-state-grid span { overflow-wrap: anywhere; font: 800 1rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.tr-next-pc { margin: .7rem 0 0; padding: .55rem .7rem; border-radius: 9px; background: var(--tr-blue-soft); }
.tr-step-note { min-height: 88px; margin: .8rem 0; padding: .8rem 1rem; border-left: 4px solid var(--tr-blue); border-radius: 0 10px 10px 0; background: #f4f8fd; }
.tr-label { margin: 0 0 .25rem; color: var(--tr-blue); font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.tr-step-note p:last-child { margin: 0; }
.tr-table-wrap { overflow-x: auto; border: 1px solid var(--tr-line); border-radius: 10px; background: #fff; }
.tr-table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: .82rem; }
.tr-table th, .tr-table td { padding: .42rem .5rem; border-bottom: 1px solid var(--tr-line); text-align: left; white-space: nowrap; }
.tr-table th { background: #f1f5f9; color: #334155; font-size: .75rem; }
.tr-table tbody tr:last-child td { border-bottom: 0; }
.tr-empty-row td { color: var(--tr-muted); text-align: center; }
.tr-controls { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
.tr-controls button { min-height: 42px; padding: .55rem .9rem; border: 1px solid #b9c7d8; border-radius: 9px; background: #fff; color: var(--tr-ink); font: inherit; font-size: .92rem; font-weight: 700; cursor: pointer; }
.tr-controls button:hover:not(:disabled) { border-color: var(--tr-blue); background: var(--tr-blue-soft); }
.tr-controls button:disabled, .tr-input-choice button:disabled { opacity: .45; cursor: not-allowed; }
.tr-widget-note { margin: .75rem 0 0; color: var(--tr-muted); font-size: .84rem; }
@media (max-width: 700px) {
    .tr-widget-heading { flex-direction: column; gap: .25rem; }
    .tr-progress { text-align: left; }
    .tr-main-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .tr-program li { scroll-behavior: auto; } }
