.lx-tool {
  box-sizing: border-box;
  margin-block: 2.25rem;
  padding: clamp(1rem, 3vw, 2rem);
  scroll-margin-top: 6rem;
  min-width: 0;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
}
.lx-tool [hidden] { display: none !important; }
.lx-tool-brand { display: flex; align-items: center; gap: .5rem; margin: 0 0 1rem; color: var(--brand-900); font-size: 1.45rem; letter-spacing: -.025em; }
.lx-tool .lx-tool-brand img { width: 1.38rem; height: 2rem; margin: 0; }
.lx-tool h2 { margin: 0 0 .5rem; font-size: clamp(1.45rem, 3vw, 2rem); line-height: 1.12; }
.lx-tool p { margin: 0 0 1rem; }
.lx-tool .lx-fields { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(10rem,100%),1fr)); gap: .75rem; }
.lx-tool label { display: grid; gap: .25rem; min-width: 0; font-weight: 700; font-size: .95rem; }
.lx-tool .lx-date { max-width: 15rem; }
.lx-tool input { font: inherit; font-weight: 400; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); box-sizing: border-box; min-height: 2.6rem; padding: .35rem .5rem; width: 100%; }
.lx-tool input[aria-invalid="true"] { border: 2px solid var(--sem-danger, var(--accent-strong)); }
.lx-tool :is(input,button,a,.lx-scroll):focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.lx-tool .lx-scroll { overflow-x: auto; max-width: 100%; margin: 1rem 0; }
.lx-tool table { display: table; border-collapse: collapse; width: 100%; margin: 0; font-size: .94rem; }
.lx-tool caption { text-align: left; padding: 0 0 .5rem; color: var(--ink-2); }
.lx-tool :is(td,th) { text-align: start; vertical-align: middle; border-bottom: 1px solid var(--line-strong); padding: .45rem .45rem .45rem 0; }
.lx-tool th { font-weight: 700; color: var(--ink); line-height: 1.25; }
.lx-tool td input { min-width: 6.2rem; }
.lx-tool td input[type=number] { min-width: 4.1rem; }
.lx-tool td input[inputmode=numeric][type=text] { min-width: 10rem; font-variant-numeric: tabular-nums; }
.lx-tool .lx-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.lx-tool .lx-actions :is(button,a) { display: inline-flex; align-items: center; font: inherit; font-size: .94rem; line-height: 1.25; border-radius: var(--radius-md); padding: .65rem .8rem; cursor: pointer; }
.lx-tool .lx-actions button { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); }
.lx-tool .lx-actions .lx-export { border-color: var(--accent-strong); background: var(--accent-strong); color: var(--n-100); }
.lx-tool .lx-actions a { color: var(--accent-ink); text-decoration: underline; }
.lx-tool .lx-actions button:disabled { opacity: .55; cursor: default; }
.lx-tool .lx-status:empty { margin: 0; }
.lx-tool .lx-status { font-weight: 700; }
.lx-tool .lx-note { font-size: .9rem; margin: .85rem 0 0; color: var(--ink-2); }
@media print {
  .lx-tool { color: black; background: white; margin: .5rem 0; padding: .5rem; }
  .lx-tool .lx-actions, .lx-tool .lx-note { display: none; }
  .lx-tool .lx-scroll { overflow: visible; }
  .lx-tool td input { min-width: 0; border: none; }
  .lx-tool tr { break-inside: avoid; }
}
[data-lx-print-copy] { display: none; }
@media print {
  body.lx-printing > :not([data-lx-print-copy]) { display: none !important; }
  body.lx-printing > [data-lx-print-copy] { display: block; border: none; padding: 0; margin: 0; }
  [data-lx-print-copy] :is(th,td,.lx-print-value) { overflow-wrap: anywhere; }
  [data-lx-print-copy] .lx-print-value { font-weight: 400; }
  [data-lx-print-copy] table { table-layout: fixed; }
}

.lx-tool .lx-stock-result { margin: 1rem 0 0; padding: .8rem 1rem; background: var(--accent-soft); border-radius: var(--radius-sm); color: var(--ink); font-weight: 700; }
