:root {
  --bg: #eaf5ff;
  --panel: #eaf5ff;
  --panel-soft: #f6fbff;
  --text: #042964;
  --muted: #335e86;
  --line: #9fc7ec;
  --brand: #0d94f4;
  --brand-strong: #042964;
  --brand-soft: #d8efff;
  --danger: #bf2f2f;
  --warning: #a56500;
  --ok: #197147;
  --knx-ice: #eaf5ff;
  --knx-green: #91c61a;
  --knx-green-text: #5f8f0a;
}

* {
  box-sizing: border-box;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', 'Inter', 'Trebuchet MS', 'Verdana', 'Helvetica Neue', Arial, sans-serif;
  overflow-x: auto;
}

.app-shell {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 14px clamp(10px, 1.2vw, 22px);
}

.app-shell.blocked {
  filter: blur(0.8px);
  pointer-events: none;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--panel);
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 10px 16px;
  box-shadow: none;
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-logo {
  display: block;
  width: clamp(190px, 24vw, 330px);
  flex: 0 0 auto;
}

.brand-logo img {
  display: block;
  width: 100%;
  height: auto;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(1.45rem, 2vw, 2.15rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0;
  color: var(--brand-strong);
}

.topbar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pill {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--brand-soft);
  color: var(--brand-strong);
  padding: 6px 12px;
  font-weight: 700;
  font-size: 0.9rem;
}

.text-link {
  background: transparent;
  border: none;
  color: var(--brand-strong);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  padding: 0;
  font: inherit;
}

.toolbar {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.toolbar-stats {
  display: flex;
  align-items: baseline;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 1.08rem;
}

.toolbar-stats strong {
  color: var(--brand-strong);
  margin-right: 5px;
  font-size: 1.55rem;
  line-height: 1;
}

.toolbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.tabs {
  margin-top: 10px;
  display: inline-flex;
  max-width: 100%;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px;
  background: var(--panel);
  overflow-x: auto;
}

.tabs button {
  flex: 0 0 auto;
  border: 0;
  border-radius: 6px;
  padding: 8px 14px;
  background: transparent;
  color: var(--brand-strong);
  cursor: pointer;
}

.tabs button[disabled] {
  opacity: 0.4;
  cursor: default;
}

.tabs button.active {
  background: var(--brand-strong);
  color: #fff;
  box-shadow: none;
}

main {
  margin-top: 10px;
}

.site-footer {
  margin-top: 18px;
  padding: 12px 0 4px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.site-footer p {
  max-width: 980px;
  margin: 0;
}

.site-footer-meta {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
  font-size: 0.76rem;
}

.version-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.version-link:hover {
  color: var(--brand-strong);
}

[hidden] {
  display: none !important;
}

.search-row {
  margin-bottom: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.search-row input,
.search-row select,
.settingsGrid input,
.settingsGrid textarea,
.loginCard input,
button {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 11px;
  min-height: 38px;
  font: inherit;
  color: var(--text);
  background: var(--panel-soft);
}

.search-row input {
  min-width: 260px;
  flex: 0 1 520px;
  max-width: min(100%, 560px);
}

.search-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--muted);
}

.advanced-search-panel {
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid #b9d7ef;
  border-radius: 8px;
  background: var(--brand-soft);
}

.advanced-search-fields {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) auto minmax(130px, 1fr) auto minmax(130px, 1fr) auto minmax(130px, 1fr) auto minmax(130px, 1fr) auto minmax(150px, 1.1fr);
  gap: 8px;
  align-items: end;
}

.advanced-search-field {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
}

.advanced-search-field input {
  min-width: 0;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.advanced-search-join {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 38px;
  padding-bottom: 1px;
  color: var(--brand-strong);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.advanced-search-join input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--brand-strong);
}

.advanced-search-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  font-size: 0.82rem;
}

@media (max-width: 1280px) {
  .advanced-search-fields {
    display: flex;
    align-items: end;
  }

  .advanced-search-join {
    display: inline-flex;
    flex: 0 0 auto;
  }

  .advanced-search-field {
    flex: 1 1 170px;
  }

  .advanced-search-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 700px) {
  .advanced-search-fields {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }
}

button {
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  border: 0;
}

button.secondary {
  background: var(--brand-soft);
  color: var(--brand-strong);
  border: 1px solid var(--line);
}

button.danger-button {
  background: #b63d3d;
  color: #fff;
}

button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.tableWrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
  background: var(--panel);
  max-height: calc(100vh - 230px);
  width: 100%;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
  table-layout: fixed;
}

.files-table {
  width: 100%;
  min-width: 100%;
  table-layout: auto;
}

.apps-table {
  width: 100%;
  min-width: 100%;
  table-layout: auto;
}

.apps-table > thead > tr > th,
.apps-table > thead > tr > th.col-fixed {
  min-width: max-content;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.apps-table > tbody > tr > td {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
}

.apps-table > tbody > tr > td.col-download {
  width: 20rem;
  max-width: 24rem;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: anywhere;
}

/* Let the descriptive columns grow from their actual content like the file
 * table. The final download column remains the deliberate truncation point. */
.apps-table th.col-manufacturer,
.apps-table td.col-manufacturer,
.apps-table th.col-program,
.apps-table td.col-program,
.apps-table th.col-version,
.apps-table td.col-version,
.apps-table th.col-mask,
.apps-table td.col-mask,
.apps-table th.col-name,
.apps-table td.col-name,
.apps-table th.col-etsapp,
.apps-table td.col-etsapp,
.apps-table th.col-order,
.apps-table td.col-order {
  width: auto;
  max-width: none;
}

.ets-apps-table {
  min-width: 1080px;
  table-layout: fixed;
}

.ets-apps-table th,
.ets-apps-table td {
  white-space: normal;
}

.ets-apps-table .col-id {
  width: 5ch;
}

.ets-apps-table .col-manufacturer {
  width: 14ch;
  min-width: 11ch;
}

.ets-apps-table .col-name {
  width: 24ch;
  min-width: 16ch;
}

.ets-apps-table .col-version {
  width: 14ch;
  min-width: 10ch;
}

.ets-apps-table .col-app-id {
  width: 16ch;
  min-width: 10ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ets-apps-table .col-file {
  width: 27ch;
  min-width: 18ch;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ets-apps-table .col-bindings {
  width: 34ch;
  min-width: 16ch;
  line-height: 1.35;
  overflow: hidden;
}

.ets-apps-table.ets-apps-table > thead > tr > th.col-bindings {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.1;
}

.ets-apps-header-wrap {
  display: inline-block;
  white-space: normal;
}

.ets-apps-table .col-status {
  width: 8ch;
  min-width: 7ch;
  white-space: nowrap;
}

.ets-apps-table .col-size {
  width: 11ch;
  min-width: 9ch;
  white-space: nowrap;
  text-align: right;
}

.ets-app-older-row[hidden] {
  display: none;
}

.ets-app-stripe-blue > * {
  background: var(--panel);
}

.ets-app-stripe-white > * {
  background: var(--panel-soft);
}

.ets-app-focus > * {
  background: #d9f2ff !important;
  box-shadow: inset 0 2px 0 #008c95, inset 0 -2px 0 #008c95;
}

.data-table.ets-apps-table th,
.data-table.ets-apps-table td {
  border-right: 1px solid #9dbddb;
}

.data-table.ets-apps-table tbody td:last-child {
  border-right: 1px solid #9dbddb;
}

/* Keep the ETSApps header identical to the working settings/user table:
 * the normal table border is the separator and the resize handle supplies
 * the same short draggable guide. */
.data-table.ets-apps-table > thead > tr > th {
  text-align: center;
  vertical-align: middle;
  border-right: 1px solid #9dbddb;
}

.data-table.ets-apps-table > thead > tr > th:last-child {
  border-right: 0;
}

/* These columns intentionally clip their body text. On the header cells that
 * would also clip the resize handle, which is the short visible separator.
 * Keep the header overflow visible; the body cells retain their truncation. */
.data-table.ets-apps-table > thead > tr > th {
  overflow: visible;
  text-overflow: clip;
}

.ets-bindings-cell {
  min-width: 0;
}

.ets-binding-preview,
.ets-binding-extra {
  overflow-wrap: anywhere;
}

.ets-inline-toggle {
  display: inline;
  width: auto;
  min-height: 0;
  margin: 0 0 0 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand-strong);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ets-inline-toggle:hover {
  color: var(--knx-green-text);
}

.ets-binding-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--knx-green-text);
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ets-binding-link:hover {
  color: var(--brand-strong);
}

.ets-version-toggle {
  vertical-align: baseline;
}

.scan-errors-table {
  min-width: 960px;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid #c8def3;
  border-right: 1px solid #c8def3;
  text-align: left;
  padding: 8px 8px;
  vertical-align: top;
  font-size: 0.88rem;
}

.data-table thead {
  position: sticky;
  top: 0;
  background: var(--brand-soft);
}

.data-table th {
  position: relative;
  font-weight: 700;
  color: var(--brand-strong);
  user-select: none;
}

/* Resize handles belong to the header, not to the clipped body content.
 * Keep every header cell overflow-visible so the short separator remains
 * complete in Files and Application Programs as well as ETSApps. */
.data-table > thead > tr > th {
  overflow: visible;
  text-overflow: clip;
}

.data-table thead th {
  border-right: 1px solid #9dbddb;
}

.data-table thead th:last-child {
  border-right: 0;
}

.data-table tbody td:last-child {
  border-right: 0;
}

.data-table td {
  color: var(--text);
  white-space: nowrap;
}

.scan-status {
  margin-top: 6px;
}

.data-table th.col-id,
.data-table td.col-id {
  width: 5ch;
  text-align: right;
}

.data-table th.col-manufacturer,
.data-table td.col-manufacturer {
  width: 18ch;
}

.data-table th.col-program,
.data-table td.col-program {
  width: 7ch;
}

.data-table th.col-version,
.data-table td.col-version {
  width: 6ch;
}

.data-table th.col-mask,
.data-table td.col-mask {
  width: 7ch;
}

.data-table th.col-fixed,
.data-table td.col-fixed {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.col-resizer {
  position: absolute;
  top: 0;
  right: -4px;
  z-index: 2;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
}

.col-resizer::after {
  content: '';
  position: absolute;
  top: 8px;
  right: 3px;
  width: 1px;
  height: calc(100% - 16px);
  background: #79b8ed;
}

.column-resizing {
  cursor: col-resize;
  user-select: none;
}

.data-table .col-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table .col-order {
  width: 20ch;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table .col-file,
.data-table .file-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table .col-path {
  width: 34%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table .col-error-text {
  width: 44%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.files-table .col-name {
  width: auto;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

.files-table .col-file {
  width: 20rem;
  max-width: 24rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.files-table .col-size {
  width: 11ch;
  min-width: 11ch;
  text-align: right;
  white-space: nowrap;
}

.files-table .col-manufacturer,
.files-table .col-program,
.files-table .col-version,
.files-table .col-mask {
  width: auto;
}

.files-table .col-order {
  width: auto;
  min-width: 16ch;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

.files-table .file-program-summary-cell {
  min-width: 68ch;
  white-space: normal;
}

.data-table .col-files {
  width: 9ch;
  text-align: right;
}

.data-table .col-download {
  width: 24ch;
  text-align: left;
  white-space: normal;
}

.data-table .col-flags {
  width: 14ch;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Use the same header behavior as the settings/user table. The visible
 * separator is the short resize guide, not a second full-height border. */
.files-table.files-table > thead > tr > th,
.apps-table.apps-table > thead > tr > th,
.ets-apps-table.ets-apps-table > thead > tr > th {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.files-table.files-table > thead > tr > th .col-resizer::after,
.apps-table.apps-table > thead > tr > th .col-resizer::after,
.ets-apps-table.ets-apps-table > thead > tr > th .col-resizer::after {
  display: block;
}

.file-link {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.download-cell {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.download-count {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.2;
}

.download-list {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.download-link {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.download-cell.expanded .download-link {
  white-space: normal;
  overflow-wrap: anywhere;
}

.download-more {
  justify-self: start;
  min-height: 24px;
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  border: 1px solid var(--line);
  font-size: 0.78rem;
  font-weight: 700;
}

.file-program-toggle {
  min-height: 24px;
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  border: 1px solid var(--line);
  font: inherit;
  font-weight: 700;
  white-space: nowrap;
}

.file-program-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  flex-wrap: nowrap;
  min-width: 0;
}

.file-program-summary strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
}

.file-program-toggle,
.file-program-open {
  min-height: 18px;
  height: 18px;
  padding: 1px 6px;
  font-size: 0.78rem;
  line-height: 1;
  white-space: nowrap;
}

.file-program-stripe-blue td {
  background: var(--brand-soft);
}

.file-program-stripe-white td {
  background: #fff;
}

.file-program-separator-row td {
  height: 34px;
  padding-top: 8px;
  padding-bottom: 8px;
  white-space: nowrap;
}

.file-program-separator-action {
  text-align: right;
}

.file-program-spacer-row td {
  height: 34px;
  padding: 0 8px;
  border-bottom: 1px solid #c8def3;
}

.file-program-detail-row .col-id,
.file-program-detail-row .col-program,
.file-program-detail-row .col-version,
.file-program-detail-row .col-mask {
  white-space: nowrap;
}

.file-program-detail-row .col-name,
.file-program-detail-row .col-order {
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
}

.data-table tr:nth-child(even) {
  background: var(--panel-soft);
}

.data-table td:nth-child(3) {
  color: var(--brand-strong);
}

.mono {
  font-family: 'JetBrains Mono', 'Consolas', 'Courier New', monospace;
}

.muted {
  color: var(--muted);
}

.error {
  color: var(--danger);
}

.ok {
  color: var(--ok);
}

.warning {
  color: var(--warning);
}

.table-link {
  color: var(--brand);
  text-decoration: none;
}

.file-link,
.download-link.table-link {
  color: var(--knx-green-text);
  font-weight: 700;
}

.table-link:hover {
  text-decoration: underline;
}

.file-cell-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.file-cell-actions > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-data-open {
  flex: 0 0 auto;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 0.76rem;
  font-weight: 700;
}

.product-viewer {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.product-data-content {
  display: grid;
  gap: 12px;
  min-width: 0;
}

#productDataMeta {
  overflow-wrap: anywhere;
}

.product-summary {
  display: grid;
  grid-template-columns: repeat(7, minmax(110px, 1fr));
  gap: 10px;
}

.product-summary > div,
.product-summary > button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 10px;
}

.product-summary > button {
  color: var(--text);
  font: inherit;
  text-align: left;
}

.product-summary > button:hover,
.product-summary > button:focus-visible,
.product-summary > button.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  outline: none;
}

.product-summary strong,
.product-summary span,
.product-summary small {
  display: block;
}

.product-summary strong {
  color: var(--brand-strong);
  font-size: 1.25rem;
}

.product-summary small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
}

.product-attachments-window {
  display: grid;
  gap: 10px;
  width: min(820px, 100%);
  max-height: min(88vh, 820px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
  box-shadow: 0 24px 80px rgba(4, 41, 100, 0.28);
}

.product-attachments-window h3 {
  margin: 0;
  color: var(--brand-strong);
}

.product-attachments-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 41, 100, 0.42);
}

.product-attachments-upload {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.product-attachments-upload input {
  min-width: 240px;
  flex: 1 1 260px;
}

.product-attachments-list {
  display: grid;
  gap: 7px;
}

.product-attachment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  padding: 8px 10px;
}

.product-attachment-row > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.product-attachment-actions {
  display: flex !important;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.product-attachment-row small {
  color: var(--muted);
}

.product-attachment-download {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 6px;
  color: var(--brand-strong);
  font-weight: 700;
  text-decoration: none;
}

.product-attachment-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 8px;
}

.product-attachment-card .product-attachment-row {
  border: 0;
  background: transparent;
  padding: 2px;
}

.product-attachment-contents {
  border-top: 1px solid var(--line);
  padding: 8px 4px 2px;
}

.product-attachment-contents ul {
  display: grid;
  gap: 4px;
  max-height: 230px;
  overflow: auto;
  margin: 7px 0 0;
  padding: 0;
  list-style: none;
}

.product-attachment-content-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 7px;
  border-radius: 5px;
  background: var(--panel);
}

.product-attachment-content-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.product-attachment-content-row small {
  flex: 0 0 auto;
  color: var(--muted);
}

.product-warning {
  border: 1px solid #dfbf6a;
  border-radius: 8px;
  background: #fff9e8;
  color: var(--warning);
  padding: 10px;
}

.product-section {
  display: grid;
  gap: 8px;
}

.product-section h3 {
  margin: 0;
  color: var(--brand-strong);
  font-size: 1rem;
}

.product-app-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 0;
  overflow: hidden;
}

.product-app-card summary {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  cursor: pointer;
  background: var(--brand-soft);
}

.product-app-card summary span,
.product-app-card summary small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-app-card[open] {
  padding-bottom: 12px;
}

.product-app-card[open] > .product-section,
.product-app-card[open] > .product-app-meta {
  margin: 10px 12px 0;
}

.product-app-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.84rem;
}

.product-app-meta code {
  color: var(--text);
}

.product-table-wrap {
  max-height: 430px;
}

.product-data-table {
  min-width: 1120px;
  table-layout: fixed;
}

.product-data-table td {
  white-space: normal;
  overflow-wrap: anywhere;
}

.product-database-browser {
  display: grid;
  grid-template-columns: clamp(220px, var(--product-catalog-width, 310px), calc(100% - 440px)) 8px minmax(0, 1fr);
  min-height: 620px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.product-database-catalog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  background: var(--panel-soft);
}

.product-database-catalog > header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px;
  align-items: center;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--brand-soft);
}

.product-database-catalog-heading {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.product-database-catalog-heading strong {
  overflow-wrap: anywhere;
  color: var(--brand-strong);
}

.product-database-catalog-heading > span {
  color: var(--muted);
  font-size: 0.8rem;
}

.product-pane-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 32px;
  padding: 5px 9px;
  white-space: nowrap;
}

.product-pane-toggle [data-product-pane-toggle-icon] {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 0.8;
}

.product-catalog-toggle {
  width: 32px;
  min-width: 32px;
  padding: 4px;
}

.product-pane-splitter {
  position: relative;
  z-index: 3;
  min-width: 0;
  cursor: col-resize;
  touch-action: none;
  background: #e8f2fb;
  box-shadow: inset 1px 0 0 var(--line), inset -1px 0 0 var(--line);
}

.product-pane-splitter::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3px;
  height: 38px;
  border-radius: 999px;
  background: #77a9d2;
  transform: translate(-50%, -50%);
}

.product-pane-splitter:hover,
.product-pane-splitter:focus,
.product-pane-splitter.dragging {
  outline: none;
  background: #cfe7fa;
}

.product-pane-splitter:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(13, 148, 244, 0.65);
}

.product-pane-resizing,
.product-pane-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

.product-database-browser.catalog-collapsed {
  grid-template-columns: 44px 0 minmax(0, 1fr);
}

.catalog-collapsed .product-database-catalog {
  display: block;
}

.catalog-collapsed .product-database-catalog > header {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  height: 100%;
  padding: 6px;
  border-bottom: 0;
}

.catalog-collapsed .product-database-catalog-heading,
.catalog-collapsed .product-database-list {
  display: none;
}

.catalog-collapsed .product-catalog-splitter {
  visibility: hidden;
  pointer-events: none;
}

.product-database-list {
  max-height: 780px;
  overflow: auto;
}

.product-database-item {
  display: grid;
  width: 100%;
  gap: 3px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
}

.product-database-item:hover,
.product-database-item:focus {
  background: #fff;
  outline: none;
}

.product-database-item.active {
  padding-left: 8px;
  border-left: 4px solid var(--knx-green);
  background: #fff;
}

.product-database-item strong {
  color: var(--brand-strong);
  font-size: 0.9rem;
}

.product-database-item span,
.product-database-item small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-database-item span {
  font-weight: 700;
}

.product-database-item small {
  color: var(--muted);
  font-size: 0.76rem;
}

.product-database-detail {
  min-width: 0;
  padding: 12px;
  overflow: hidden;
}

.product-device-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 0.55fr);
  gap: 16px;
  align-items: center;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--line);
}

.product-device-head h3 {
  margin: 3px 0 6px;
  color: var(--brand-strong);
  font-size: 1.1rem;
}

.product-device-head p {
  display: flex;
  gap: 8px 12px;
  align-items: baseline;
  flex-wrap: wrap;
  margin: 0;
  color: var(--muted);
}

.product-device-head p strong {
  color: var(--text);
}

.product-device-kicker {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
}

.product-device-program {
  display: grid;
  gap: 3px;
  padding-left: 14px;
  border-left: 3px solid var(--knx-green);
}

.product-device-program strong {
  color: var(--brand-strong);
}

.product-device-program span,
.product-device-program small {
  color: var(--muted);
  font-size: 0.78rem;
}

.product-selected-app-meta {
  align-items: center;
  padding: 10px 0;
}

.product-language-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.product-language-control select {
  width: auto;
  min-width: 180px;
  min-height: 32px;
  padding: 5px 28px 5px 8px;
  border-radius: 5px;
  background: #fff;
  color: var(--text);
}

.product-database-detail > .product-ets-view {
  margin: 0;
}

.product-parameters-table th:nth-child(2),
.product-parameters-table td:nth-child(2) {
  width: 22%;
}

.product-parameters-table th:nth-child(6),
.product-parameters-table td:nth-child(6) {
  width: 22%;
}

.product-comobjects-table th:nth-child(3),
.product-comobjects-table td:nth-child(3) {
  width: 25%;
}

.product-ets-view {
  margin: 12px;
  padding: 0;
}

.product-ets-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.product-ets-mode {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid #8bb9df;
  border-radius: 5px;
  background: #fff;
}

.product-ets-mode button {
  min-height: 31px;
  padding: 5px 10px;
  border: 0;
  border-right: 1px solid #8bb9df;
  border-radius: 0;
  background: #fff;
  color: var(--brand-strong);
  font-weight: 800;
}

.product-ets-mode button:last-child {
  border-right: 0;
}

.product-ets-mode button:hover,
.product-ets-mode button:focus {
  background: var(--brand-soft);
  outline: none;
}

.product-ets-mode button.active {
  background: var(--brand-strong);
  color: #fff;
}

.product-ets-shell {
  display: grid;
  grid-template-columns: clamp(180px, var(--product-ets-tree-width, 240px), calc(100% - 360px)) 8px minmax(0, 1fr);
  height: clamp(540px, calc(100vh - 285px), 760px);
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.product-ets-tree {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 8px;
  background: var(--panel-soft);
}

.product-ets-shell.tree-collapsed {
  grid-template-columns: 0 0 minmax(0, 1fr);
}

.tree-collapsed .product-ets-tree {
  visibility: hidden;
  pointer-events: none;
}

.tree-collapsed .product-ets-splitter {
  visibility: hidden;
  pointer-events: none;
}

.product-ets-nav-item {
  display: grid;
  flex: 0 0 auto;
  width: 100%;
  gap: 2px;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--brand-strong);
  font: inherit;
  text-align: left;
  text-decoration: none;
}

.product-ets-nav-item:hover,
.product-ets-nav-item:focus {
  border-color: var(--line);
  background: var(--brand-soft);
  outline: none;
}

.product-ets-nav-item.active {
  border-color: #a8c9e7;
  background: #fff;
  box-shadow: inset 3px 0 0 var(--knx-green);
}

.product-ets-nav-item strong,
.product-ets-nav-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-ets-nav-item strong {
  line-height: 1.25;
  overflow-wrap: anywhere;
  white-space: normal;
}

.product-ets-nav-item span {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.product-ets-pages {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 10px;
  background: #fff;
}

.product-ets-page {
  border: 1px solid #c8def3;
  border-radius: 6px;
  overflow: hidden;
  background: var(--panel-soft);
  scroll-margin-top: 10px;
}

.product-ets-page > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid #c8def3;
  background: var(--knx-ice);
}

.product-ets-page h4 {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  color: var(--brand-strong);
  font-size: 0.98rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-ets-page > header span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.82rem;
}

.product-ets-rows {
  display: grid;
}

.product-ets-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.25fr) minmax(150px, 0.85fr) minmax(100px, 0.55fr) minmax(95px, 0.5fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 58px;
  padding: 8px 10px;
  border-bottom: 1px solid #dbeafa;
  background: #fff;
}

.product-ets-row:last-child {
  border-bottom: 0;
}

.product-ets-row.changed {
  background: #fbfff1;
  box-shadow: inset 4px 0 0 var(--knx-green);
}

.product-ets-param-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.product-ets-param-main label {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-weight: 700;
  line-height: 1.25;
}

.product-ets-param-main small,
.product-ets-value small,
.product-ets-default span {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.25;
}

.product-ets-param-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-ets-control input,
.product-ets-control select {
  width: 100%;
  min-height: 34px;
  border-radius: 4px;
  background: #fff;
}

.product-ets-switch {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
}

.product-ets-switch input {
  width: 0;
  height: 0;
  opacity: 0;
  position: absolute;
}

.product-ets-switch span {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #d7e4ef;
}

.product-ets-switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(4, 41, 100, 0.25);
  transition: transform 120ms ease;
}

.product-ets-switch input:checked + span {
  border-color: var(--knx-green-text);
  background: var(--knx-green);
}

.product-ets-switch input:checked + span::after {
  transform: translateX(22px);
}

.product-ets-switch input:focus + span {
  outline: 2px solid rgba(13, 148, 244, 0.35);
  outline-offset: 2px;
}

.product-ets-value,
.product-ets-default {
  display: grid;
  gap: 3px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.product-ets-value span {
  color: var(--brand-strong);
  font-weight: 700;
}

.product-ets-default code {
  color: var(--text);
  font-size: 0.82rem;
  white-space: normal;
}

.product-ets-reset {
  min-height: 30px;
  padding: 5px 8px;
  border-radius: 4px;
  color: var(--brand-strong);
  background: var(--brand-soft);
}

.product-ets-ko {
  display: grid;
  gap: 6px;
  padding: 9px 10px 10px;
  border-top: 1px solid #dbeafa;
  background: #f8fcff;
}

.product-ets-ko h5 {
  margin: 0;
  color: var(--brand-strong);
  font-size: 0.9rem;
}

.product-ets-ko-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 6px;
}

.product-ets-ko-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 3px 8px;
  align-items: baseline;
  padding: 6px 7px;
  border: 1px solid #dbeafa;
  border-radius: 5px;
  background: #fff;
}

.product-ets-ko-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-ets-ko-row small {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.76rem;
}

.settingsGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 12px;
}

.statistics-panel {
  display: grid;
  gap: 16px;
}

.statistics-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 10px;
}

.statistics-summary > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
}

.statistics-summary strong,
.statistics-summary span {
  display: block;
}

.statistics-summary strong {
  color: var(--brand-strong);
  font-size: 1.35rem;
}

.statistics-runtime-summary {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.statistics-download-summary {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.statistics-summary small {
  display: block;
  margin-top: 5px;
  font-size: 0.78rem;
}

.inventory-chart-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
}

.inventory-chart-panel h3 {
  margin: 0 0 4px;
  color: var(--brand-strong);
}

.inventory-chart-wrap {
  width: 100%;
  min-height: 220px;
  overflow: hidden;
  border: 1px solid #c8def3;
  border-radius: 6px;
  background: linear-gradient(180deg, #fbfdff 0%, #f1f8ff 100%);
}

.inventory-chart-wrap svg {
  display: block;
  width: 100%;
  min-height: 220px;
}

.inventory-chart-grid {
  stroke: #cfe2f4;
  stroke-width: 1;
  stroke-dasharray: 4 5;
}

.inventory-chart-axis-line {
  stroke: #82acd1;
  stroke-width: 1.2;
}

.inventory-chart-axis {
  fill: #55708a;
  font-size: 11px;
  font-weight: 600;
}

.inventory-chart-empty {
  fill: #55708a;
  font-size: 16px;
}

.inventory-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.84rem;
}

.chart-key {
  display: inline-block;
  width: 22px;
  height: 3px;
  margin: 0 5px 3px 0;
  border-radius: 3px;
  vertical-align: middle;
}

.chart-key-files { background: #0b63ce; }
.chart-key-programs { background: #008c95; }
.chart-key-bytes { background: #e08b16; }
.chart-key-ets-apps { background: #7b4ab5; }
.chart-key-ets-groups { background: #d14c83; }

.statistics-tables {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.statistics-tables h3 {
  margin: 0 0 8px;
  color: var(--brand-strong);
  font-size: 1rem;
}

.statistics-tables .tableWrap {
  max-height: 420px;
}

.statistics-sync-wrap {
  max-height: 420px;
}

.statistics-sync-table {
  min-width: 1000px;
}

.statistics-downloads-wrap {
  max-height: 420px;
}

.statistics-downloads-table {
  min-width: 720px;
}

.statistics-issues-wrap {
  max-height: 420px;
}

.statistics-issues-table {
  min-width: 760px;
}

.users-fieldset {
  grid-column: 1 / -1;
}

.user-add-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) 44px;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.user-add-row button {
  min-width: 44px;
  padding-inline: 0;
  font-size: 1.2rem;
}

.users-table-wrap {
  max-height: 400px;
}

.users-table {
  min-width: 1300px;
  table-layout: fixed;
}

.users-table th,
.users-table td {
  text-align: center;
  vertical-align: middle;
  height: 54px;
  padding: 8px 10px;
  line-height: 1.2;
}

.users-table thead th {
  height: 42px;
}

.users-table thead tr:last-child th {
  height: 38px;
}

.users-table thead tr:first-child th:first-child,
.users-table td:first-child {
  text-align: left;
  width: 17%;
}

.users-table .col-permission,
.users-table td.user-permission {
  width: 8%;
}

.users-table .col-attachments-group {
  width: 16%;
}

.users-table .col-permission {
  white-space: normal;
}

.users-table td.user-permission {
  width: 8%;
}

.users-table .col-actions {
  width: 19%;
  min-width: 19%;
  white-space: nowrap;
}

.users-table input[type='checkbox'] {
  width: 18px;
  height: 18px;
  margin: 0;
  vertical-align: middle;
}

.user-name {
  font-weight: 700;
  padding-left: 12px !important;
}

.user-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}

.user-actions .small-button {
  width: 100%;
  min-width: 0;
}

.small-button {
  min-height: 30px;
  padding: 4px 9px;
  font-size: 0.82rem;
}

fieldset {
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 10px;
}

fieldset legend {
  color: var(--brand-strong);
  font-weight: 700;
  padding: 0 8px;
}

.settingsGrid label {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.checkbox {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
}

.settingsGrid label.checkbox-label {
  display: flex;
  grid-template-columns: none;
  grid-auto-flow: column;
  align-items: center;
  gap: 8px;
}

.settingsGrid label.checkbox-label input[type='checkbox'] {
  min-height: 18px;
  width: 18px;
}

.settingsGrid textarea {
  min-height: 120px;
  resize: vertical;
}

.help {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.settingsActions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.schedules-fieldset {
  grid-column: 1 / -1;
}

.schedules-table-wrap {
  max-height: 360px;
}

.schedules-table {
  min-width: 1080px;
}

.schedules-table td {
  white-space: normal;
  vertical-align: top;
}

.schedules-table .schedule-detail {
  max-width: 420px;
  overflow-wrap: anywhere;
}

.schedule-status {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--panel-soft);
}

.schedule-status.success {
  color: #17653b;
  background: #e3f5ea;
}

.schedule-status.warning {
  color: #855b05;
  background: #fff2c7;
}

.schedule-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.scan-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
}

.upload-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
}

.upload-panel h2 {
  margin: 0 0 4px;
  color: var(--brand-strong);
  font-size: 1.08rem;
}

.upload-panel p {
  margin: 0;
}

.upload-drop {
  display: grid;
  gap: 6px;
  border: 1px dashed #9db8d8;
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 14px;
  font-weight: 700;
}

.upload-drop input {
  width: 100%;
}

.upload-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.upload-results-wrap {
  max-height: calc(100vh - 360px);
}

.upload-summary {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  font-weight: 700;
}

.upload-summary.error {
  color: var(--danger);
}

.upload-results-table {
  min-width: 760px;
}

.upload-results-table .col-status {
  width: 62%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.upload-report {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.upload-report-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 6px;
}

.upload-report-step {
  display: grid;
  gap: 2px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
}

.upload-report-step span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.upload-report-step strong {
  overflow-wrap: anywhere;
}

.upload-report-path,
.upload-report-programs,
.upload-report-error {
  overflow-wrap: anywhere;
}

.upload-report-path {
  font-size: 0.8rem;
}

.upload-report-programs {
  display: grid;
  gap: 3px;
  font-size: 0.82rem;
}

.upload-report-programs ul {
  margin: 0;
  padding-left: 18px;
}

.upload-report-programs small {
  color: var(--muted);
}

.upload-report-actions {
  display: flex;
  gap: 8px;
}

.upload-report-error,
.upload-report-legacy.error {
  color: var(--danger);
}

@media (max-width: 760px) {
  .upload-report-steps {
    grid-template-columns: 1fr;
  }
}

.scan-log-panel {
  margin-top: 12px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 8px;
}

.section-head h2 {
  margin: 0;
  color: var(--brand-strong);
  font-size: 1.05rem;
}

.scan-errors-wrap {
  max-height: calc(100vh - 360px);
}

.scan-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.scan-job-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.scan-job-card {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
}

.scan-job-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.scan-job-card p {
  min-height: 2.2em;
  margin: 0;
  font-size: 0.86rem;
}

.scan-job-card button {
  justify-self: start;
  min-height: 27px;
  padding: 4px 7px;
  font-size: 0.76rem;
  line-height: 1.1;
}

.scan-job-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 4px;
}

.scan-job-actions button {
  width: 100%;
  white-space: nowrap;
}

.scan-job-actions .muted {
  grid-column: 1 / -1;
  font-size: 0.78rem;
}

.scan-error-actions {
  white-space: nowrap;
}

.scan-error-actions button {
  margin: 0 0.25rem 0.25rem 0;
}

.scan-job-card .progress {
  height: 8px;
}

.scan-job-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  min-height: 1.2em;
  color: var(--muted);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.scan-job-progress-meta span:last-child {
  text-align: right;
}

@media (max-width: 1180px) {
  .scan-job-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .scan-job-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .scan-job-grid {
    grid-template-columns: 1fr;
  }
}

.progress-bar.indeterminate {
  width: 35% !important;
  background: linear-gradient(90deg, var(--brand-soft), var(--brand), var(--brand-soft));
  animation: scan-progress-indeterminate 1.2s ease-in-out infinite;
}

@keyframes scan-progress-indeterminate {
  from { transform: translateX(-100%); }
  to { transform: translateX(300%); }
}

.scan-duplicates-panel {
  margin-top: 12px;
}

.scan-duplicates-wrap {
  max-height: 360px;
}

.scan-duplicates-table td:nth-child(2),
.scan-duplicates-table td:nth-child(3),
.scan-duplicates-table td:nth-child(4) {
  white-space: normal;
  overflow-wrap: anywhere;
}

.progress {
  height: 18px;
  overflow: hidden;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--brand-soft);
}

.progress-bar {
  height: 100%;
  width: 0;
  background: var(--brand);
  transition: width 160ms ease;
}

.scan-progress-text {
  font-weight: 700;
}

.scan-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 0;
}

.scan-details div {
  min-width: 0;
}

.scan-details dt {
  color: var(--muted);
  font-size: 0.82rem;
}

.scan-details dd {
  margin: 2px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(5, 18, 40, 0.35);
  padding: 12px;
}

.loginCard {
  width: min(96vw, 420px);
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 20px 48px rgba(20, 55, 97, 0.22);
}

.changelogCard {
  width: min(94vw, 860px);
  max-height: min(86vh, 760px);
  overflow: auto;
}

.changelog-content {
  display: grid;
  gap: 16px;
}

.changelog-entry {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
}

.changelog-entry h3 {
  margin: 0;
  color: var(--brand-strong);
}

.changelog-entry p {
  margin: 4px 0 9px;
}

.changelog-entry ul {
  margin: 0;
  padding-left: 20px;
}

.loginCard h2 {
  margin: 0;
}

.loginCard p {
  margin: 5px 0;
  color: var(--muted);
}

.loginCard label {
  display: block;
  margin: 10px 0;
  font-size: 0.9rem;
}

.loginCard input {
  width: 100%;
  margin-top: 5px;
}

.password-input-wrap {
  position: relative;
  display: block;
  margin-top: 5px;
}

.loginCard .password-input-wrap input {
  margin-top: 0;
  padding-right: 46px;
}

.loginCard .password-toggle {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 34px;
  min-height: 30px;
  height: 30px;
  margin: 0;
  padding: 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  line-height: 1;
}

.loginCard .password-toggle:hover,
.loginCard .password-toggle:focus-visible {
  color: var(--brand-strong);
  background: transparent;
}

.password-toggle-icon {
  display: block;
  width: 22px;
  height: 22px;
  margin: auto;
}

.loginCard button {
  width: 100%;
}

.loginCard button + button {
  margin-top: 8px;
}

.button-link {
  display: block;
  width: 100%;
  min-height: 38px;
  margin: 10px 0;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  padding: 9px 11px;
}

.loginCard .small {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--muted);
}

.small {
  margin-top: 8px;
  font-size: 0.86rem;
}

.search-help-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 30;
  width: min(92vw, 360px);
  height: 100vh;
  padding: 16px;
  border-left: 1px solid var(--line);
  background: var(--panel);
  box-shadow: -18px 0 40px rgba(20, 55, 97, 0.2);
  overflow: auto;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.drawer-head h2 {
  margin: 0;
  color: var(--brand-strong);
  font-size: 1.15rem;
}

.filter-list {
  display: grid;
  gap: 10px;
}

.filter-list div {
  display: grid;
  gap: 4px;
  padding-bottom: 9px;
  border-bottom: 1px solid #c8def3;
}

.filter-list code {
  display: inline-block;
  width: max-content;
  max-width: 100%;
  padding: 4px 6px;
  border-radius: 5px;
  background: var(--brand-soft);
  color: var(--text);
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .toolbar-stats {
    width: 100%;
    flex-wrap: wrap;
  }

  .toolbar-actions {
    width: 100%;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .brand-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .brand-logo {
    width: min(100%, 300px);
  }

  .settingsGrid {
    grid-template-columns: 1fr;
  }

  .statistics-summary,
  .product-summary,
  .statistics-tables {
    grid-template-columns: 1fr;
  }

  .product-app-card summary {
    grid-template-columns: 1fr;
  }

  .product-attachments-backdrop {
    padding: 10px;
  }

  .product-attachments-window {
    max-height: 94vh;
    padding: 12px;
  }

  .product-attachment-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .product-attachment-actions {
    justify-content: flex-start;
  }

  .product-attachment-content-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .product-database-browser {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .product-database-browser.catalog-collapsed {
    grid-template-columns: 1fr;
  }

  .product-database-catalog {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .catalog-collapsed .product-database-catalog {
    min-height: 44px;
  }

  .catalog-collapsed .product-database-catalog > header {
    justify-content: flex-start;
    height: auto;
  }

  .product-pane-splitter {
    display: none;
  }

  .product-database-list {
    max-height: 280px;
  }

  .product-device-head {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .product-device-program {
    padding-top: 8px;
    padding-left: 0;
    border-top: 3px solid var(--knx-green);
    border-left: 0;
  }

  .product-ets-view {
    margin: 10px 12px 0;
  }

  .product-database-detail > .product-ets-view {
    margin: 0;
  }

  .product-ets-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }

  .product-ets-shell.tree-collapsed {
    grid-template-columns: 1fr;
  }

  .tree-collapsed .product-ets-tree {
    display: none;
  }

  .product-ets-tree {
    height: auto;
    max-height: 220px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .product-ets-pages {
    height: auto;
    max-height: none;
  }

  .product-ets-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .product-ets-param-main small {
    white-space: normal;
  }

  .scan-details {
    grid-template-columns: 1fr;
  }

  .tableWrap {
    max-height: none;
  }

  .user-add-row {
    grid-template-columns: 1fr;
  }

  .user-add-row button {
    width: 100%;
  }
}
