.nd-workspace { width: 100%; color: var(--ink); }
.nd-workspace [hidden] { display: none !important; }
.nd-workspace .nd-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
.nd-settings, .nd-result { min-width: 0; background: #fff; border: 1px solid var(--line); }
.nd-settings { grid-column: 1; grid-row: 1; container-type: inline-size; }
.nd-workspace .nd-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 0 0 22px; padding: 8px; min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: #f5f8f8; }
.nd-workspace form .nd-mode { position: relative; cursor: pointer; display: block; }
.nd-mode input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
.nd-mode span { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px; border-radius: 4px; color: var(--muted); }
.nd-mode input:checked + span { background: #fff; color: var(--brand-brown); box-shadow: 0 1px 3px #0002; }
.nd-mode input:focus-visible + span { outline: 3px solid #0f766e; outline-offset: 2px; }
.nd-workspace textarea { width: 100%; min-width: 0; min-height: 160px; max-height: 500px; resize: vertical; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fbfdff; color: var(--ink); font: inherit; font-weight: 400; line-height: 1.7; }
.nd-workspace textarea:focus { outline: 2px solid #0f766e; outline-offset: 2px; }
.nd-workspace textarea::placeholder { color: #727b80; opacity: 1; }
#ndListHint, #ndListSummary { margin: 8px 0; }
.nd-result { grid-column: 2; grid-row: 1; min-height: 340px; position: relative; }
.nd-range-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.nd-workspace form label:not(.nd-check) { display: grid; gap: 8px; font-size: 14px; font-weight: 700; }
.nd-workspace input[type="text"] { width: 100%; min-width: 0; height: 48px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fbfdff; color: var(--ink); font: inherit; font-size: 20px; }
.nd-workspace input[type="text"]:focus { outline: 2px solid #0f766e; outline-offset: 2px; }
.nd-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; gap: 16px; margin-top: 22px; }
.nd-count-field { margin: 0; min-width: 0; }
.nd-selection { min-width: 0; }
.nd-selection #ndPoolStatus { margin: 8px 0 0; overflow-wrap: anywhere; }
.nd-check { display: flex; align-items: flex-start; gap: 10px; margin: 0; font-size: 14px; line-height: 1.6; }
.nd-check input { margin: 3px 0 0; }
.nd-check span { min-width: 0; overflow-wrap: anywhere; }
.nd-check input { width: 18px; height: 18px; flex: 0 0 18px; accent-color: var(--brand-brown); }
.nd-muted { color: var(--muted); font-size: 12px; line-height: 1.7; }
.nd-workspace .action-row { display: flex; flex-wrap: wrap; gap: 16px; }
.nd-actions { margin-top: 20px; }
.nd-actions button { min-width: 128px; }
.nd-result-actions { grid-column: 2; justify-content: flex-end; }
.nd-result .tool-result-signature { margin: 0 0 24px; }
.nd-result #ndEmpty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 60px 20px; margin: 0; border: 0; background: transparent; pointer-events: none; }
.nd-result-meta { margin: 0 0 20px; font-size: 14px; color: var(--muted); line-height: 1.8; }
.nd-numbers { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 96px), 1fr)); gap: 12px; list-style: none; margin: 0 0 24px; padding: 0; }
.nd-numbers li { display: flex; align-items: center; justify-content: center; min-height: 64px; padding: 12px 6px; border-bottom: 3px solid #e67e22; background: #f5f8f8; color: var(--brand-brown); font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.nd-numbers.nd-single { grid-template-columns: minmax(0, 1fr); }
.nd-numbers.nd-single li { min-height: 160px; background: transparent; border: 0; font-size: 64px; }
.nd-numbers li.nd-long { font-size: 20px; }
.nd-numbers.nd-single li.nd-long { font-size: 48px; }
.nd-numbers.nd-text-list { grid-template-columns: minmax(0, 1fr); }
.nd-numbers.nd-text-list li { justify-content: flex-start; text-align: left; font-size: 20px; line-height: 1.7; padding: 16px; white-space: pre-wrap; overflow-wrap: anywhere; word-break: normal; }
.nd-numbers.nd-single.nd-text-list li { min-height: 160px; font-size: 24px; }
.nd-history-values { white-space: pre-wrap; }
.nd-history { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 22px; }
.nd-history-heading, .nd-history-heading > div { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.nd-history-heading h2 { margin: 0; font-size: 20px; }
.nd-history-heading h2 i { margin-right: 8px; color: var(--accent); }
.nd-history-list { list-style: none; margin: 14px 0 0; padding: 0; }
.nd-history-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.nd-history-item p { margin: 6px 0; overflow-wrap: anywhere; line-height: 1.8; font-variant-numeric: tabular-nums; }
.nd-history-item strong { display: block; font-size: 14px; line-height: 1.8; }
.nd-history .icon-button { width: 36px; height: 36px; padding: 0; display: grid; place-items: center; border-radius: 8px; flex: 0 0 36px; }
.nd-history-item > .icon-button { align-self: start; justify-self: end; }
.nd-status { min-height: 21px; margin: 12px 0; font-size: 13px; color: #0f6258; line-height: 1.8; }
@media (max-width: 1100px) {
    .nd-workspace .nd-grid { grid-template-columns: minmax(0, 1fr); }
    .nd-settings, .nd-result, .nd-result-actions { grid-column: 1; grid-row: auto; }
}
@media (max-width: 380px) { .nd-actions button { min-width: 0; } .nd-range-fields { gap: 12px; } }
@container (max-width: 360px) { .nd-options { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) { .nd-options { grid-template-columns: minmax(0, 1fr); } }
