/* WDP design system: tokens on top of Bootstrap 5.3, the app shell, and component refinements.
   Light and dark themes use Bootstrap colour modes (html[data-bs-theme]). No build step. */

/* ---- Font (self-hosted Inter, variable weight) ---------------------------------------- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('../lib/inter/inter-cyrillic-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('../lib/inter/inter-cyrillic-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('../lib/inter/inter-latin-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('../lib/inter/inter-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- Tokens ----------------------------------------------------------------------------- */
:root,
[data-bs-theme='light'] {
  --wdp-accent: #4f46e5;
  --wdp-accent-rgb: 79, 70, 229;
  --wdp-accent-hover: #4338ca;
  --wdp-accent-soft: #eef2ff;
  --wdp-accent-text: #4338ca;

  --wdp-bg: #f6f7fb;
  --wdp-surface: #ffffff;
  --wdp-surface-muted: #f9fafb;
  --wdp-border: #e6e8ef;
  --wdp-text: #111827;
  --wdp-text-muted: #6b7280;
  --wdp-sidebar-bg: #ffffff;
  --wdp-topbar-bg: rgba(246, 247, 251, 0.85);
  --wdp-hover: #f3f4f6;
  --wdp-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --wdp-shadow: 0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
  --wdp-shadow-lg: 0 12px 32px -8px rgba(16, 24, 40, 0.18);

  --wdp-radius: 12px;
  --wdp-radius-sm: 8px;
  --wdp-sidebar-width: 260px;
  --wdp-sidebar-collapsed: 76px;
  --wdp-topbar-height: 60px;
}

[data-bs-theme='dark'] {
  --wdp-accent: #818cf8;
  --wdp-accent-rgb: 129, 140, 248;
  --wdp-accent-hover: #a5b4fc;
  --wdp-accent-soft: rgba(129, 140, 248, 0.14);
  --wdp-accent-text: #c7d2fe;

  --wdp-bg: #0b0d12;
  --wdp-surface: #12151c;
  --wdp-surface-muted: #161a22;
  --wdp-border: #232836;
  --wdp-text: #e5e7eb;
  --wdp-text-muted: #9ca3af;
  --wdp-sidebar-bg: #0f1218;
  --wdp-topbar-bg: rgba(11, 13, 18, 0.8);
  --wdp-hover: #1a1f2a;
  --wdp-shadow-sm: none;
  --wdp-shadow: 0 0 0 1px rgba(255, 255, 255, 0.02);
  --wdp-shadow-lg: 0 16px 40px -8px rgba(0, 0, 0, 0.6);
}

/* Map tokens onto Bootstrap's variables so its components follow the design. */
:root,
[data-bs-theme] {
  --bs-font-sans-serif: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --bs-body-font-size: 0.9375rem;
  --bs-body-bg: var(--wdp-bg);
  --bs-body-color: var(--wdp-text);
  --bs-secondary-color: var(--wdp-text-muted);
  --bs-border-color: var(--wdp-border);
  --bs-border-radius: var(--wdp-radius-sm);
  --bs-border-radius-lg: var(--wdp-radius);
  --bs-primary: var(--wdp-accent);
  --bs-primary-rgb: var(--wdp-accent-rgb);
  --bs-link-color: var(--wdp-accent);
  --bs-link-color-rgb: var(--wdp-accent-rgb);
  --bs-link-hover-color: var(--wdp-accent-hover);
  --bs-focus-ring-color: rgba(var(--wdp-accent-rgb), 0.25);
  --bs-tertiary-bg: var(--wdp-surface-muted);
}

body {
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.006em;
}

h1, h2, h3, .h1, .h2, .h3, .h4, .h5, .h6 {
  letter-spacing: -0.02em;
  font-weight: 650;
}

/* ---- Buttons and forms --------------------------------------------------------------- */
.btn {
  --bs-btn-font-weight: 550;
  --bs-btn-border-radius: var(--wdp-radius-sm);
  --bs-btn-padding-x: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.btn-sm {
  --bs-btn-padding-x: 0.65rem;
  --bs-btn-border-radius: 7px;
}

.btn-primary {
  --bs-btn-bg: var(--wdp-accent);
  --bs-btn-border-color: var(--wdp-accent);
  --bs-btn-hover-bg: var(--wdp-accent-hover);
  --bs-btn-hover-border-color: var(--wdp-accent-hover);
  --bs-btn-active-bg: var(--wdp-accent-hover);
  --bs-btn-active-border-color: var(--wdp-accent-hover);
  --bs-btn-disabled-bg: var(--wdp-accent);
  --bs-btn-disabled-border-color: var(--wdp-accent);
  box-shadow: 0 1px 2px rgba(var(--wdp-accent-rgb), 0.3);
}

[data-bs-theme='dark'] .btn-primary {
  --bs-btn-color: #0b0d12;
  --bs-btn-hover-color: #0b0d12;
  --bs-btn-active-color: #0b0d12;
}

.btn-light,
.btn-outline-secondary {
  --bs-btn-color: var(--wdp-text);
  --bs-btn-bg: var(--wdp-surface);
  --bs-btn-border-color: var(--wdp-border);
  --bs-btn-hover-color: var(--wdp-text);
  --bs-btn-hover-bg: var(--wdp-hover);
  --bs-btn-hover-border-color: var(--wdp-border);
  --bs-btn-active-bg: var(--wdp-hover);
  --bs-btn-active-border-color: var(--wdp-border);
  box-shadow: var(--wdp-shadow-sm);
}

.btn-icon {
  --bs-btn-padding-x: 0;
  width: 36px;
  height: 36px;
}

.btn-icon.btn-sm {
  width: 32px;
  height: 32px;
}

.form-control,
.form-select {
  border-color: var(--wdp-border);
  background-color: var(--wdp-surface);
  border-radius: var(--wdp-radius-sm);
  box-shadow: var(--wdp-shadow-sm);
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(var(--wdp-accent-rgb), 0.6);
  box-shadow: 0 0 0 4px rgba(var(--wdp-accent-rgb), 0.12);
}

.form-label {
  font-weight: 550;
  font-size: 0.8125rem;
  margin-bottom: 0.35rem;
}

.form-check-input:checked {
  background-color: var(--wdp-accent);
  border-color: var(--wdp-accent);
}

/* ---- Cards, alerts, badges, modals --------------------------------------------------- */
.card {
  --bs-card-bg: var(--wdp-surface);
  --bs-card-border-color: var(--wdp-border);
  --bs-card-border-radius: var(--wdp-radius);
  --bs-card-cap-bg: transparent;
  --bs-card-cap-padding-y: 0.9rem;
  --bs-card-cap-padding-x: 1.25rem;
  --bs-card-spacer-x: 1.25rem;
  box-shadow: var(--wdp-shadow);
}

.card-header {
  font-weight: 600;
}

.card-footer {
  background: var(--wdp-surface-muted);
}

.alert {
  border-radius: var(--wdp-radius-sm);
  font-size: 0.875rem;
}

.badge {
  font-weight: 550;
  border-radius: 999px;
  padding: 0.3em 0.65em;
}

.modal-content {
  border: 1px solid var(--wdp-border);
  border-radius: 16px;
  background: var(--wdp-surface);
  box-shadow: var(--wdp-shadow-lg);
}

.modal-header,
.modal-footer {
  border-color: var(--wdp-border);
}

/* Dialogs from js/core/dialogs.js (in place of alert, confirm and prompt). */
.wdp-dialog .modal-dialog {
  max-width: 30rem;
}

.wdp-dialog .modal-body {
  padding: 1.5rem 1.5rem 1rem;
}

.wdp-dialog .modal-footer {
  border-top: 0;
  padding: 0 1.5rem 1.25rem;
  gap: 0.5rem;
}

.wdp-dialog-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
}

.wdp-dialog-text {
  white-space: pre-line;
  line-height: 1.5;
}

.wdp-dialog-secret {
  display: block;
  margin-top: 0.75rem;
  padding: 0.6rem 0.8rem;
  font-size: 1.25rem;
  letter-spacing: 0.05em;
  background: var(--wdp-surface-muted);
  border: 1px solid var(--wdp-border);
  border-radius: var(--wdp-radius-sm);
  user-select: all;
}

.dropdown-menu {
  --bs-dropdown-bg: var(--wdp-surface);
  --bs-dropdown-border-color: var(--wdp-border);
  --bs-dropdown-border-radius: 10px;
  --bs-dropdown-link-hover-bg: var(--wdp-hover);
  --bs-dropdown-link-active-bg: var(--wdp-accent-soft);
  --bs-dropdown-link-active-color: var(--wdp-accent-text);
  box-shadow: var(--wdp-shadow-lg);
  padding: 0.35rem;
}

.dropdown-item {
  border-radius: 6px;
  padding: 0.45rem 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

code {
  color: var(--wdp-accent-text);
  background: var(--wdp-accent-soft);
  padding: 0.1em 0.35em;
  border-radius: 5px;
  font-size: 0.82em;
}

/* ---- App shell -------------------------------------------------------------------------- */
.wdp-app {
  display: flex;
  min-height: 100vh;
}

.wdp-sidebar {
  width: var(--wdp-sidebar-width);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--wdp-sidebar-bg);
  border-right: 1px solid var(--wdp-border);
  transition: width 0.18s ease, transform 0.2s ease;
  z-index: 1040;
}

.wdp-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  height: var(--wdp-topbar-height);
  padding: 0 1.15rem;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--wdp-text);
  text-decoration: none;
  white-space: nowrap;
}

.wdp-brand-mark {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--wdp-accent), #7c3aed);
  box-shadow: 0 4px 12px -2px rgba(var(--wdp-accent-rgb), 0.5);
}

/* The logo symbol (wwwroot/img/logo-glyph.svg) is drawn on the same square as the box. */
.wdp-brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
}

.wdp-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0.75rem 1rem;
}

.wdp-nav-section {
  margin: 1.1rem 0 0.35rem;
  padding: 0 0.7rem;
  font-size: 0.6875rem;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--wdp-text-muted);
  white-space: nowrap;
}

.wdp-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.7rem;
  margin: 1px 0;
  border-radius: var(--wdp-radius-sm);
  color: var(--wdp-text-muted);
  font-weight: 500;
  font-size: 0.875rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease;
}

.wdp-nav-link .bi {
  font-size: 1.05rem;
  width: 1.25rem;
  text-align: center;
  flex-shrink: 0;
}

.wdp-nav-link:hover {
  background: var(--wdp-hover);
  color: var(--wdp-text);
}

.wdp-nav-link.active {
  background: var(--wdp-accent-soft);
  color: var(--wdp-accent-text);
  font-weight: 600;
}

.wdp-sidebar-footer {
  border-top: 1px solid var(--wdp-border);
  padding: 0.75rem;
}

/* Collapsed sidebar (desktop): icons only. */
html.wdp-sidebar-collapsed .wdp-sidebar {
  width: var(--wdp-sidebar-collapsed);
}

html.wdp-sidebar-collapsed .wdp-label,
html.wdp-sidebar-collapsed .wdp-nav-section {
  display: none;
}

html.wdp-sidebar-collapsed .wdp-nav-link {
  justify-content: center;
}

html.wdp-sidebar-collapsed .wdp-brand {
  justify-content: center;
  padding: 0;
}

.wdp-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.wdp-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  height: var(--wdp-topbar-height);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.5rem;
  background: var(--wdp-topbar-bg);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--wdp-border);
}

.wdp-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.875rem;
  color: var(--wdp-text-muted);
  min-width: 0;
}

.wdp-breadcrumb strong {
  color: var(--wdp-text);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wdp-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--wdp-accent-text);
  background: var(--wdp-accent-soft);
}

.wdp-content {
  width: 100%;
  max-width: 1600px;
  padding: 1.75rem 2rem 3rem;
}

.wdp-backdrop {
  display: none;
}

/* Tablet and phone: the sidebar slides in over the content. */
@media (max-width: 991.98px) {
  .wdp-sidebar {
    position: fixed;
    left: 0;
    transform: translateX(-100%);
    box-shadow: var(--wdp-shadow-lg);
  }

  html.wdp-sidebar-open .wdp-sidebar {
    transform: none;
  }

  html.wdp-sidebar-open .wdp-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1035;
    background: rgba(15, 18, 24, 0.45);
  }

  html.wdp-sidebar-collapsed .wdp-sidebar {
    width: var(--wdp-sidebar-width);
  }

  html.wdp-sidebar-collapsed .wdp-label,
  html.wdp-sidebar-collapsed .wdp-nav-section {
    display: revert;
  }

  .wdp-content {
    padding: 1.25rem 1rem 2.5rem;
  }

  .wdp-topbar {
    padding: 0 1rem;
  }
}

/* ---- Page header ---------------------------------------------------------------------- */
.wdp-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  margin-bottom: 1.5rem;
}

.wdp-page-header h1 {
  font-size: 1.6rem;
  margin: 0;
}

.wdp-page-header p {
  margin: 0.3rem 0 0;
  color: var(--wdp-text-muted);
  font-size: 0.9rem;
  max-width: 70ch;
}

.wdp-page-actions {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* ---- Table screens -------------------------------------------------------------------- */
.wdp-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.wdp-toolbar .form-label {
  font-size: 0.75rem;
  color: var(--wdp-text-muted);
  margin-bottom: 0.2rem;
}

.wdp-search {
  position: relative;
  min-width: 240px;
}

.wdp-search .bi {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--wdp-text-muted);
  pointer-events: none;
}

.wdp-search input {
  padding-left: 2.1rem;
}

.wdp-table-card {
  background: var(--wdp-surface);
  border: 1px solid var(--wdp-border);
  border-radius: var(--wdp-radius);
  box-shadow: var(--wdp-shadow);
  overflow: auto;
  max-height: calc(100vh - 260px);
}

.wdp-table {
  --bs-table-bg: transparent;
  --bs-table-hover-bg: var(--wdp-hover);
  --bs-table-border-color: var(--wdp-border);
  margin: 0;
  font-size: 0.875rem;
}

.wdp-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--wdp-surface-muted);
  color: var(--wdp-text-muted);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--wdp-border);
}

.wdp-table thead th .btn-link {
  font-size: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
}

.wdp-table td {
  padding: 0.7rem 0.9rem;
  vertical-align: middle;
}

.wdp-table tbody tr:last-child td {
  border-bottom: 0;
}

.wdp-table tbody tr[role='button'] {
  cursor: pointer;
}

.wdp-empty {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--wdp-text-muted);
}

.wdp-empty .bi {
  display: block;
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.6;
}

.wdp-table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-top: 0.85rem;
  font-size: 0.8125rem;
  color: var(--wdp-text-muted);
}

.pagination {
  --bs-pagination-bg: var(--wdp-surface);
  --bs-pagination-border-color: var(--wdp-border);
  --bs-pagination-color: var(--wdp-text);
  --bs-pagination-hover-bg: var(--wdp-hover);
  --bs-pagination-disabled-bg: var(--wdp-surface);
  --bs-pagination-disabled-color: var(--wdp-text-muted);
}

/* ---- Home ------------------------------------------------------------------------------ */
.wdp-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.wdp-tile {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.25rem;
  border: 1px solid var(--wdp-border);
  border-radius: var(--wdp-radius);
  background: var(--wdp-surface);
  box-shadow: var(--wdp-shadow);
  color: var(--wdp-text);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.wdp-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(var(--wdp-accent-rgb), 0.35);
  box-shadow: var(--wdp-shadow-lg);
  color: var(--wdp-text);
}

.wdp-tile-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  color: var(--wdp-accent-text);
  background: var(--wdp-accent-soft);
}

.wdp-tile h2 {
  font-size: 1rem;
  margin: 0;
}

.wdp-tile p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--wdp-text-muted);
}

/* Home figures: what needs attention today. */
.wdp-figures {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.75rem;
}

.wdp-figure {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 0.75rem;
  align-items: center;
  padding: 0.9rem 1rem;
  border: 1px solid var(--wdp-border);
  border-radius: var(--wdp-radius);
  background: var(--wdp-surface);
  color: var(--wdp-text);
  text-decoration: none;
}

.wdp-figure:hover { border-color: rgba(var(--wdp-accent-rgb), 0.35); color: var(--wdp-text); }
.wdp-figure .bi { grid-row: span 2; font-size: 1.3rem; color: var(--wdp-text-muted); }
.wdp-figure strong { font-size: 1.25rem; line-height: 1.2; }
.wdp-figure span { font-size: 0.8rem; color: var(--wdp-text-muted); }
.wdp-figure-info .bi { color: var(--bs-info-text-emphasis); }
.wdp-figure-warning .bi { color: var(--bs-warning-text-emphasis); }
.wdp-figure-danger .bi,
.wdp-figure-danger strong { color: var(--bs-danger-text-emphasis); }

/* ---- Sign-in ---------------------------------------------------------------------------- */
.wdp-auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}

.wdp-auth-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3rem;
  color: #fff;
  background:
    radial-gradient(1200px 600px at -10% 110%, rgba(124, 58, 237, 0.55), transparent 60%),
    radial-gradient(900px 500px at 110% -10%, rgba(14, 165, 233, 0.45), transparent 60%),
    linear-gradient(135deg, #1e1b4b, #312e81 55%, #3730a3);
}

.wdp-auth-brand::after {
  /* A faint window-frame grid: the product in one glance. */
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
  pointer-events: none;
}

.wdp-auth-brand .wdp-brand {
  color: #fff;
  padding: 0;
  height: auto;
  position: relative;
  z-index: 1;
}

.wdp-auth-brand .wdp-brand-mark {
  background: rgba(255, 255, 255, 0.15);
  box-shadow: none;
}

.wdp-auth-tagline {
  position: relative;
  z-index: 1;
  max-width: 28rem;
}

.wdp-auth-tagline h2 {
  font-size: 2rem;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.wdp-auth-tagline p {
  opacity: 0.8;
  margin: 0;
}

.wdp-auth-form {
  display: flex;
  flex-direction: column;
  padding: 2rem;
  background: var(--wdp-surface);
}

.wdp-auth-form-inner {
  width: 100%;
  max-width: 380px;
  margin: auto;
}

@media (max-width: 991.98px) {
  .wdp-auth {
    grid-template-columns: 1fr;
  }

  .wdp-auth-brand {
    display: none;
  }
}

/* ---- Utilities -------------------------------------------------------------------------- */
.text-muted-2 {
  color: var(--wdp-text-muted) !important;
}

.wdp-mono {
  font-family: ui-monospace, 'Cascadia Code', 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.82em;
}

.wdp-page-header > .btn-icon {
  align-self: center;
}

.wdp-table thead th .btn-link {
  padding: 0;
  border: 0;
  line-height: inherit;
  vertical-align: baseline;
  display: inline-flex;
  align-items: center;
}

.wdp-table code,
.wdp-chip {
  white-space: nowrap;
}

.wdp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.wdp-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.12rem 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--wdp-border);
  background: var(--wdp-surface-muted);
  font-size: 0.75rem;
  line-height: 1.4;
}

.wdp-chip b {
  font-weight: 600;
  color: var(--wdp-text-muted);
}

.wdp-dash {
  color: var(--wdp-text-muted);
  opacity: 0.6;
}

/* ---- Configurator ------------------------------------------------------------------------ */
/* The drawing takes the room; one panel with tabs on the right (docs/08-configurator.md, "Layout"). */
.wdp-cfg {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 1rem;
  align-items: start;
}

@media (max-width: 1199.98px) {
  .wdp-cfg {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
}

@media (max-width: 991.98px) {
  .wdp-cfg {
    grid-template-columns: 1fr;
  }
}

.wdp-canvas-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.wdp-canvas-toolbar .dropdown-menu.wdp-cfg-steps {
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.75rem 1rem;
  max-width: 22rem;
}

.wdp-canvas-toolbar .dropdown-menu.wdp-cfg-steps:not(.show) {
  display: none;
}

/* The calculation at a glance under the drawing. */
.wdp-cfg-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1.25rem;
  width: 100%;
  padding: 0.6rem 1.1rem;
  border: 0;
  border-top: 1px solid var(--wdp-border);
  background: var(--wdp-surface);
  color: var(--wdp-text);
  font-size: 0.8125rem;
  text-align: left;
}

.wdp-cfg-status:hover {
  background: var(--wdp-surface-muted);
}

.wdp-cfg-status:empty {
  display: none;
}

.wdp-cfg-status-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
}

.wdp-cfg-status-figure {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
}

.wdp-cfg-status-figure > span {
  color: var(--wdp-text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* The panel: tabs on top, the chosen tab scrolls on its own beside the drawing. */
.wdp-inspector {
  position: sticky;
  top: calc(var(--wdp-topbar-height) + 1rem);
  max-height: calc(100vh - var(--wdp-topbar-height) - 2rem);
  display: flex;
  flex-direction: column;
}

.wdp-inspector > .card-body {
  overflow-y: auto;
  min-height: 0;
}

.wdp-inspector-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--wdp-border);
  flex-shrink: 0;
}

.wdp-inspector-tabs button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.6rem 0.25rem 0.5rem;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--wdp-text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.15;
}

.wdp-inspector-tabs button i {
  font-size: 1.1rem;
}

.wdp-inspector-tabs button:hover {
  color: var(--wdp-text);
}

.wdp-inspector-tabs button.active {
  color: var(--wdp-accent);
  border-bottom-color: var(--wdp-accent);
}

.wdp-tab-badge {
  position: absolute;
  top: 0.3rem;
  right: calc(50% - 1.45rem);
  min-width: 1.1rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--bs-warning);
  color: #1f2937;
  font-size: 0.65rem;
  line-height: 1.1rem;
}

.wdp-tab-badge-error {
  background: var(--bs-danger);
  color: #fff;
}

/* Inside the Calculation tab the result cards lose their own frame. */
.wdp-flat-card {
  border: 0;
  box-shadow: none;
  background: transparent;
}

.wdp-flat-card > .card-header {
  padding: 0 0 0.5rem;
  background: none;
  border: 0;
  font-weight: 600;
}

.wdp-flat-card > .card-body {
  padding: 0;
}

/* The section through the selected part, in the drawing's top right corner. */
.wdp-section-peek {
  position: absolute;
  z-index: 4;
  top: 0.75rem;
  right: 0.75rem;
  width: min(340px, 42%);
  background: var(--wdp-surface);
  border: 1px solid var(--wdp-border);
  border-radius: var(--wdp-radius-sm);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.12);
  overflow: hidden;
}

.wdp-section-peek-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.6rem;
  border-bottom: 1px solid var(--wdp-border);
  font-size: 0.78rem;
}

.wdp-section-peek-bar .wdp-segmented button {
  white-space: nowrap;
  padding: 0.1rem 0.45rem;
  font-size: 0.72rem;
}

.wdp-section-peek-bar .btn-close {
  font-size: 0.6rem;
}

.wdp-section-peek-body {
  padding: 0.4rem;
  background: var(--wdp-surface-muted);
}

.wdp-canvas-stage .wdp-section-peek-body .wdp-drawing {
  display: block;
  width: 100%;
  height: auto;
  max-height: 220px;
  min-height: 0;
}

.wdp-canvas-stage .wdp-section-peek-vertical .wdp-section-peek-body .wdp-drawing {
  max-height: 340px;
}

/* While the section is open, the window moves aside so the section does not cover it. */
.wdp-canvas-stage.wdp-has-peek {
  padding-right: calc(min(340px, 42%) + 1.5rem);
}

@media (max-width: 991.98px) {
  .wdp-section-peek {
    display: none;
  }

  .wdp-canvas-stage.wdp-has-peek {
    padding-right: 1.25rem;
  }
}

/* Building view: the photo large, the positions beside it. */
.wdp-facade-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1rem;
  align-items: start;
}

@media (max-width: 991.98px) {
  .wdp-facade-layout {
    grid-template-columns: 1fr;
  }
}

.wdp-facade-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.wdp-facade-stage {
  padding: 1rem;
  background: var(--wdp-surface-muted);
  min-height: 360px;
}

.wdp-facade-frame {
  position: relative;
  max-width: 100%;
  user-select: none;
  touch-action: none;
}

.wdp-facade-photo {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--wdp-radius-sm);
}

.wdp-facade-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.wdp-facade-frame.scaling .wdp-facade-overlay {
  cursor: crosshair;
}

.wdp-facade-item {
  cursor: grab;
}

.wdp-facade-hit {
  fill: transparent;
  stroke: transparent;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.wdp-facade-item:hover .wdp-facade-hit {
  stroke: rgba(var(--wdp-accent-rgb), 0.6);
}

.wdp-facade-item.selected .wdp-facade-hit {
  stroke: var(--wdp-accent);
  stroke-width: 3;
  stroke-dasharray: 8 4;
}

.wdp-facade-tag {
  fill: #fff;
  stroke: rgba(15, 23, 42, 0.75);
  stroke-width: 3px;
  paint-order: stroke;
  text-anchor: middle;
  font-weight: 700;
  pointer-events: none;
}

/* The line the scale was set from, and openings measured on the photo. */
.wdp-facade-scale {
  stroke: #f59e0b;
  stroke-width: 3;
  stroke-dasharray: 10 6;
  vector-effect: non-scaling-stroke;
}

.wdp-facade-scale-text {
  fill: #fde68a;
}

.wdp-facade-measure rect,
.wdp-facade-drawing-rect {
  fill: rgba(245, 158, 11, 0.12);
  stroke: #f59e0b;
  stroke-width: 2;
  stroke-dasharray: 6 4;
  vector-effect: non-scaling-stroke;
}

.wdp-facade-measure {
  cursor: pointer;
}

.wdp-facade-measure.selected rect {
  fill: rgba(245, 158, 11, 0.25);
  stroke-width: 3;
  stroke-dasharray: none;
}

/* Building view: photo tabs, then one toolbar (tools, scale, opening, the photo's settings). */
.wdp-mode-switch {
  display: inline-flex;
}

.wdp-photo-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0 0.75rem;
  border-bottom: 1px solid var(--wdp-border);
  overflow-x: auto;
}

.wdp-photo-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 0.85rem 0.6rem;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--wdp-text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
}

.wdp-photo-tab:hover {
  color: var(--wdp-text);
}

.wdp-photo-tab.active {
  color: var(--wdp-accent);
  border-bottom-color: var(--wdp-accent);
}

.wdp-photo-tab-add {
  color: var(--wdp-accent);
  font-weight: 500;
}

.wdp-photo-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  background: var(--wdp-surface);
}

.wdp-tool-group {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--wdp-border);
  border-radius: var(--wdp-radius-sm);
  background: var(--wdp-surface-muted);
}

.wdp-tool-group .btn,
.wdp-toolbar-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 0;
  border-radius: calc(var(--wdp-radius-sm) - 2px);
  padding: 0.3rem 0.6rem;
  color: var(--wdp-text-muted);
  background: transparent;
  font-weight: 500;
}

.wdp-tool-group .btn:hover,
.wdp-toolbar-button:hover {
  color: var(--wdp-text);
  background: var(--wdp-surface);
}

.wdp-tool-group .btn.active {
  color: var(--wdp-accent);
  background: var(--wdp-surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

.wdp-toolbar-button {
  border: 1px solid var(--wdp-border);
}

.wdp-toolbar-button.active {
  color: var(--wdp-accent);
  border-color: rgba(var(--wdp-accent-rgb), 0.4);
}

.wdp-tool-group .btn.wdp-danger:hover {
  color: var(--bs-danger);
}

.wdp-scale-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
}

.wdp-scale-chip.ok {
  color: var(--bs-success-text-emphasis);
  background: var(--bs-success-bg-subtle);
}

.wdp-scale-chip.missing {
  color: var(--bs-warning-text-emphasis);
  background: var(--bs-warning-bg-subtle);
}

.wdp-toolbar-separator {
  width: 1px;
  align-self: stretch;
  background: var(--wdp-border);
}

.wdp-toolbar-switch {
  font-size: 0.875rem;
}

@media (max-width: 767.98px) {
  .wdp-tool-group .btn span {
    display: none;
  }
}

/* Open or close a window on the photo: a small round button at its top right corner. */
.wdp-facade-open {
  position: absolute;
  z-index: 2;
  transform: translate(-115%, 15%);
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  font-size: 0.95rem;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.3);
  opacity: 0.8;
}

.wdp-facade-open:hover,
.wdp-facade-open:focus-visible,
.wdp-facade-open.active {
  opacity: 1;
  background: var(--wdp-accent);
}

/* The corner to drag for a new size, and the size fields of the chosen window. */
.wdp-facade-handle {
  fill: #fff;
  stroke: var(--wdp-accent);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  cursor: nwse-resize;
}

.wdp-facade-size {
  width: 6.5rem;
}

.wdp-facade-point {
  fill: var(--wdp-accent);
  stroke: #fff;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.wdp-facade-empty {
  display: grid;
  place-items: center;
  min-height: 320px;
  color: var(--wdp-text-muted);
  text-align: center;
}

.wdp-facade-empty i {
  font-size: 2.5rem;
}

.wdp-facade-position {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem;
  border: 1px solid var(--wdp-border);
  border-radius: var(--wdp-radius-sm);
}

.wdp-facade-position.selected {
  border-color: var(--wdp-accent);
  box-shadow: 0 0 0 2px rgba(var(--wdp-accent-rgb), 0.15);
}

.wdp-facade-thumb {
  width: 56px;
  flex-shrink: 0;
}

.wdp-facade-thumb .wdp-drawing {
  width: 100%;
  height: 56px;
}

/* Building model: the facade's elevation and the building in 3D. */
.wdp-model-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: 0;
  min-height: 460px;
}

@media (max-width: 1199.98px) {
  .wdp-model-body {
    grid-template-columns: 1fr;
  }
}

.wdp-model-elevation {
  padding: 1rem;
  background: var(--wdp-surface-muted);
  border-right: 1px solid var(--wdp-border);
  display: grid;
  place-items: center;
}

.wdp-model-svg {
  width: 100%;
  max-height: 520px;
  touch-action: none;
  user-select: none;
}

.wdp-model-3d {
  position: relative;
  min-height: 460px;
}

.wdp-model-3d canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}

.wdp-model-wall {
  fill: #e9e1d3;
  stroke: #8a8172;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.wdp-model-storey {
  stroke: #a39a8a;
  stroke-dasharray: 6 4;
  vector-effect: non-scaling-stroke;
}

.wdp-model-ground {
  stroke: #6b7c4f;
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.wdp-model-caption {
  fill: var(--wdp-text-muted);
  text-anchor: middle;
}

.wdp-model-item {
  cursor: grab;
}

.wdp-model-hit {
  fill: transparent;
  stroke: transparent;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.wdp-model-item.selected .wdp-model-hit {
  stroke: var(--wdp-accent);
  stroke-width: 3;
  stroke-dasharray: 8 4;
}

.wdp-model-item.misplaced .wdp-model-hit {
  stroke: var(--bs-danger);
  stroke-width: 3;
}

/* The selected part's pieces under the drawing. */
.wdp-part-pieces td {
  padding: 0.25rem 0.4rem;
  font-size: 0.8125rem;
  background: transparent;
  vertical-align: baseline;
}

/* Uw and what it is made of. */
.wdp-thermal th {
  width: 4.5rem;
}

.wdp-thermal td,
.wdp-thermal th {
  padding: 0.3rem 0.25rem;
  font-size: 0.8125rem;
  background: transparent;
}

/* Colour swatches: outside over inside, as the colour looks. */
.wdp-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(30px, 1fr));
  gap: 0.35rem;
  max-height: 9.5rem;
  overflow-y: auto;
  padding: 2px;
  margin-bottom: 0.5rem;
}

.wdp-swatch {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid var(--wdp-border);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
}

.wdp-swatch span {
  position: absolute;
  inset: 0;
}

.wdp-swatch-in {
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

.wdp-swatch:hover {
  transform: scale(1.08);
}

.wdp-swatch.active {
  outline: 2px solid var(--wdp-accent);
  outline-offset: 2px;
}

.wdp-cfg .card-body {
  padding: 1rem 1.1rem;
}

.wdp-cfg-section + .wdp-cfg-section {
  border-top: 1px solid var(--wdp-border);
  margin-top: 1rem;
  padding-top: 1rem;
}

.wdp-cfg-section h2 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--wdp-text-muted);
  margin-bottom: 0.65rem;
}

.wdp-canvas {
  position: sticky;
  top: calc(var(--wdp-topbar-height) + 1rem);
}

.wdp-canvas-stage {
  display: grid;
  place-items: center;
  min-height: max(440px, calc(100vh - var(--wdp-topbar-height) - 19rem));
  padding: 1.25rem;
  background:
    radial-gradient(circle at 1px 1px, var(--wdp-border) 1px, transparent 0) 0 0 / 18px 18px,
    var(--wdp-surface-muted);
  border-radius: 0 0 var(--wdp-radius) var(--wdp-radius);
}

.wdp-canvas-stage .wdp-drawing {
  width: 100%;
  max-height: calc(100vh - var(--wdp-topbar-height) - 21rem);
  min-height: 400px;
}

.wdp-templates {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 0.5rem;
}

.wdp-template {
  border: 1px solid var(--wdp-border);
  border-radius: var(--wdp-radius-sm);
  background: var(--wdp-surface);
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.68rem;
  line-height: 1.2;
  color: var(--wdp-text-muted);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.wdp-template:hover,
.wdp-template:focus-visible {
  border-color: rgba(var(--wdp-accent-rgb), 0.5);
  box-shadow: 0 0 0 3px rgba(var(--wdp-accent-rgb), 0.12);
  outline: none;
}

.wdp-template .wdp-drawing {
  width: 100%;
  height: 52px;
}

.wdp-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.wdp-stat {
  border: 1px solid var(--wdp-border);
  border-radius: var(--wdp-radius-sm);
  padding: 0.55rem 0.7rem;
  background: var(--wdp-surface-muted);
}

.wdp-stat span {
  display: block;
  font-size: 0.7rem;
  color: var(--wdp-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.wdp-stat strong {
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

.wdp-results-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.84rem;
}

.wdp-results-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0;
  border-bottom: 1px dashed var(--wdp-border);
}

.wdp-results-list li:last-child {
  border-bottom: 0;
}

.wdp-num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.wdp-stale {
  opacity: 0.55;
  transition: opacity 0.15s ease;
}

/* Drawing (SVG). Colours follow the theme; strokes keep their width at any zoom. */
.wdp-drawing {
  --d-profile: #fbfcfd;
  --d-profile-2: #eef1f5;
  --d-profile-stroke: #9aa3b2;
  --d-glass: #eaf2fa;
  --d-sky: #cfe6fb;
  --d-sky-2: #f3f9ff;
  --d-sheen: rgba(255, 255, 255, 0.55);
  --d-panel: #e3e7ee;
  --d-line: #1f2937;
  --d-dim: #64748b;
  --d-dim-bg: var(--wdp-surface-muted);
  overflow: visible;
  user-select: none;
}

[data-bs-theme='dark'] .wdp-drawing {
  --d-profile: #2b313f;
  --d-profile-2: #232836;
  --d-profile-stroke: #6b7489;
  --d-glass: #1b3150;
  --d-sky: #10233d;
  --d-sky-2: #1d3557;
  --d-sheen: rgba(255, 255, 255, 0.05);
  --d-panel: #2f3542;
  --d-line: #dbe3ee;
  --d-dim: #94a3b8;
}

.wdp-drawing .d-frame polygon,
.wdp-drawing .d-sash polygon,
.wdp-drawing .d-mullion {
  fill: var(--d-profile);
  stroke: var(--d-profile-stroke);
  stroke-width: 1;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.wdp-drawing .d-sash polygon {
  fill: var(--d-profile-2);
}

/* Up-and-down pieces: their own paint, so a wood grain follows the piece (set when the drawing has a catalogue colour). */
.wdp-drawing .d-frame polygon.d-v,
.wdp-drawing .d-mullion.d-v {
  fill: var(--d-profile-v, var(--d-profile));
}

.wdp-drawing .d-sash polygon.d-v {
  fill: var(--d-profile-2v, var(--d-profile-2));
}

.wdp-drawing .d-rebate {
  fill: none;
  stroke: var(--d-profile-stroke);
  stroke-width: 0.6;
  opacity: 0.55;
  vector-effect: non-scaling-stroke;
}

.wdp-drawing .d-glass {
  fill: var(--d-glass);
  stroke: var(--d-profile-stroke);
  stroke-width: 0.8;
  vector-effect: non-scaling-stroke;
}

.wdp-drawing .d-sheen {
  fill: var(--d-sheen);
  pointer-events: none;
}

.wdp-drawing .d-panel {
  fill: var(--d-panel);
  stroke: var(--d-profile-stroke);
  stroke-width: 0.8;
  vector-effect: non-scaling-stroke;
}

.wdp-drawing .d-adapter {
  stroke: var(--d-profile-stroke);
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
}

.wdp-drawing .d-symbol polyline,
.wdp-drawing .d-symbol line {
  fill: none;
  stroke: var(--d-line);
  stroke-width: 1;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

/* Opening away from the viewer (a door opening outwards, seen from the room): dashed, as drawings show it. */
.wdp-drawing .d-symbol-away polyline,
.wdp-drawing .d-symbol-away line {
  stroke-dasharray: 8 6;
}

.wdp-drawing .d-symbol-text {
  fill: var(--d-line);
  text-anchor: middle;
  font-weight: 600;
  opacity: 0.7;
  pointer-events: none;
}

.wdp-drawing .d-handle rect {
  fill: var(--d-profile);
  stroke: var(--d-profile-stroke);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.wdp-drawing .d-outline {
  fill: none;
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.wdp-drawing .d-outline-selected {
  stroke: var(--wdp-accent);
}

.wdp-drawing .d-outline-error {
  stroke: var(--bs-danger);
  stroke-dasharray: 7 4;
}

.wdp-drawing .d-badge rect {
  fill: var(--wdp-surface);
  stroke: var(--d-profile-stroke);
  stroke-width: 0.8;
  vector-effect: non-scaling-stroke;
}

.wdp-drawing .d-badge text {
  fill: var(--d-line);
  text-anchor: middle;
  font-weight: 650;
}

.wdp-drawing .d-badge-selected rect {
  fill: var(--wdp-accent);
  stroke: var(--wdp-accent);
}

.wdp-drawing .d-badge-selected text {
  fill: #fff;
}

.wdp-drawing .d-clickable {
  cursor: pointer;
}

.wdp-drawing .d-clickable:hover .d-glass {
  fill: color-mix(in srgb, var(--d-glass) 80%, var(--wdp-accent));
}

.wdp-drawing .d-dim-line,
.wdp-drawing .d-dim-tick,
.wdp-drawing .d-dim-ext {
  stroke: var(--d-dim);
  stroke-width: 0.9;
  vector-effect: non-scaling-stroke;
}

.wdp-drawing .d-dim-text {
  fill: var(--d-dim);
  text-anchor: middle;
  font-variant-numeric: tabular-nums;
  paint-order: stroke;
  stroke: var(--d-dim-bg);
  stroke-width: 0.5em;
  stroke-linejoin: round;
}

.wdp-drawing .d-dim-total .d-dim-text {
  fill: var(--wdp-text);
  font-weight: 600;
}

.wdp-drawing .d-dim-editable {
  cursor: text;
}

.wdp-drawing .d-dim-editable:hover .d-dim-text,
.wdp-drawing .d-dim-editable:focus .d-dim-text {
  fill: var(--wdp-accent);
}

.wdp-drawing .d-dim-editable:focus {
  outline: none;
}

/* Canvas overlays: inline dimension input and the field panel. */
.wdp-canvas-stage {
  position: relative;
}

.wdp-dim-input {
  position: absolute;
  z-index: 5;
  width: 6.5rem;
  text-align: center;
  font-weight: 600;
  padding: 0.15rem 0.35rem;
  border: 2px solid var(--wdp-accent);
  border-radius: 6px;
  background: var(--wdp-surface);
  color: var(--wdp-text);
  box-shadow: var(--wdp-shadow-lg);
}

.wdp-dim-input:focus {
  outline: none;
}

.wdp-dim-input.is-invalid {
  border-color: var(--bs-danger);
}

.wdp-field-panel {
  position: absolute;
  z-index: 6;
  width: 272px;
  background: var(--wdp-surface);
  border: 1px solid var(--wdp-border);
  border-radius: 12px;
  box-shadow: var(--wdp-shadow-lg);
  padding: 0.75rem;
  font-size: 0.8125rem;
}

.wdp-field-panel h3 {
  font-size: 0.8125rem;
  font-weight: 650;
  margin: 0;
}

.wdp-field-panel .wdp-panel-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--wdp-text-muted);
  margin: 0.65rem 0 0.3rem;
}

.wdp-openings {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
}

.wdp-opening {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.35rem 0.2rem;
  border: 1px solid var(--wdp-border);
  border-radius: 8px;
  background: var(--wdp-surface);
  color: var(--wdp-text-muted);
  font-size: 0.68rem;
  line-height: 1.15;
  cursor: pointer;
}

.wdp-opening .wdp-drawing {
  width: 34px;
  height: 40px;
}

.wdp-opening:hover {
  border-color: rgba(var(--wdp-accent-rgb), 0.45);
}

.wdp-opening.active {
  border-color: var(--wdp-accent);
  background: var(--wdp-accent-soft);
  color: var(--wdp-accent-text);
  font-weight: 600;
}

.wdp-segmented {
  display: flex;
  border: 1px solid var(--wdp-border);
  border-radius: 8px;
  overflow: hidden;
}

.wdp-segmented button {
  flex: 1;
  border: 0;
  background: var(--wdp-surface);
  color: var(--wdp-text-muted);
  padding: 0.3rem 0.4rem;
  font-size: 0.75rem;
}

.wdp-segmented button + button {
  border-left: 1px solid var(--wdp-border);
}

.wdp-segmented button.active {
  background: var(--wdp-accent-soft);
  color: var(--wdp-accent-text);
  font-weight: 600;
}

.wdp-segmented button:disabled {
  opacity: 0.45;
}

.wdp-divide {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.35rem;
}

.wdp-divide .btn {
  font-size: 0.72rem;
  justify-content: flex-start;
}

/* Product catalogue dialog */
.wdp-catalogue-steps {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--wdp-text-muted);
}

.wdp-catalogue-steps .step {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.wdp-catalogue-steps .num {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--wdp-hover);
}

.wdp-catalogue-steps .step.current {
  color: var(--wdp-text);
  font-weight: 600;
}

.wdp-catalogue-steps .step.current .num {
  background: var(--wdp-accent);
  color: #fff;
}

.wdp-pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
}

.wdp-pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 0.6rem 0.7rem;
  border: 1.5px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--wdp-text);
  font-size: 0.85rem;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.wdp-pick:hover {
  background: var(--wdp-hover);
}

.wdp-pick.active {
  border-color: var(--wdp-accent);
  background: var(--wdp-accent-soft);
}

.wdp-pick .wdp-drawing {
  width: 100%;
  height: 110px;
}

.wdp-pick-products .wdp-pick .wdp-drawing {
  height: 84px;
}

.btn-light,
.btn-outline-secondary {
  --bs-btn-disabled-color: var(--wdp-text-muted);
  --bs-btn-disabled-bg: var(--wdp-surface);
  --bs-btn-disabled-border-color: var(--wdp-border);
}

@media (max-width: 991.98px) {
  /* On small screens the drawing comes first, then the forms and the results. */
  .wdp-cfg .wdp-canvas {
    order: -1;
    position: static;
  }

  .wdp-inspector {
    position: static;
    max-height: none;
  }

  .wdp-canvas-stage {
    min-height: 260px;
  }
}

@media (max-width: 575.98px) {
  .wdp-breadcrumb [data-breadcrumb-section],
  .wdp-breadcrumb [data-breadcrumb-separator] {
    display: none;
  }
}

/* Field settings below the drawing (the drawing itself cycles opening types on click).
   Laid out by the card's own width (container queries), since the card's width depends on the
   page layout, not only on the window. */
.wdp-field-panel {
  position: static;
  width: auto;
  border: 0;
  box-shadow: none;
  padding: 0;
  background: transparent;
}

[data-field-settings] {
  container-type: inline-size;
}

.wdp-field-settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.75rem 1.25rem;
}

.wdp-field-settings-grid > * {
  min-width: 0;
}

.wdp-field-settings-grid > :first-child {
  grid-column: 1 / -1;
}

.wdp-field-settings-grid .wdp-openings {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.wdp-field-settings-grid .wdp-divide {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

@container (min-width: 900px) {
  .wdp-field-settings-grid {
    grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr) minmax(0, 1.3fr);
  }

  .wdp-field-settings-grid > :first-child {
    grid-column: auto;
  }
}

@container (max-width: 460px) {
  .wdp-field-settings-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .wdp-field-settings-grid .wdp-openings {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}


/* The canvas card holds the settings now, so it scrolls with the page. */
.wdp-canvas {
  position: static;
}

.wdp-type-switch button {
  padding: 0.55rem 0.75rem;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

/* ---- Offer editor ------------------------------------------------------------------------- */
.wdp-positions {
  container-type: inline-size;
}

.wdp-position {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 76px 120px 120px auto;
  grid-template-areas: "drawing main qty price total actions";
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--wdp-border);
}

.wdp-position:last-child {
  border-bottom: 0;
}

.wdp-position-drawing {
  grid-area: drawing;
  display: block;
  height: 80px;
  overflow: hidden;
  padding: 4px;
  border-radius: 8px;
  background: var(--wdp-surface-muted);
}

.wdp-position-drawing svg {
  display: block;
  width: 100%;
  height: 100%;
}

.wdp-position-main { grid-area: main; min-width: 0; }
.wdp-position-qty { grid-area: qty; }
.wdp-position-price { grid-area: price; }
.wdp-position-total { grid-area: total; }
.wdp-position-actions { grid-area: actions; }

@container (max-width: 880px) {
  .wdp-position {
    grid-template-columns: 80px 96px 150px minmax(0, 1fr);
    grid-template-areas:
      "drawing main main main"
      "drawing qty price total"
      "actions actions actions actions";
  }

  .wdp-position-actions {
    justify-self: end;
  }
}

.wdp-service {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px 110px 110px 32px;
  align-items: center;
  gap: 0.5rem;
}

/* Configurator, drawing like on paper: bars to drag, "+" to add a part, tools over the selected part. */
.wdp-drawing .d-grip {
  fill: transparent;
  touch-action: none;
}

.wdp-drawing .d-grip-v {
  cursor: col-resize;
}

.wdp-drawing .d-grip-h {
  cursor: row-resize;
}

.wdp-drawing .d-grip:hover {
  fill: color-mix(in srgb, var(--wdp-accent) 22%, transparent);
}

.wdp-dragging,
.wdp-dragging * {
  user-select: none;
}

.wdp-drawing .d-add {
  cursor: pointer;
}

.wdp-drawing .d-add circle {
  fill: var(--wdp-surface);
  stroke: var(--wdp-accent);
  stroke-width: 1.5;
  stroke-dasharray: 3 2;
  vector-effect: non-scaling-stroke;
}

.wdp-drawing .d-add path {
  stroke: var(--wdp-accent);
  stroke-width: 2;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.wdp-drawing .d-add:hover circle,
.wdp-drawing .d-add:focus circle {
  fill: var(--wdp-accent);
  stroke-dasharray: none;
}

.wdp-drawing .d-add:hover path,
.wdp-drawing .d-add:focus path {
  stroke: #fff;
}

.wdp-drawing .d-add:focus {
  outline: none;
}

.wdp-field-tools {
  position: absolute;
  z-index: 4;
  transform: translateX(-50%);
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  background: var(--wdp-surface);
  border: 1px solid var(--wdp-border);
  border-radius: 10px;
  box-shadow: var(--wdp-shadow-lg);
}

.wdp-dragging .wdp-field-tools {
  display: none;
}

.wdp-cfg-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  font-size: 0.8125rem;
  color: var(--wdp-text-muted, var(--bs-secondary-color));
}

.wdp-cfg-steps span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.wdp-cfg-steps i {
  color: var(--wdp-accent);
}

/* Rule messages written on the part they concern. */
.wdp-field-note {
  position: absolute;
  z-index: 3;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 0.3rem 0.55rem;
  font-size: 0.75rem;
  line-height: 1.25;
  color: var(--bs-danger-text-emphasis);
  background: var(--bs-danger-bg-subtle);
  border: 1px solid var(--bs-danger-border-subtle);
  border-radius: 8px;
  box-shadow: var(--wdp-shadow);
  pointer-events: none;
}

.wdp-field-note-warning {
  color: var(--bs-warning-text-emphasis);
  background: var(--bs-warning-bg-subtle);
  border-color: var(--bs-warning-border-subtle);
}

.wdp-dragging .wdp-field-note {
  display: none;
}

/* The size next to the pointer while the frame edge is dragged. */
.wdp-drag-size {
  position: fixed;
  z-index: 1080;
  padding: 0.2rem 0.5rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #fff;
  background: var(--wdp-accent);
  border-radius: 6px;
  box-shadow: var(--wdp-shadow-lg);
  pointer-events: none;
}

.wdp-drag-size:empty {
  display: none;
}

/* Quick start: questions on the left, the window being built on the right. */
.wdp-wizard {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 1.5rem;
}

.wdp-wizard-questions {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.wdp-wizard-questions h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.wdp-wizard-questions .num {
  display: inline-grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  font-size: 0.8rem;
  color: #fff;
  background: var(--wdp-accent);
}

.wdp-wizard-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.wdp-pick-small {
  width: 6.5rem;
  border-color: var(--wdp-border);
}

.wdp-pick-small .wdp-drawing {
  height: 64px;
  width: auto;
  max-width: 100%;
}

.wdp-wizard-preview {
  align-self: start;
  position: sticky;
  top: 0;
  padding: 1rem;
  border-radius: var(--wdp-radius);
  background: var(--wdp-surface-muted);
}

.wdp-wizard-preview .wdp-drawing {
  width: 100%;
  max-height: 55vh;
}

@media (max-width: 767.98px) {
  .wdp-wizard {
    grid-template-columns: 1fr;
  }

  .wdp-wizard-preview {
    position: static;
    order: -1;
  }
}

/* Tablets and phones: finger-sized targets on the configurator. */
@media (pointer: coarse) {
  .wdp-field-tools .btn {
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1.15rem;
  }

  .wdp-dim-input {
    width: 8rem;
    font-size: 1.1rem;
    padding: 0.35rem 0.5rem;
  }

  .wdp-cfg .form-control,
  .wdp-cfg .form-select {
    min-height: 2.75rem;
  }

  .wdp-pick-small {
    width: 7.5rem;
  }
}

/* Tablet in landscape (around 1024–1399 px): drawing beside a narrow form; the steps wrap. */
@media (max-width: 1399.98px) and (min-width: 992px) {
  .wdp-cfg {
    grid-template-columns: 260px minmax(0, 1fr);
  }
}

/* Inside / outside view switch above the drawing. */
.wdp-view-switch button {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8125rem;
}

.wdp-outside-hint {
  position: absolute;
  left: 50%;
  top: 0.5rem;
  max-width: calc(100% - 1rem);
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  font-size: 0.8125rem;
  color: var(--wdp-text-muted);
  background: var(--wdp-surface);
  border: 1px solid var(--wdp-border);
  border-radius: 999px;
  box-shadow: var(--wdp-shadow);
}

/* Opening demonstration: the outside seen through an open sash, and the moving sash. */
.wdp-drawing .d-outside {
  fill: var(--d-sky);
  stroke: var(--d-profile-stroke);
  stroke-width: 0.8;
  vector-effect: non-scaling-stroke;
}

/* A picture of the product from the street: the room through an open sash, the shadow at the glass edge. */
.wdp-drawing.d-realistic .d-outside {
  fill: var(--d-room, #3d352d);
}

.wdp-drawing.d-realistic .d-open .d-glass {
  fill: var(--d-glass);
  opacity: 0.8;
}

.wdp-drawing .d-reveal {
  fill: rgba(15, 23, 42, 0.16);
  pointer-events: none;
}

.wdp-drawing .d-open-sash {
  fill: var(--d-profile-2);
  stroke: var(--d-profile-stroke);
  stroke-width: 1.2;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 6px 10px rgba(16, 24, 40, 0.18));
}

.wdp-drawing .d-open .d-glass {
  fill: color-mix(in srgb, var(--d-glass) 80%, transparent);
}

.wdp-drawing .d-open-handle {
  fill: var(--d-profile);
  stroke: var(--d-profile-stroke);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}


/* 3D view: the canvas fills the drawing area. */
.wdp-stage-3d {
  padding: 0;
}

.wdp-3d {
  position: relative;
  width: 100%;
  height: min(62vh, 640px);
  min-height: 360px;
  cursor: grab;
}

.wdp-3d:active {
  cursor: grabbing;
}

.wdp-3d canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.wdp-3d-loading {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--wdp-text-muted);
  font-size: 0.875rem;
}

/* ---- Installation calendar (month grid; a day list on phones) ---------------------------- */
.wdp-cal-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.wdp-cal-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0 0.25rem;
  text-transform: capitalize;
}

.wdp-cal-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.wdp-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid var(--wdp-border);
  border-radius: var(--wdp-radius-sm);
  overflow: hidden;
  background: var(--wdp-border);
  gap: 1px;
}

.wdp-cal-weekday {
  background: var(--wdp-surface-muted);
  color: var(--wdp-text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.4rem 0.5rem;
}

.wdp-cal-day {
  background: var(--wdp-surface);
  min-height: 6.5rem;
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.wdp-cal-day.is-weekend {
  background: var(--wdp-surface-muted);
}

.wdp-cal-day.is-outside .wdp-cal-daynum {
  color: var(--wdp-text-muted);
  opacity: 0.55;
}

.wdp-cal-date {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.wdp-cal-daynum {
  font-size: 0.8rem;
  font-weight: 600;
  width: 1.6rem;
  height: 1.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.wdp-cal-day.is-today .wdp-cal-daynum {
  background: var(--wdp-accent);
  color: #fff;
}

.wdp-cal-dayname {
  display: none;
}

.wdp-cal-entry {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  line-height: 1.25;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  border-left: 3px solid transparent;
  text-decoration: none;
  color: var(--wdp-text);
  min-width: 0;
  white-space: nowrap;
}

a.wdp-cal-entry:hover {
  filter: brightness(0.96);
  color: var(--wdp-text);
}

.wdp-cal-entry .bi {
  flex: none;
}

.wdp-cal-text {
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
  min-width: 0;
}

.wdp-cal-time {
  font-weight: 600;
  flex: none;
}

.wdp-cal-team {
  color: var(--wdp-text-muted);
  flex: none;
  max-width: 40%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wdp-cal-entry.is-visit.is-planned {
  background: var(--wdp-accent-soft);
  border-left-color: var(--wdp-accent);
}

.wdp-cal-entry.is-visit.is-done {
  background: var(--bs-success-bg-subtle);
  border-left-color: var(--bs-success);
}

.wdp-cal-entry.is-cancelled,
.wdp-cal-entry.is-rejected {
  background: var(--wdp-surface-muted);
  border-left-color: var(--wdp-border);
  color: var(--wdp-text-muted);
  text-decoration: line-through;
}

.wdp-cal-entry.is-service {
  background: var(--bs-warning-bg-subtle);
  border-left-color: var(--bs-warning);
}

.wdp-cal-entry.is-service.is-done {
  background: var(--bs-success-bg-subtle);
  border-left-color: var(--bs-success);
}

.wdp-cal-legend .wdp-cal-entry {
  white-space: nowrap;
}

@media (max-width: 767.98px) {
  /* Phones: a list of the days that have entries. */
  .wdp-cal-grid {
    display: flex;
    flex-direction: column;
    background: none;
    border: 0;
    gap: 0.5rem;
  }

  .wdp-cal-weekday,
  .wdp-cal-day.is-empty,
  .wdp-cal-day.is-outside {
    display: none;
  }

  .wdp-cal-day {
    min-height: 0;
    border: 1px solid var(--wdp-border);
    border-radius: var(--wdp-radius-sm);
    padding: 0.5rem;
  }

  .wdp-cal-dayname {
    display: inline;
    font-weight: 600;
    text-transform: capitalize;
  }

  .wdp-cal-entry {
    font-size: 0.85rem;
    padding: 0.4rem 0.5rem;
  }
}

/* ---- Installation photos ----------------------------------------------------------------- */
.wdp-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.wdp-photo {
  position: relative;
  width: 6rem;
  height: 6rem;
  border-radius: var(--wdp-radius-sm);
  overflow: hidden;
  border: 1px solid var(--wdp-border);
  background: var(--wdp-surface-muted);
}

.wdp-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wdp-photo .wdp-photo-remove {
  position: absolute;
  top: 0.2rem;
  right: 0.2rem;
  padding: 0 0.3rem;
  line-height: 1.4;
}

.wdp-photo-add {
  width: 6rem;
  height: 6rem;
  border: 1px dashed var(--wdp-border);
  border-radius: var(--wdp-radius-sm);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  font-size: 0.75rem;
  color: var(--wdp-text-muted);
  cursor: pointer;
  background: var(--wdp-surface);
}

.wdp-photo-add:hover {
  border-color: var(--wdp-accent);
  color: var(--wdp-accent-text);
}


/* A view switch in the page header: button-sized, icon beside the label. */
.wdp-page-actions .wdp-segmented button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  padding: 0.3rem 0.75rem;
  font-size: 0.8125rem;
}

/* ---- Reports ---------------------------------------------------------------------------- */
/* Chart series: categorical slots 1–2, validated for both surfaces (dataviz palette check). */
:root {
  --wdp-series-1: #2a78d6;
  --wdp-series-2: #1baf7a;
}

[data-bs-theme='dark'] {
  --wdp-series-1: #3987e5;
  --wdp-series-2: #199e70;
}

.wdp-report-period {
  align-items: flex-end;
}

.wdp-report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 1rem;
}

.wdp-report-chart {
  position: relative;
}

.wdp-report-chart svg {
  display: block;
  width: 100%;
  overflow: visible;
}

.wdp-chart-grid line {
  stroke: var(--wdp-border);
  stroke-width: 1;
}

.wdp-chart-axis text {
  fill: var(--wdp-text-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.wdp-chart-hit {
  fill: transparent;
}

.wdp-chart-hit:hover,
.wdp-chart-hit.is-active {
  fill: var(--wdp-hover);
}

.wdp-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--wdp-text-muted);
}

.wdp-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.wdp-chart-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.wdp-chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--wdp-surface);
  border: 1px solid var(--wdp-border);
  border-radius: var(--wdp-radius-sm);
  box-shadow: var(--wdp-shadow-lg);
  padding: 0.5rem 0.65rem;
  font-size: 0.8rem;
  color: var(--wdp-text);
  white-space: nowrap;
  z-index: 2;
}

.wdp-chart-tooltip .wdp-chart-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.wdp-chart-tooltip .wdp-chart-row strong {
  margin-left: auto;
  padding-left: 1rem;
  font-variant-numeric: tabular-nums;
}

.wdp-report-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--wdp-series-1);
  min-width: 2px;
}

@media print {
  .wdp-sidebar,
  .wdp-topbar,
  .wdp-backdrop,
  .wdp-page-header > a,
  .wdp-page-actions,
  .wdp-report-period select {
    display: none !important;
  }

  .wdp-main {
    margin: 0 !important;
    padding: 0 !important;
  }

  .wdp-report-period input {
    border: 0;
    padding: 0;
  }

  .card {
    break-inside: avoid;
    box-shadow: none !important;
  }

  body {
    background: #fff !important;
  }
}

/* Six figures: one row on a desktop, two per row on a phone. */
.wdp-report-figures {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
}

.wdp-report-figures .wdp-figure strong {
  font-size: 1.1rem;
  overflow-wrap: anywhere;
}

@media (max-width: 575.98px) {
  .wdp-report-figures {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wdp-report-figures .wdp-figure {
    grid-template-columns: 1fr;
  }

  .wdp-report-figures .wdp-figure .bi {
    grid-row: auto;
    font-size: 1.1rem;
  }
}

/* ---- Getting started (new company) ------------------------------------------------------- */
.wdp-setup-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.wdp-setup-steps a {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--wdp-border);
  border-radius: var(--wdp-radius-sm);
  color: var(--wdp-text);
  text-decoration: none;
  background: var(--wdp-surface);
}

.wdp-setup-steps a:hover {
  border-color: rgba(var(--wdp-accent-rgb), 0.35);
  color: var(--wdp-text);
}

.wdp-setup-mark {
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--wdp-accent-soft);
  color: var(--wdp-accent-text);
}

.wdp-setup-steps .is-done .wdp-setup-mark {
  background: var(--bs-success-bg-subtle);
  color: var(--bs-success-text-emphasis);
}

.wdp-setup-steps .is-done .wdp-setup-text .fw-semibold {
  color: var(--wdp-text-muted);
}

.wdp-setup-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.wdp-setup-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.wdp-setup-banner .progress {
  flex: 1 1 12rem;
  height: 0.5rem;
}

/* ---- Station screen (tablets) ------------------------------------------------------------ */
.wdp-station-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.wdp-station-picker button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--wdp-border);
  border-radius: var(--wdp-radius-sm);
  background: var(--wdp-surface);
  color: var(--wdp-text);
  font-weight: 600;
}

.wdp-station-picker button.active {
  border-color: var(--wdp-accent);
  background: var(--wdp-accent-soft);
  color: var(--wdp-accent-text);
}

/* Stations set-up: the name takes the row; on a phone the buttons move to the next line. */
.wdp-station-name {
  flex: 1 1 12rem;
  width: auto;
}

.wdp-station-seq {
  flex: none;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--wdp-surface-muted);
  border: 1px solid var(--wdp-border);
  color: var(--wdp-text-muted);
}

.wdp-station-picker button.active .wdp-station-seq {
  background: var(--wdp-accent);
  border-color: var(--wdp-accent);
  color: #fff;
}

.wdp-station-order.is-finished {
  opacity: 0.7;
}

.wdp-station-position {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
}

.wdp-station-drawing svg {
  width: 5rem;
  height: 4.5rem;
  display: block;
}

.wdp-station-units {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.wdp-unit {
  min-width: 3.25rem;
  height: 3.25rem;
  padding: 0 0.6rem;
  border-radius: var(--wdp-radius-sm);
  border: 2px solid var(--wdp-accent);
  background: var(--wdp-surface);
  color: var(--wdp-accent-text);
  font-size: 1.05rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  touch-action: manipulation;
}

.wdp-unit.is-done {
  background: var(--bs-success);
  border-color: var(--bs-success);
  color: #fff;
}

.wdp-unit.is-waiting {
  border-style: dashed;
  border-color: var(--wdp-border);
  color: var(--wdp-text-muted);
}

.wdp-unit-all {
  height: 3.25rem;
  font-weight: 600;
}

@media (max-width: 767.98px) {
  .wdp-station-position {
    grid-template-columns: 4rem minmax(0, 1fr);
  }

  .wdp-station-drawing svg {
    width: 4rem;
    height: 3.5rem;
  }

  .wdp-station-units {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

.wdp-unit-drawing svg {
  width: 9rem;
  height: 8rem;
  display: block;
}

/* ---- Platform: support mode banner, dashboard ------------------------------------------- */
.wdp-support-banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1.5rem;
  background: #fef3c7;
  color: #78350f;
  border-bottom: 1px solid #fcd34d;
  font-size: 0.9rem;
}

[data-bs-theme='dark'] .wdp-support-banner {
  background: rgba(245, 158, 11, 0.16);
  color: #fcd34d;
  border-bottom-color: rgba(245, 158, 11, 0.35);
}

.wdp-progress-mini {
  height: 6px;
  min-width: 5rem;
  background: var(--wdp-hover);
  border-radius: 3px;
  overflow: hidden;
}

.wdp-progress-mini > span {
  display: block;
  height: 100%;
  background: var(--wdp-accent);
}

.wdp-progress-mini.is-complete > span {
  background: #16a34a;
}

.wdp-health-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  margin-right: 0.4rem;
  background: #16a34a;
}

.wdp-health-dot.is-bad {
  background: #dc2626;
}

.wdp-announcement {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1.5rem;
  background: var(--wdp-accent-soft);
  color: var(--wdp-accent-text);
  border-bottom: 1px solid var(--wdp-border);
  font-size: 0.9rem;
}

.wdp-announcement.is-warning {
  background: #fef3c7;
  color: #78350f;
}

[data-bs-theme='dark'] .wdp-announcement.is-warning {
  background: rgba(245, 158, 11, 0.16);
  color: #fcd34d;
}

/* Roles � rights (platform-role-matrix.js). */
.wdp-role-matrix .wdp-role-group td {
  background: var(--wdp-surface-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--wdp-text-muted);
}

.wdp-role-matrix thead th {
  vertical-align: bottom;
  min-width: 5.5rem;
  white-space: normal;
}

/* The rights column: wide enough to read, wraps so all roles fit next to it. */
.wdp-role-matrix tbody td:first-child,
.wdp-role-matrix thead th:first-child {
  min-width: 13rem;
}


/* Accessories on the drawing: shutter box line and mosquito net outline. */
.wdp-drawing .d-accessory-line,
.wdp-drawing .d-net {
  stroke: var(--d-dim);
  stroke-width: 1;
  stroke-dasharray: 4 3;
  vector-effect: non-scaling-stroke;
}

/* Website configurator (public page, /Web/{key}). */
body.wdp-web { background: var(--bs-tertiary-bg); }
.wdp-web-models { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .5rem; }
.wdp-web-model {
  display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: .5rem;
  border: 1px solid var(--bs-border-color); border-radius: .5rem; background: var(--bs-body-bg); font-size: .75rem;
}
.wdp-web-model .wdp-drawing { width: 100%; height: 64px; }
.wdp-web-model.active { border-color: var(--bs-primary); box-shadow: 0 0 0 2px rgba(var(--bs-primary-rgb), .25); }
.wdp-web-drawing .wdp-drawing { width: 100%; max-height: 420px; }
.wdp-web-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* A slanted or arched frame: one band along the outline. */
.wdp-drawing .d-frame-shaped path {
  fill: var(--d-profile);
  stroke: var(--d-profile-stroke);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

/* Section view (configurator): horizontal cut A–A, profiles to scale, glass shortened. */
.wdp-section-view {
  width: 100%;
  padding: 0.5rem 0.25rem;
}

.wdp-section-view .wdp-section {
  width: 100%;
  max-height: 22rem;
  display: block;
}

.wdp-drawing .d-sec-profile {
  fill: var(--d-profile);
  stroke: var(--d-profile-stroke);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.wdp-drawing .d-sec-sash .d-sec-profile {
  fill: var(--d-profile-2);
}

/* A profile's true outline (imported DXF): lines only, like a CAD drawing. */
.wdp-drawing .d-sec-outline {
  fill: none;
  stroke: var(--d-profile-stroke);
  stroke-width: 0.8;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.wdp-drawing .d-sec-chamber {
  fill: none;
  stroke: var(--d-profile-stroke);
  stroke-width: 0.6;
  opacity: 0.5;
  vector-effect: non-scaling-stroke;
}

.wdp-drawing .d-sec-bead {
  fill: var(--d-profile-2);
  stroke: var(--d-profile-stroke);
  stroke-width: 0.8;
  vector-effect: non-scaling-stroke;
}

.wdp-drawing .d-break {
  fill: none;
  stroke: var(--d-dim);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.wdp-drawing .d-sec-side,
.wdp-drawing .d-sec-note {
  fill: var(--d-dim);
}

.wdp-section-drawings {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: 0.75rem;
}

.wdp-section-drawings figure {
  margin: 0;
  border: 1px solid var(--wdp-border);
  border-radius: var(--wdp-radius-sm, 0.375rem);
  padding: 0.5rem;
  background: #fff;
}

.wdp-section-drawings img {
  width: 100%;
  height: 8rem;
  object-fit: contain;
}

.wdp-section-drawings figcaption {
  color: #334155;
}

.wdp-outline-thumb {
  width: 56px;
  height: 56px;
  background: var(--wdp-surface);
  border: 1px solid var(--wdp-border);
  border-radius: 4px;
}

.wdp-outline-offset {
  width: 4.5rem;
}

.wdp-section-thumb {
  width: 2.5rem;
  height: 2rem;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--wdp-border);
  border-radius: 4px;
}

/* Section view: the wall connection (schematic). */
.wdp-drawing .d-wall {
  fill: #d6d3d1;
  stroke: #78716c;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.wdp-drawing .d-bracket {
  fill: #6b7280;
  stroke: #374151;
  stroke-width: 0.6;
}

.wdp-drawing .d-support {
  fill: #1f2937;
  stroke: #111827;
  stroke-width: 0.6;
}

.wdp-drawing .d-insulation {
  fill: #fef3c7;
  stroke: #d97706;
  stroke-width: 0.8;
  vector-effect: non-scaling-stroke;
}

.wdp-drawing .d-foam {
  fill: #fde68a;
  stroke: none;
}

.wdp-drawing .d-exptape {
  fill: #a8a29e;
  stroke: none;
}

.wdp-drawing .d-tape-in {
  fill: #1e293b;
}

.wdp-drawing .d-tape-out {
  fill: #64748b;
}

:root[data-theme="dark"] .wdp-drawing .d-wall {
  fill: #57534e;
  stroke: #a8a29e;
}

:root[data-theme="dark"] .wdp-drawing .d-tape-in {
  fill: #e2e8f0;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .wdp-drawing .d-wall {
    fill: #57534e;
    stroke: #a8a29e;
  }

  :root:not([data-theme="light"]) .wdp-drawing .d-tape-in {
    fill: #e2e8f0;
  }
}

/* Section view: a vertical section is tall and narrow; keep it readable. */
.wdp-section-view .wdp-section-vertical {
  max-height: 40rem;
}

/* Lift-slide: the interlock where two sashes overlap. */
.wdp-drawing .d-interlock {
  stroke-dasharray: 6 4;
}

/* Paired sashes opening to opposite sides: no profile between them, the adapter on one sash is shown dashed. */
.wdp-drawing .d-adapter-open {
  stroke-dasharray: 8 5;
  stroke-width: 1.8;
}

/* Website configurator branding: the company's logo and, when set, its colour (--web-accent on body). */
.wdp-web-logo {
  max-height: 3rem;
  max-width: 10rem;
  object-fit: contain;
}

.wdp-web[style*="--web-accent"] {
  --bs-primary: var(--web-accent);
  --bs-link-color: var(--web-accent);
  --bs-link-hover-color: color-mix(in srgb, var(--web-accent) 80%, #000);
}

.wdp-web[style*="--web-accent"] .btn-primary {
  --bs-btn-bg: var(--web-accent);
  --bs-btn-border-color: var(--web-accent);
  --bs-btn-hover-bg: color-mix(in srgb, var(--web-accent) 85%, #000);
  --bs-btn-hover-border-color: color-mix(in srgb, var(--web-accent) 85%, #000);
  --bs-btn-active-bg: color-mix(in srgb, var(--web-accent) 75%, #000);
  --bs-btn-active-border-color: color-mix(in srgb, var(--web-accent) 75%, #000);
  --bs-btn-disabled-bg: var(--web-accent);
  --bs-btn-disabled-border-color: var(--web-accent);
}

.wdp-web[style*="--web-accent"] .form-check-input:checked {
  background-color: var(--web-accent);
  border-color: var(--web-accent);
}

.wdp-web[style*="--web-accent"] .form-control:focus,
.wdp-web[style*="--web-accent"] .form-select:focus {
  border-color: var(--web-accent);
  box-shadow: 0 0 0 0.25rem color-mix(in srgb, var(--web-accent) 25%, transparent);
}

.wdp-web[style*="--web-accent"] .wdp-web-model.active {
  border-color: var(--web-accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--web-accent) 35%, transparent);
}

/* Configurator in offer mode: the quantity beside "Save to offer". */
.wdp-cfg-quantity { width: auto; }
.wdp-cfg-quantity input { max-width: 5.5rem; }

/* Catalogue → Systems: the favourite star (favourites are listed first). */
.wdp-favourite { color: var(--bs-secondary-color); line-height: 1; font-size: 1.1rem; text-decoration: none; }
.wdp-favourite.is-on { color: var(--bs-warning); }
.wdp-favourite:hover:not(:disabled) { color: var(--bs-warning); }

/* Frame extensions on the drawing: bands outside the frame, in the profile colour but told apart by a hatch line. */
.wdp-drawing .d-extension {
  stroke-dasharray: none;
  opacity: 0.92;
}

/* The top distancer behind the shutter box: only its outline shows through the box. */
.wdp-drawing .d-extension-behind {
  stroke: var(--d-dim);
  stroke-width: 1.2;
  stroke-dasharray: 6 4;
  vector-effect: non-scaling-stroke;
}

/* Typed sizes under an accessory (shutter box, net) and the typed widening next to an extension profile. */
.wdp-cfg-subfields { padding-left: 0.75rem; border-left: 2px solid var(--bs-border-color); }
.wdp-cfg-ext-width { max-width: 4.5rem; }
