.bw-workbench {
  overflow: hidden;
  padding: 0;
}
.bw-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 24px;
  padding: 22px 24px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(110deg, #f0f6f1, #f9fcfa);
}
.bw-header h2 { margin: 0 0 4px; color: var(--green-deep); font-size: 25px; }
.bw-header p { margin: 0; color: var(--muted); font-size: 14px; }
.bw-header-actions, .bw-dialog-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.bw-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 15px 24px 0;
}
.bw-filters { display: flex; flex-wrap: wrap; gap: 5px; }
.bw-filters button {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 7px 10px;
  font: inherit;
  cursor: pointer;
}
.bw-filters button:hover { background: var(--paper); }
.bw-filters button[aria-pressed="true"] {
  background: var(--green-soft);
  border-color: #cbded2;
  color: var(--green-deep);
  font-weight: 700;
}
.bw-search {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  color: var(--muted);
  font-size: 13px;
}
.bw-search span { flex: none; white-space: nowrap; }
.bw-search input, .bw-form input {
  min-width: 0;
  border: 1px solid #d7e2da;
  border-radius: 6px;
  background: #fff;
  padding: 8px 10px;
  color: var(--ink);
  font: inherit;
}
.bw-status { margin: 8px 24px 12px; color: var(--muted); font-size: 13px; }
#bwRetry { margin: 0 24px 12px; }
.bw-table-wrap { margin: 0 24px; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.bw-table, .bw-detail-table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.bw-table { table-layout: fixed; }
.bw-table th, .bw-table td { border-bottom: 1px solid var(--line); padding: 11px 10px; text-align: center; }
.bw-table thead th { padding-block: 6px; background: #f0f5f1; color: var(--ink); font-size: 13px; }
.bw-table thead th:first-child { width: 48%; text-align: left; padding-left: 15px; }
.bw-table tbody th { text-align: left; padding-left: 15px; font-weight: 400; }
.bw-table tbody tr:last-child > * { border-bottom: 0; }
.bw-table tbody tr:hover { background: #f7faf8; }
.bw-table thead button {
  color: inherit;
  font: inherit;
  font-weight: 600;
  border: 0;
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
  padding: 5px 8px;
  white-space: nowrap;
}
.bw-table thead button.is-selected { background: #daeae0; color: var(--green-deep); }
.bw-product-name {
  display: block;
  max-width: 100%;
  color: var(--green-deep);
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.bw-product-name:hover { text-decoration: underline; text-underline-offset: 3px; }
.bw-table small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.bw-table thead small { font-weight: 400; }
.bw-row-date { font-variant-numeric: tabular-nums; }
.bw-rate { font-size: 16px; color: var(--green-deep); }
.bw-missing, .bw-empty, .bw-note { color: var(--muted); }
.bw-star { color: #8c641b; }
.bw-table .bw-empty { text-align: center; padding: 28px 12px; }
.bw-notes { margin: 8px 24px 12px; }
.bw-workbench a, .bw-dialog a { color: var(--green-deep); text-underline-offset: 2px; }
.bw-workbench :is(button,input):focus-visible, .bw-dialog :is(button,input):focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.bw-dialog {
  width: min(630px, calc(100% - 24px));
  max-height: min(780px, calc(100% - 24px));
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  color: var(--ink);
  background: var(--card);
}
.bw-dialog::backdrop { background: #18312666; }
.bw-dialog > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bw-dialog > header .button { flex: none; white-space: nowrap; }
.bw-dialog h3 { margin: 0; overflow-wrap: anywhere; font-size: 20px; }
.bw-dialog h4 { margin: 14px 0 5px; font-size: 15px; }
.bw-dialog .bw-status { margin: 8px 0; }
.bw-dialog .bw-status:empty { display: none; }
.bw-dialog-actions { justify-content: flex-end; }
.bw-dialog > .bw-dialog-actions { margin: 12px 0; }
.bw-detail-source { display: flex; gap: 14px; align-items: center; color: var(--muted); font-size: 13px; }
.bw-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 12px; margin: 10px 0; border-radius: 8px; background: #f0f5f1; }
.bw-facts dt { color: var(--muted); font-size: 12px; }
.bw-facts dd { margin: 2px 0 0; overflow-wrap: anywhere; font-size: 14px; }
.bw-note { margin: 5px 0 10px; font-size: 13px; }
.bw-detail-table { margin: 5px 0 14px; font-size: 13px; }
.bw-detail-table th, .bw-detail-table td { border-bottom: 1px solid var(--line); padding: 6px; text-align: left; }
.bw-detail-table tbody th { font-weight: 500; }
.bw-nav-history { max-height: 246px; overflow: auto; }
.bw-nav-history:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.bw-nav-history thead { position: sticky; top: 0; background: var(--card); }
.bw-form:not([hidden]) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; margin-top: 14px; }
.bw-form[hidden] { display: none; }
.bw-nav-form { padding-top: 12px; border-top: 1px solid var(--line); }
.bw-form label { display: grid; gap: 4px; min-width: 0; font-size: 13px; }
.bw-form-wide { grid-column: 1 / -1; }
.bw-form p { margin: 0; color: var(--muted); font-size: 13px; }
@media (max-width: 640px) {
  .bw-header { padding: 16px 12px 13px; gap: 10px; }
  .bw-header h2 { font-size: 22px; }
  .bw-header p { font-size: 13px; }
  .bw-toolbar { padding: 8px 9px 0; gap: 6px; }
  .bw-filters { gap: 2px; }
  .bw-filters button { min-height: 40px; padding: 5px 7px; font-size: 13px; }
  .bw-search { width: 100%; gap: 6px; }
  .bw-search input { flex: 1; }
  .bw-status, .bw-notes { margin-inline: 10px; }
  .bw-table-wrap { margin-inline: 6px; }
  .bw-table thead th:first-child { width: 44%; padding-left: 7px; }
  .bw-table th, .bw-table td { padding: 8px 2px; }
  .bw-table tbody th { padding-left: 7px; }
  .bw-table thead button { font-size: 12px; min-height: 38px; padding: 2px 3px; }
  .bw-product-name, .bw-rate { font-size: 14px; }
  .bw-table small { font-size: 11px; }
  .bw-dialog { padding: 13px; }
  .bw-dialog h3 { font-size: 17px; }
  .bw-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
