.nb-part { display: contents; }
.nb-part[hidden] { display: none; }

.dc-kinds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; min-width: 0; margin: 0 0 .5rem; padding: 0; border: 0; }
.dc-kinds[hidden] { display: none; }
.dc-kind { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: .375rem .625rem; padding: .625rem .75rem .75rem; background: var(--night); border: 1px solid var(--line2); border-radius: .75rem; cursor: pointer; overflow: hidden; }
.dc-kind input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
.dc-kind b { font-size: 1.0625rem; font-weight: 750; font-stretch: 112%; letter-spacing: .01em; }
.dc-kind > span { grid-column: 1 / -1; color: var(--muted); font-size: .8125rem; line-height: 1.4; }
.dc-kind:has(input:checked) { background: var(--raise); border-color: var(--brass-line); }
.dc-kind:has(input:checked) > span { color: var(--text); }
.dc-kind:has(input:checked)::after { content: ""; position: absolute; right: 0; bottom: 0; width: 1.5rem; height: 1.5rem; background: linear-gradient(135deg, transparent 50%, var(--brass-line) 50%); }
.dc-kind:has(input:checked)::before { content: ""; position: absolute; right: .25rem; bottom: .375rem; z-index: 1; width: .25rem; height: .5rem; border: solid var(--brass-ink); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.dc-kind:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.dc-kind.off { border-style: dashed; cursor: default; }
.dc-kind.off b, .dc-kind.off > span { color: var(--faint); }
.cab .dc-kind-why { display: none; grid-column: 1 / -1; color: var(--warn); font-size: .8125rem; font-weight: 600; line-height: 1.4; }
.dc-kinds.asked .dc-kind-why:not([hidden]) { display: block; }
.dc-pic { display: block; width: 2.75rem; height: 1.75rem; }
.dc-pic .p-buy { fill: var(--up); }
.dc-pic .p-sell { fill: none; stroke: var(--down); stroke-width: 2; }

.dc-ready { display: grid; gap: .375rem; margin-top: .125rem; }
.dc-ready .label { color: var(--muted); font-size: .875rem; font-weight: 600; }
.cab .dc-ready-note { margin-top: -.25rem; color: var(--muted); font-size: .8125rem; line-height: 1.4; }
.dc-presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .375rem; }
.cab .dc-preset { display: grid; justify-items: start; align-content: start; gap: 0; min-height: 0; padding: .4375rem .625rem .5rem; background: var(--raise); border: 1px solid transparent; border-radius: .625rem; color: var(--text); font-weight: 500; text-align: left; line-height: 1.35; }
.cab .dc-preset:hover { border-color: var(--line2); }
.dc-preset b { font-size: .9375rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.dc-preset span { color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.dc-preset small { display: block; width: 100%; margin-top: .375rem; padding-top: .3125rem; border-top: 1px solid var(--line2); color: var(--muted); font-size: .75rem; font-weight: 500; line-height: 1.3; }
.cab .dc-preset[aria-pressed="true"] { background: var(--brass-t); border-color: var(--brass-line); }
.cab .dc-preset[aria-pressed="true"] span, .cab .dc-preset[aria-pressed="true"] small { color: var(--text); }
.cab .dc-preset[aria-pressed="true"] small { border-top-color: var(--brass-line); }

.cab .dc-need { margin-top: 0; }
.dc-need[hidden] { display: none; }
.cab .dc-need.short > span:first-child { color: var(--warn); font-weight: 600; }
#dca-part .field .hint { margin-top: .125rem; color: var(--muted); font-size: .8125rem; line-height: 1.35; }
#dca-part .nb-tiles .input .unit:first-child { min-width: .625rem; }

.dc-nosl { padding: .625rem .75rem .6875rem; background: transparent; border: 1px dashed var(--line2); border-radius: .625rem; }
.dc-nosl .field-head { display: flex; align-items: center; gap: .5rem; }
.nb-panel .dc-nosl .field-head > .label { color: var(--text); font-size: .9375rem; }
.dc-none { margin-left: auto; padding: .0625rem .5rem; border-radius: 999px; background: var(--warn-t); color: var(--warn); font-size: .8125rem; font-weight: 700; }
.cab .dc-nosl .hint { margin-top: .25rem; font-size: .8125rem; line-height: 1.4; }

.dc-keep > .field.off { display: grid; gap: .5rem; }
.dc-keep .field.off:has(.switch:not(:checked)) .dc-keep-body { display: none; }
.dc-keep .field.off:has(.switch:checked) .dc-keep-off { display: none; }
.cab .dc-keep .hint { margin-top: 0; }
.dc-keep-body { display: grid; gap: .625rem; }
.dc-keep-top { display: grid; gap: .125rem; }
.dc-keep-top:empty { display: none; }
.dc-keep .nb-tiles > .field { background: var(--panel); border-color: var(--line2); }
.dc-keep .nb-tiles .input { background: transparent; border: 0; }
.dc-keep .nb-tiles .opt .input { flex: 1 1 2rem; }
.dc-keep-when { display: grid; gap: .375rem; }
.nb-panel .dc-keep-when .field-head > .label { color: var(--muted); font-size: .875rem; font-weight: 600; }
.cab .dc-keep-when .chips { display: grid; grid-template-columns: 1fr 1fr; gap: .375rem; margin: 0; }
.cab .dc-keep-when .chips label { justify-content: center; min-height: 2.25rem; padding: .25rem .375rem; border-radius: .5rem; font-size: .9375rem; }
.cab .dc-keep .chips input:checked + label { background: var(--brass-t); border-color: var(--brass-line); color: var(--text); }
.dc-keep-out { display: grid; gap: .375rem; padding-top: .625rem; border-top: 1px solid var(--line2); }
.dc-keep-out .dc-split { font-size: 1rem; }
.dc-keep-out .dc-split:empty { display: none; }
.dc-keep-out .dc-tok { width: 1rem; height: 1rem; }

.dc-tok { display: inline-block; flex: none; width: .75rem; height: .75rem; font-style: normal; vertical-align: -.0625rem; box-sizing: border-box; }
.dc-tok.sold { border: 2px solid var(--down); border-radius: 50%; }
.dc-tok.kept { background: var(--lot-t); border: 2px solid var(--lot); border-radius: .1875rem; }
.dc-toks { display: inline-flex; flex: none; gap: .25rem; }
.dc-split { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem .625rem; }
.dc-split b { font-weight: 700; font-variant-numeric: tabular-nums; }
.dc-kn { display: inline-flex; align-items: center; gap: .3125rem; color: var(--lot); font-weight: 650; }
.dc-table .dc-k0 { color: var(--faint); }

.dc-plan { flex: none; min-width: 0; padding: .75rem 1rem .875rem; background: var(--panel); border: 1px solid var(--line); border-radius: .75rem; }
.dc-plan[hidden] { display: none; }
.dc-plan-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .125rem 1rem; }
.cab .dc-plan h2 { margin: 0; font-size: 1.0625rem; font-weight: 700; }
.cab .dc-from { color: var(--muted); font-size: .8125rem; }
.cab .dc-lead { margin-top: .375rem; font-size: 1rem; font-weight: 650; }
.dc-plan-body { display: grid; grid-template-columns: minmax(0, 1fr) 15.5rem; gap: 1.25rem; margin-top: .375rem; }
.dc-tablewrap { min-width: 0; overflow-x: auto; }
.dc-sum { display: grid; align-content: start; gap: .5rem; padding-top: .375rem; font-size: .9375rem; line-height: 1.45; }
.dc-sum b { font-variant-numeric: tabular-nums; }
.cab .dc-sum .warn { color: var(--warn); font-weight: 600; }
.dc-sum .dc-split { align-items: flex-start; }
.dc-sum .dc-split .dc-toks { margin-top: .3125rem; }
.cab .dc-nostop { padding: .5rem .75rem; background: var(--warn-t); border-left: 3px solid var(--warn); border-radius: .375rem; color: var(--warn-ink); font-size: .875rem; font-weight: 600; line-height: 1.45; }
.cab .dc-how { margin-top: .5rem; color: var(--muted); font-size: .8125rem; line-height: 1.45; }
.cab .dc-empty { margin-top: .5rem; padding: 1rem; border: 1px dashed var(--line2); border-radius: .625rem; color: var(--muted); font-size: .9375rem; text-align: center; }

.dc-table { font-size: .9375rem; }
.dc-table th, .dc-table td { padding-right: .75rem; white-space: nowrap; }
.dc-table th:last-child, .dc-table td:last-child { padding-right: 0; }
.dc-table .n { text-align: right; font-variant-numeric: tabular-nums; }
.dc-table td { padding-top: .4375rem; padding-bottom: .4375rem; }
.dc-table td:first-child { font-weight: 650; padding-left: .5rem; }
.dc-table th:first-child { padding-left: .5rem; }
.dc-table tr.later td, .dc-table tr.later td:first-child { color: var(--muted); }
.dc-table .t-later { display: inline-block; margin-left: .375rem; padding: 0 .375rem; border: 1px dashed var(--line2); border-radius: 999px; color: var(--muted); font-size: .75rem; font-weight: 650; vertical-align: .0625rem; }
.dc-st { display: none; }

.dc-risks { padding: .75rem .875rem .8125rem; background: var(--raise); border-left: 4px solid var(--warn); border-radius: .5rem; }
.cab .dc-risks h2 { margin: 0 0 .5rem; color: var(--warn); font-size: .9375rem; font-weight: 700; }
.dc-risks ul { display: grid; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.dc-risks li { display: grid; grid-template-columns: 1.125rem minmax(0, 1fr); gap: .625rem; align-items: start; font-size: .9375rem; line-height: 1.4; }
.dc-risks li b { font-weight: 700; }
.dc-risks svg { width: 1.125rem; height: 1.125rem; margin-top: .0625rem; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dc-risks .r-warn svg { stroke: var(--warn); }
.dc-risks .r-out { color: var(--muted); }
.dc-risks .r-out svg { stroke: var(--muted); }
.dc-risks .r-kept .dc-tok { width: .875rem; height: .875rem; margin: .1875rem 0 0 .125rem; }
dialog.bw .dc-risks { margin-top: .75rem; }

.key-dfirst { width: 1.25rem; border-top: 3px solid var(--up); }
.key-dadd { width: 1.25rem; border-top: 2px solid var(--up); }

@media (min-width: 1024px) {
  .nb.is-dca { grid-template-rows: minmax(0, 1fr) auto; }
  .nb.is-dca > .nb-chart { grid-column: 1; grid-row: 1; }
  .nb.is-dca > .dc-plan { grid-column: 1; grid-row: 2; max-height: 45vh; overflow-y: auto; }
  .nb.is-dca > .nb-panel { grid-column: 2; grid-row: 1 / span 2; }
  .nb.is-dca .nb-chart-wrap { min-height: 12rem; }
}

@media (max-width: 1023px) {
  .dc-plan-slot > .dc-plan { margin-top: .5rem; }
  .dc-plan-body { grid-template-columns: minmax(0, 1fr); gap: .5rem; }
}

@media (max-width: 600px) {
  .dc-kinds .dc-kind-why:not([hidden]) { display: block; }
  .dc-kind { padding: .625rem .625rem .75rem; }
  .dc-presets { gap: .3125rem; }
  .cab .dc-preset { padding: .4375rem .5rem .5rem; }
  .cab .dc-preset small { font-size: .6875rem; }
  .dc-plan-slot > .dc-plan { padding: .75rem .75rem .875rem; }
  .dc-table { font-size: .875rem; }
  .dc-table th, .dc-table td { padding-right: .5rem; }
  .dc-table td:first-child, .dc-table th:first-child { padding-left: .375rem; }
  .dc-c-avg, .dc-c-sh, .dc-table .t-later { display: none; }
  .dc-table td:first-child { white-space: normal; }
  .dc-st { display: block; margin-top: .125rem; font-size: .75rem; font-weight: 500; color: var(--muted); line-height: 1.3; }
  .dc-keeps .dc-c-kp { padding-right: .375rem; }
  .dc-keep .nb-tiles { grid-template-columns: minmax(0, 1fr); }
}
