.case-tools { margin-block: 2rem; scroll-margin-top: 7rem; }
.case-tools [hidden] { display: none !important; }
.ct-panel { padding: clamp(1rem, 3vw, 2.25rem); border: 1px solid var(--line, #d8d7dd); border-radius: 16px; background: var(--sheet, #fff); color: var(--ink, #212138); }
.ct-panel header p, .ct-guide, .ct-hint { max-width: 80ch; }
.ct-guide { margin-block: 1rem; padding: .85rem 1rem; border-inline-start: 3px solid var(--stamp, #3a3fc0); background: var(--stamp-soft, #ecedfb); }
.ct-panel fieldset { min-inline-size: 0; margin: 1rem 0; padding: .9rem 1rem; border: 1px solid var(--line, #d8d7dd); border-radius: 10px; }
.ct-panel legend { padding-inline: .3rem; font-weight: 700; }
.ct-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: .9rem 1.1rem; }
.ct-field { display: flex; min-width: 0; flex-direction: column; gap: .3rem; font-weight: 600; }
.ct-field input, .ct-field textarea, .ct-field select { box-sizing: border-box; width: 100%; min-width: 0; min-height: 42px; padding: .55rem .65rem; border: 1px solid var(--line, #c9c8d4); border-radius: 7px; background: var(--sheet, #fff); color: inherit; font: inherit; font-weight: 400; }
.ct-field textarea { resize: vertical; }
.case-tools :focus-visible { outline: 2px solid var(--stamp, #3a3fc0); outline-offset: 2px; }
.case-tools .ct-row { margin-block: .5rem 1rem; }
.ct-remove { margin-top: .8rem; }
.ct-remove:disabled { display: none; }
.ct-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-block: 1rem; }
.ct-status:empty { display: none; }
.ct-paper { overflow-x: auto; overflow-wrap: anywhere; padding: .25rem 0; }
.ct-paper p, .ct-paper td { white-space: pre-line; }
.ct-paper table { border-collapse: collapse; width: 100%; }
.ct-paper td, .ct-paper th { border: 1px solid var(--line, #d8d7dd); padding: .5rem; text-align: start; vertical-align: top; }
.ct-result { margin-block-start: 1.5rem; border-top: 1px solid var(--line, #d8d7dd); }
@media (max-width: 40rem) {
    .ct-panel fieldset { padding: .6rem; }
    .ct-paper table { min-width: 35rem; }
    .ct-actions .btn { width: 100%; justify-content: center; }
}
