* { box-sizing: border-box; margin: 0; padding: 0; }

/* The colours of the app; the layout editor (static/js/konfigurator/editor.js) reads them too. */
:root {
  --navy: #242424;
  --navy-dark: #1a1a1a;
  --accent: #ff6b35;
  --line: #e0e3e8;
  --border: #d0d4da;
  --divider: #f0f2f4;
  --page: #f4f5f7;
  --danger: #c53030;
}

/* Elements the scripts show and hide, whatever their display. */
[hidden] { display: none !important; }

/* Read by screen readers, not shown. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* The icons (templates/icons, from Lucide): drawn in the colour of the text, a little bigger than it, without making
   its line higher. The icons sized in pixels below (.lang-icon, .account-icon) come after this. */
.lucide { width: 1.25em; height: 1.25em; margin: -0.125em 0; vertical-align: -0.125em; flex: none; }
/* Alone in a button or link made big for a symbol: as big as its text. In the button as a block, in its middle (in a
   line of text it sat lower), the margin keeping the button as high as a line (1.2em). */
.act.icon .lucide { display: block; width: 1em; height: 1em; margin: 0.1em auto; }
.project-title .back-link .lucide { width: 1em; height: 1em; vertical-align: middle; }

/* 100 % of <html>, not 100vh: in the app installed on Android, Chrome counts
   the vh units with the status and navigation bars, and a page that fits the
   window scrolled. */
html { height: 100%; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  min-height: 100%;
  background: var(--page);
  color: #222;
}

.brand {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.8px;
  color: var(--navy);
  text-decoration: none;
}
.brand span {
  font-weight: 400;
  color: #666;
  letter-spacing: 0;
  margin-left: 4px;
  padding-left: 8px;
  border-left: 2px solid var(--accent);
}

/* ── Language switcher ─────────────────────────────────── */

/* Segmented control: same border, radius and height as .act buttons,
   the active language uses the primary navy. */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.lang-icon {
  width: 14px;
  height: 14px;
  margin: 0 4px 0 6px;
  fill: none;
  stroke: #999;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}
.lang-switch button {
  border: none;
  background: none;
  border-radius: 4px;
  padding: 5px 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #666;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.lang-switch button:hover:not(.active) { color: var(--navy); background: var(--page); }
.lang-switch button.active { color: #fff; background: var(--navy); cursor: default; }
.lang-switch button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ── Login ─────────────────────────────────────────────── */

body.auth {
  display: flex;
  align-items: center;
  justify-content: center;
  /* top padding keeps the card clear of the corner switcher on short screens */
  padding: 64px 16px 16px;
}

.auth-corner {
  position: absolute;
  top: 16px;
  right: 16px;
}

.auth-card {
  width: 100%;
  max-width: 340px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px 24px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}
.auth-card .brand { margin-bottom: 24px; }

.auth-card label {
  display: block;
  font-size: 11px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
  margin: 14px 0 6px;
}
.auth-card input, .auth-card select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 9px 10px;
  font: inherit;
  font-size: 14px;
  background: #fff;
}
.auth-card input:focus, .auth-card select:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(36,36,36,0.12);
}
.auth-card input[aria-invalid="true"] { border-color: var(--danger); }

/* The password pages (templates/account/password_*.html). */
.auth-card h1 { font-size: 17px; color: var(--navy); margin-bottom: 18px; }
.auth-card h1 + form > label:first-of-type { margin-top: 0; }
.auth-text { font-size: 13px; line-height: 1.5; color: #555; }
.field-error { font-size: 12px; line-height: 1.45; color: var(--danger); margin-top: 5px; }
.form-success {
  font-size: 12px;
  line-height: 1.45;
  color: #276749;
  background: #f0fff4;
  border: 1px solid #c6f6d5;
  border-radius: 5px;
  padding: 9px 10px;
}
/* Below the card's form: back, forgotten password. */
.auth-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 13px;
  color: #888;
  text-decoration: none;
}
.auth-link:hover { color: var(--navy); }
.auth-link .lucide { width: 1em; height: 1em; margin: 0; }

/* The settings (templates/account/settings.html): a tab each, as links to
   their pages. The card is wider, so that "Benachrichtigungen" fits on a
   tab, and at the top: centred, it moved with the height of each tab. */
body.auth.settings { align-items: flex-start; }
.settings .auth-card { max-width: 400px; }
.settings-tabs { display: flex; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.settings-tabs a {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 8px 6px;
  text-align: center;
  font-size: 13px;
  /* All bold, so the open one is no wider than it was. */
  font-weight: 600;
  color: #888;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.settings-tabs a:hover { color: var(--navy); }
.settings-tabs a[aria-current="page"] { color: var(--navy); border-bottom-color: var(--accent); }
.settings-tabs a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.settings-tabs + form > label:first-of-type { margin-top: 0; }
/* A checkbox with its text beside it, and a note below the text. */
.auth-card label.check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  color: #222;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  cursor: pointer;
}
.auth-card .check input { width: auto; margin: 3px 0 0; accent-color: var(--accent); cursor: pointer; }
.check-note { margin: 4px 0 0 21px; font-size: 12px; }

.form-error {
  font-size: 12px;
  line-height: 1.45;
  color: var(--danger);
  background: #fff5f5;
  border: 1px solid #fed7d7;
  border-radius: 5px;
  padding: 9px 10px;
}

.primary {
  display: block;
  width: 100%;
  margin-top: 22px;
  border: none;
  border-radius: 5px;
  padding: 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  color: #fff;
  background: var(--navy);
  cursor: pointer;
}
.primary:hover { background: var(--navy-dark); }

/* ── App shell ─────────────────────────────────────────── */

.topbar {
  display: flex;
  flex-wrap: wrap;               /* on phones the nav drops to a second row */
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 10px 16px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.topbar .brand { white-space: nowrap; }
.topbar nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

/* The account menu: the language, the administration and logging out. */
.account { position: relative; }
.account-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: none;
  padding: 6px 8px;
  font: inherit;
  font-size: 13px;
  color: #444;
  cursor: pointer;
}
.account-button:hover, .account-button[aria-expanded="true"] { border-color: var(--border); background: #fff; }
.account-icon, .account-caret {
  margin: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.account-icon { width: 18px; height: 18px; color: var(--navy); }
.account-caret { width: 14px; height: 14px; color: #888; transition: transform 0.15s; }
.account-button[aria-expanded="true"] .account-caret { transform: rotate(180deg); }
.topbar .user { white-space: nowrap; }
.account-menu, .row-menu-list {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 60;                 /* above the canvas and the dragged module */
  min-width: 240px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}
.account-language {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 6px 10px 10px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--divider);
  font-size: 13px;
  color: #666;
}
.account-language .lang-icon { display: none; }
.account-item, .row-menu-item {
  display: block;
  width: 100%;
  border: none;
  border-radius: 5px;
  background: none;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  text-align: left;
  color: #222;
  text-decoration: none;
  cursor: pointer;
}
.account-item:hover:not(:disabled), .row-menu-item:hover:not(:disabled) { background: var(--page); }
.account-item:disabled, .row-menu-item:disabled { opacity: 0.5; cursor: default; }

/* State of the synchronisation, as icons; shown only when something is not on the server. What each says under it
   on hover and, on phones, for a while on a tap (session.js). */
.sync-status { display: inline-flex; align-items: center; gap: 2px; }
.sync-state {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 32px;
  padding: 0 6px;
  border: none;
  border-radius: 6px;
  background: none;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #666;
  text-decoration: none;
  white-space: nowrap;
  cursor: default;
}
.sync-state .lucide { flex: none; width: 18px; height: 18px; }
.sync-state[data-state="auth"], .sync-state[data-state="error"] { color: var(--danger); }
.sync-state[data-state="auth"] { cursor: pointer; }
.sync-state[data-state="auth"]:hover { background: var(--page); }
.sync-state[data-pending] { color: #8a6d1f; }
.sync-state b { font-variant-numeric: tabular-nums; }
/* Just under the icon, which the button's 32 px leave 7 px under. */
.sync-tip {
  position: absolute;
  top: calc(100% - 3px);
  right: 0;
  z-index: 60;
  display: none;
  padding: 6px 10px;
  border-radius: 5px;
  background: var(--navy);
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}
@media (hover: hover) { .sync-state:hover .sync-tip { display: block; } }
.sync-state.tip-shown .sync-tip { display: block; }

/* As wide as the page's content: its width less its padding. */
.page-notice {
  width: calc(100% - 32px);
  max-width: 1068px;
  margin: 16px auto 0;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid #e0b84f;
  border-radius: 8px;
  background: #fff9e8;
}
.page-notice a { color: var(--navy); font-weight: 600; }
/* With what to do at its end (partials/topbar.html): logging in again, or saving again in red. */
.page-notice.with-action { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.page-notice.with-action .btn { flex: none; color: #fff; text-decoration: none; }
.page-notice.danger { border-color: #e6a3a3; background: #fdf0f0; }
.sync-state[data-save-error] { color: var(--danger); cursor: pointer; }

.act {
  display: inline-block;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 5px;
  padding: 7px 10px;
  font: inherit;
  font-size: 12px;
  color: #222;
  text-decoration: none;
  cursor: pointer;
}
.act:hover:not(:disabled) { border-color: var(--navy); }
.act[aria-pressed="true"] { border-color: var(--navy); background: var(--navy); color: #fff; }
.act:disabled { opacity: 0.4; cursor: default; }
.act.danger:hover:not(:disabled) { border-color: var(--danger); color: var(--danger); }

/* Primary action next to other content (.primary is the full-width form button). */
.btn {
  display: inline-block;
  border: none;
  border-radius: 5px;
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  background: var(--navy);
  cursor: pointer;
}
.btn:hover { background: var(--navy-dark); }

.link {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--navy);
  text-decoration: underline;
  cursor: pointer;
}

button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.muted { color: #888; }
.empty { font-size: 12px; color: #999; font-style: italic; }

@media (max-width: 600px) {
  .topbar .user { display: none; }
}

/* ── Pages ─────────────────────────────────────────────── */

.page { max-width: 1100px; margin: 0 auto; padding: 20px 16px 48px; }

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 16px;
}
.page-head h1 { font-size: 20px; color: var(--navy); }
.back-link { display: inline-block; font-size: 12px; color: #888; text-decoration: none; margin-bottom: 4px; }
.back-link:hover { color: var(--navy); }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

.help {
  font-size: 13px;
  line-height: 1.5;
  color: #555;
  background: #f8f9fb;
  border-left: 3px solid var(--accent);
  border-radius: 0 5px 5px 0;
  padding: 10px 12px;
  margin-bottom: 18px;
}
/* On the grey of the page, outside a card, on white, so that it stands out. */
.help:not(.card .help) { background: #fff; }

.form-error { margin-top: 14px; }
.auth-card .form-error { margin-top: 0; }

/* ── Help ──────────────────────────────────────────────── */

/* Laid out as the administration (templates/app/help.html): its menu of the chapters and their sections beside it,
   the section being read marked there; each chapter headed by its icon. The text no wider than reads well. */
.manual .page-head { max-width: 820px; align-items: center; }
.manual-search { flex: 0 1 260px; display: flex; }
.manual-search .list-search { flex: 1 1 auto; max-width: none; }
.manual .manual-body, .manual .manual-empty { max-width: 820px; }
/* Over the inputs of the administration (.admin input), room for the magnifier. */
.admin .manual-search .list-search input[type="search"] { padding-left: 34px; }
.manual-empty { color: #888; }
.manual [hidden], .admin-nav [hidden] { display: none !important; }
.manual mark { background: #ffe58a; color: inherit; border-radius: 2px; }
.manual-chapter > h2 { display: flex; align-items: center; gap: 8px; font-size: 18px; color: var(--navy); margin-bottom: 12px; }
.manual-chapter > h2 .lucide { width: 20px; height: 20px; margin: 0; color: #777; }
.manual-chapter + .manual-chapter { margin-top: 36px; }
.manual-section { padding: 22px 26px; font-size: 14px; line-height: 1.65; color: #333; scroll-margin-top: 16px; }
.manual-section + .manual-section { margin-top: 14px; }
.manual-section h3 { font-size: 17px; color: var(--navy); margin-bottom: 12px; }
.manual-section h4 {
  font-size: 13px; color: var(--navy); margin: 26px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--divider);
  text-transform: uppercase; letter-spacing: 0.4px;
}
.manual-section p + p, .manual-section dl + p, .manual-section ol + p { margin-top: 10px; }
.manual-section p + dl, .manual-section p + ol, .manual-section p + .manual-table-wrap { margin-top: 16px; }
/* An option by its name on the page, and its symbol; what it does below it, set in. */
.manual-options dt { margin-top: 16px; font-weight: 600; color: var(--navy); }
.manual-options dt:first-child { margin-top: 0; }
.manual-options dd { margin: 3px 0 0 0; padding-left: 12px; border-left: 2px solid var(--divider); color: #444; }
.manual-options dt.sub { margin-top: 10px; padding-left: 16px; font-weight: 500; }
.manual-options dt.sub + dd { margin-left: 16px; }
.manual-options dd + dd { margin-top: 6px; }
.manual-options dt .lucide { color: #555; }
.manual-rules { padding-left: 22px; }
.manual-rules li { padding-left: 4px; }
.manual-rules li + li { margin-top: 8px; }
.manual kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 5px;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: #fafbfc;
  font: 600 12px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-align: center;
  color: #333;
}
/* A picture smaller than taken, with its caption: below the text, or a narrow one beside it, the top of a tall one;
   clicked, over the help as large as it fits (help.js, .manual-lightbox). */
.manual-figure { width: fit-content; max-width: min(100%, 440px); margin: 18px 0; cursor: zoom-in; }
.manual-figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  transition: box-shadow 0.15s;
}
.manual-figure:hover img { box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12); }
.manual-figure figcaption { margin-top: 6px; font-size: 12px; line-height: 1.4; color: #888; }
.manual-figure.side { float: right; clear: right; width: 200px; margin: 0 0 16px 24px; }
.manual-figure.side img { width: 100%; max-height: 360px; object-fit: cover; object-position: top; }
.manual-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  background: rgba(20, 26, 36, 0.8);
  cursor: zoom-out;
}
/* The picture and its caption laid out by the window's box itself: the picture as large as taken, or as fits it. */
.manual-lightbox figure { display: contents; }
.manual-lightbox img { max-width: 100%; max-height: calc(100% - 40px); border-radius: 6px; }
.manual-lightbox figcaption { flex: none; font-size: 13px; color: #fff; text-align: center; }
.manual-section::after { content: ''; display: block; clear: both; }
.manual-table-wrap { overflow-x: auto; }
.manual-keys { border-collapse: collapse; width: 100%; }
.manual-keys td { padding: 6px 10px; border-bottom: 1px solid var(--divider); vertical-align: top; }
.manual-keys td:first-child { white-space: nowrap; width: 1%; }

/* On phones the bar that stays at the top would cover a section's title. */
@media (max-width: 800px) {
  .manual-section { scroll-margin-top: 64px; }
}
@media (max-width: 600px) {
  .manual-section { padding: 18px 16px; }
  .manual-figure.side { float: none; width: auto; max-width: 240px; margin: 16px 0; }
  .manual-lightbox { padding: 12px; }
}

/* Printed whole, without the menu. */
@media print {
  body.manual-page { display: block; height: auto; }
  .manual-page .topbar, .manual-page .admin-nav, .manual-page .admin-nav-backdrop, .manual-page .admin-bar { display: none; }
  .manual-page .admin { display: block; }
  .manual-page .admin-main { overflow: visible; padding: 0; }
  .manual-section { border: none; padding: 0; break-inside: avoid-page; }
  .manual-search, .manual-lightbox { display: none; }
}

/* ── Project list ──────────────────────────────────────── */

/* The list scrolls under the top bar, which stays, as in the administration; the toast and the statuses stick to the
   top of what scrolls. */
body.projects { display: flex; flex-direction: column; height: 100%; }
.page-scroll { flex: 1; min-height: 0; overflow-y: auto; }

/* The statuses in a column right of its search, order and rows. */
.list-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  /* What the column is taller than the search, under it. */
  grid-template-rows: auto 1fr;
  grid-template-areas: "tools filter" "list filter";
  align-items: start;
  column-gap: 20px;
}
.list-filter { grid-area: filter; position: sticky; top: 16px; }
.list-tools { grid-area: tools; }
.list-body { grid-area: list; }
.list-filter h2 {
  padding: 9px 10px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #777;
}
/* The status chosen in colour, with how many projects of each. */
.status-filter { display: grid; gap: 2px; }
.status-filter button {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border: none;
  border-radius: 5px;
  background: none;
  padding: 7px 10px;
  font: inherit;
  font-size: 13px;
  text-align: left;
  color: #222;
  cursor: pointer;
}
.status-filter button:hover { background: #e9ebee; }
.status-filter button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.status-filter .count { opacity: 0.6; font-variant-numeric: tabular-nums; }
/* Who made the projects, under the statuses, apart from them by a line; a long name cut. */
.list-filter .status-filter + h2 { margin-top: 16px; padding-top: 18px; border-top: 1px solid var(--line); }
.owner-filter .owner-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* While a filter is chosen, at the top: all taken off, as in Django's administration, by its ✕ in the accent colour;
   the statuses under it after a line. */
.clear-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 7px 10px;
  border: none;
  border-radius: 5px;
  background: none;
  font: inherit;
  font-size: 13px;
  text-align: left;
  color: #222;
  cursor: pointer;
}
.clear-filters:hover { background: #e9ebee; }
.clear-filters .lucide { flex: none; width: 14px; height: 14px; color: var(--accent); }
.list-filter .clear-filters + h2 { margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
/* Its search and order; on a phone also the button of the statuses, which says when one is chosen. */
.list-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.list-search { position: relative; flex: 0 1 200px; max-width: 200px; }
.list-search .lucide { position: absolute; top: 50%; left: 10px; margin: 0; width: 16px; height: 16px; color: #888; transform: translateY(-50%); pointer-events: none; }
.list-search input[type="search"] { width: 100%; padding-left: 34px; }
/* The order at the end of the row: the one chosen on a button with its icon, a menu of them under it, that one
   ticked. */
.list-sort { position: relative; margin-left: auto; }
.sort-button { display: inline-flex; align-items: center; gap: 6px; height: 100%; font-size: 13px; white-space: nowrap; }
.sort-button .lucide { flex: none; width: 15px; height: 15px; margin: 0; }
.sort-button .lucide:last-child { width: 14px; height: 14px; color: #888; }
.sort-button[aria-expanded="true"] { border-color: var(--navy); }
.sort-menu { min-width: 200px; top: calc(100% + 4px); }
.sort-menu .row-menu-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sort-menu .lucide { flex: none; width: 15px; height: 15px; margin: 0; visibility: hidden; }
.sort-menu [aria-checked="true"] { font-weight: 600; }
.sort-menu [aria-checked="true"] .lucide { visibility: visible; color: var(--navy); }
.filter-toggle { display: none; position: relative; align-items: center; padding: 0 10px; font-size: 16px; }
.filter-count {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}
.list-more { display: block; margin: 12px auto 0; }
@media (max-width: 800px) {
  .list-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "tools" "filter" "list"; }
  .list-filter { display: none; position: static; margin-bottom: 10px; padding: 4px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
  .list-filter.open { display: block; }
  .filter-toggle { display: inline-flex; }
  .list-search { flex: 1 1 0; max-width: none; min-width: 0; }
}

.project-list { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.project-row {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.project-row:hover { border-color: #b0b6be; }
/* All of the row but its menu opens the project. */
.project-link {
  display: block;
  padding: 12px 48px 12px 14px;
  border-radius: 7px;
  color: inherit;
  text-decoration: none;
  font-size: 13px;
}
.inquiry-no { font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.badge.unsynced { color: #8a6d1f; background: #fff3cf; margin-right: 4px; }
/* Why the server refused to create or delete it. */
.badge.refused { color: var(--danger); background: #fde8e8; margin-right: 4px; }
/* New in the project's feed. */
.badge.unread { display: inline-flex; align-items: center; gap: 3px; color: #fff; background: var(--accent); margin-right: 4px; }
/* Where the project stands; from the inquiry on in colour. */
.badge.status { margin-right: 4px; }
.badge.status:not(.draft) { color: #1f4e79; background: #e3edfb; }
.badge.status.order, .badge.status.production { color: #22543d; background: #d9f2e6; }
.list-error { margin: 0 0 12px; }
.project-name { font-weight: 600; }
.row-title .inquiry-no { margin-right: 14px; }
/* In three lines, the project, its customer and the rest, each cut short with … so that every row is as high. */
.row-title, .row-people, .project-meta { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-people { margin-top: 3px; }
.project-meta { margin-top: 6px; font-size: 12px; }
.project-meta .badge { display: inline-block; }
/* What is done with the project, in a menu top right. */
.row-menu { position: absolute; top: 8px; right: 8px; }
.row-menu .act.icon { padding: 6px; font-size: 16px; border-color: transparent; }
.row-menu .act.icon:hover, .row-menu .act.icon[aria-expanded="true"] { border-color: var(--border); }
.row-menu-list { min-width: 160px; top: calc(100% + 4px); }
.row-menu-item.danger { color: var(--danger); }

.empty-state {
  background: #fff;
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 32px 20px;
  text-align: center;
  font-size: 14px;
}
.empty-state .muted { font-size: 13px; margin-top: 6px; }

/* ── Administration ────────────────────────────────────── */

/* The administration (templates/administration): the menu of the groups beside the page, on phones sliding in
   over it, opened from a bar with the page's group. As big as the window, as the project page: the top bar
   stays, and the menu and the page scroll each on its own, only when they do not fit. */
body.administration { display: flex; flex-direction: column; height: 100%; }
.admin { flex: 1; min-height: 0; display: grid; grid-template-columns: 240px minmax(0, 1fr); }
.admin-nav {
  overflow-y: auto;
  padding: 14px 10px 32px;
  font-size: 13px;
}
/* A group's name beside its icon, its tables under it on a line down from the icon: where a group begins and
   ends. The overview's icon in line with those of the groups. */
.admin-nav h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 20px 8px 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
}
.admin-nav h2 .lucide, .admin-nav-top .lucide { width: 16px; height: 16px; margin: 0; color: #777; }
.admin-nav ul { list-style: none; margin-left: 15px; border-left: 1px solid var(--border); }
.admin-nav a { display: block; padding: 6px 8px; border-radius: 5px; color: #222; text-decoration: none; }
.admin-nav a.admin-nav-top { display: flex; align-items: center; gap: 8px; }
.admin-nav li a { margin-left: -1px; padding-left: 16px; border-left: 2px solid transparent; border-radius: 0 5px 5px 0; color: #444; }
.admin-nav a:hover { background: #fff; }
.admin-nav li a:hover { border-left-color: #999; }
.admin-nav a[aria-current="page"], .admin-nav a[aria-current="location"] {
  background: #fff;
  color: var(--navy);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent);
}
.admin-nav li a[aria-current="page"], .admin-nav li a[aria-current="location"] { border-left-color: var(--accent); box-shadow: none; }
.admin-nav .admin-fallback { margin-top: 20px; font-size: 12px; color: #888; }
.admin-nav-head, .admin-nav-backdrop, .admin-bar { display: none; }
.admin-main { min-width: 0; overflow-y: auto; padding: 20px 24px 48px; }
/* Not wider than this on a large screen; the page scrolls at the edge of the window all the same. */
.admin-main > * { max-width: 1240px; }
.admin-message { margin-bottom: 14px; }
.admin-crumbs { font-size: 12px; color: #888; margin-bottom: 4px; }
.admin-crumbs a { color: inherit; }

/* The overview: a card for each group, its tables with how many entries they have. */
.admin-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.admin-groups .card { padding: 16px 18px; }
.admin-groups h2 { font-size: 14px; color: var(--navy); margin-bottom: 8px; }
.admin-groups ul { list-style: none; font-size: 13px; }
.admin-groups li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-top: 1px solid var(--divider); }
.admin-groups li:first-child { border-top: 0; }
.admin-groups a { color: #222; text-decoration: none; }
.admin-groups a:hover { color: var(--navy); text-decoration: underline; }

/* The inputs of its lists and forms, as those of the account pages; and of the list of projects. */
.admin input:not([type="checkbox"]):not([type="file"]), .admin select, .admin textarea, .list-tools :is(input, select) {
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  background: #fff;
}
.admin input:focus, .admin select:focus, .admin textarea:focus, .list-tools :is(input, select):focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(36,36,36,0.12);
}
.admin input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }
.admin [aria-invalid="true"] { border-color: var(--danger) !important; }

/* A list: its search and filters, its rows. */
.admin-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.admin-tools input[type="search"] { flex: 1 1 220px; max-width: 360px; }
.admin-table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th {
  padding: 9px 10px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #777;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
.admin-table td { padding: 7px 10px; border-top: 1px solid var(--divider); vertical-align: middle; }
.admin-table tbody tr:hover { background: #fafbfc; }
.admin-table td a { color: var(--navy); text-decoration: none; }
/* The names that open a row's form wrap no narrower than this on a phone. */
.admin-table td:has(> a) { min-width: 11em; }
/* Not those drawn as buttons (.act), e.g. the actions of a backup. */
.admin-table td a:not(.act):hover { text-decoration: underline; }
.admin-table input[type="number"] { width: 6.5em; padding: 5px 7px; }
.admin-table .field-error { white-space: normal; }

/* A form: its fieldsets, a card each, a row of fields side by side. */
.admin-form .card + .card { margin-top: 12px; }
.admin-form h2 { font-size: 14px; color: var(--navy); margin-bottom: 4px; }
.admin-form .help { margin: 6px 0 4px; }
/* A long one, a tab per card (administration.js, data-tabs), named by its heading, which the card no longer shows;
   on a phone the tabs scroll. Red, a tab with an error. So are the tabs of the Project step (ProjectStep), with how
   many there are on them. */
.admin-tabs, .project-tabs, .position-tabs {
  display: flex;
  overflow-x: auto;
  margin-bottom: 12px;
  box-shadow: inset 0 -1px var(--line);
}
.project-tabs { margin-bottom: 16px; }
/* Also pages of their own as tabs, links (administration/tabs.html). */
.admin-tabs button, .admin-tabs a, .project-tabs button, .position-tabs button {
  flex: none;
  padding: 8px 14px;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  font: inherit;
  font-size: 13px;
  /* All bold, so the open one is no wider than it was. */
  font-weight: 600;
  color: #888;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.admin-tabs button:hover, .admin-tabs a:hover, .project-tabs button:hover, .position-tabs button:hover {
  color: var(--navy);
}
/* Those of a new project not yet created. */
.project-tabs button:disabled { color: #bbb; cursor: default; }
.admin-tabs button[aria-selected="true"], .admin-tabs a[aria-current="page"], .project-tabs button[aria-selected="true"],
.position-tabs button[aria-selected="true"] {
  color: var(--navy);
  border-bottom-color: var(--accent);
}
.admin-tabs button:focus-visible, .admin-tabs a:focus-visible, .project-tabs button:focus-visible,
.position-tabs button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.project-tabs .count { margin-left: 6px; font-weight: 400; color: #999; }
.admin-tabs button.error { color: var(--danger); }
.admin-form.tabbed > .card { margin-top: 0; }
.admin-form.tabbed > .card > h2 { display: none; }
.admin-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; }
.admin-field { margin-top: 14px; min-width: 0; }
.admin-field > label:not(.check), .admin-label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #666;
}
.admin-field > input:not([type="checkbox"]), .admin-field > select, .admin-field > textarea { width: 100%; }
/* Millimetres and numbers are short: their inputs too, wherever the field is wide. */
.admin-field > input[type="number"] { max-width: 220px; }
.admin-field > textarea { height: 8em; resize: vertical; }
.admin-field label.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
/* Full size beside a label of two lines. */
.admin-field label.check input { flex-shrink: 0; }
.admin-field .field-help { margin-top: 5px; font-size: 12px; line-height: 1.45; color: #777; }
.admin-value { font-size: 13px; line-height: 1.5; }
.admin-drawing { max-width: 400px; max-height: 300px; background: #fff; border: 1px solid #ccc; }
.admin-swatch { display: inline-block; width: 2.5em; height: 1.2em; margin-top: 6px; border: 1px solid #ccc; vertical-align: middle; }
/* A rule of the layout, with its drawings below it. */
.admin-rule + .admin-rule { border-top: 1px solid var(--divider); margin-top: 16px; }
/* A setting with CROMEX's drawings (rule.html): its field on the left, the drawings on the right, two in a row;
   under the field on a phone. */
.admin-rule.with-drawings {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 516px);
  gap: 0 24px;
  align-items: start;
}
.admin-rule-drawings { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.admin-rule-drawings img { display: block; width: 250px; max-width: 100%; height: auto; border: 1px solid var(--line); }
@media (max-width: 800px) {
  .admin-rule.with-drawings { grid-template-columns: minmax(0, 1fr); }
}
.admin-uses { margin: 10px 0 12px 20px; font-size: 13px; line-height: 1.6; }
/* Several to tick (members, recipients), with a filter above a long list (administration.js). */
.admin-checks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 4px 16px;
  max-height: 280px;
  overflow-y: auto;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 5px;
}
.admin-checks label.check { font-size: 13px; }
/* Choices in groups (the events of a notification rule): a column each, under its name; all in view. */
.admin-checks.grouped {
  max-height: none;
  gap: 14px 16px;
  /* Two columns at most; one where two do not fit. */
  grid-template-columns: repeat(auto-fill, minmax(max(240px, calc(50% - 8px)), 1fr));
}
.admin-checks-group { display: flex; flex-direction: column; gap: 4px; }.admin-checks-name { margin-bottom: 6px; font-size: 12px; font-weight: 600; color: #666; }
.admin-checks-filter { width: 100%; max-width: 320px; margin-bottom: 6px; }
.admin-links { display: flex; flex-wrap: wrap; gap: 8px; }
/* A list one below the other, e.g. the groups a collision group collides with, or its equipment, each with its drawing
   in a box of the same width. */
.admin-stack { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; }
.admin-stack li { display: flex; align-items: center; gap: 8px; }
.admin-symbol { display: flex; flex: none; justify-content: center; width: 50px; }
/* The rights of the user types: a row each, by section, a box for each type. */
.admin-rights th[scope="row"] {
  font-weight: 400;
  color: #222;
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
  white-space: normal;
  border-bottom: 0;
  border-top: 1px solid var(--divider);
}
.admin-rights .field-help { margin-top: 2px; font-size: 12px; line-height: 1.45; color: #777; }
.admin-rights td { text-align: center; width: 120px; }
.admin-rights-section th { padding-top: 16px; color: var(--navy); background: #f8f9fb; border-top: 1px solid var(--line); }
.admin-rights-title { margin: 24px 0 4px; font-size: 16px; }
.admin-rights-title:first-of-type { margin-top: 8px; }
/* The types or roles at the top of the page while their rights scroll by: on a computer the table does not scroll
   sideways on its own, the page does where it is too wide. At the very top, over the page's padding, which a
   sticky one keeps off otherwise; its line under them as a shadow, which moves along. */
@media (min-width: 801px) {
  .admin-rights-wrap { overflow: visible; }
  .admin-rights thead th {
    position: sticky;
    top: -20px;
    z-index: 1;
    background: #fff;
    border-bottom: 0;
    box-shadow: inset 0 -1px var(--line);
  }
  .admin-rights thead th:first-child { border-top-left-radius: 7px; }
  .admin-rights thead th:last-child { border-top-right-radius: 7px; }
}
/* JSON as it was stored (the changes of a project), and the tables of what a page only shows (its modules). */
.admin-json {
  max-height: 360px;
  overflow: auto;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.45;
  background: #f8f9fb;
  border: 1px solid var(--line);
  border-radius: 5px;
  white-space: pre-wrap;
  word-break: break-word;
}
/* A long one, e.g. the modules of a large project, scrolls in its card. */
.admin-value .admin-table-wrap { max-height: 420px; overflow-y: auto; margin-top: 2px; }
.card + .admin-table-wrap, .admin-after { margin-top: 12px; }
.admin-form .admin-table-wrap { margin: 12px 0; }
/* The API for other programs (administration.api_page): its text, the fields of its JSON and the answers now. */
.api-docs { display: flex; flex-direction: column; gap: 14px; }
.api-docs .card h2 { margin: 0 0 10px; font-size: 15px; color: var(--navy); }
.api-docs .card h3 { margin: 20px 0 8px; font-size: 14px; color: var(--navy); }
.api-docs p, .api-docs li { font-size: 14px; line-height: 1.55; }
.api-docs p { margin: 0 0 10px; }
.api-docs ul { margin: 0 0 10px; padding-left: 20px; }
.api-docs li + li { margin-top: 4px; }
.api-docs code { font-size: 12.5px; padding: 1px 4px; background: #f3f4f6; border-radius: 3px; overflow-wrap: anywhere; }
.api-docs .admin-table code { background: none; padding: 0; }
.api-docs .admin-table td:first-child { width: 30%; }
.api-docs .admin-table-wrap, .api-docs pre { margin: 0 0 12px; }
.api-answer summary { padding: 6px 0; cursor: pointer; }
.api-answer pre { max-height: 480px; }
.admin-backup-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0 0; }
.admin-backup-form input { flex: 1 1 260px; max-width: 420px; }
.admin-message code { font-size: 13px; padding: 2px 6px; background: #fff; border: 1px solid var(--line); border-radius: 4px; user-select: all; }

.admin-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 16px; font-size: 13px; }
.admin-pages { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.admin-delete { margin-left: auto; color: var(--danger); }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #9b2c2c; }
.btn .lucide { margin-right: 2px; }

/* On phones as big as the window too: the top bar stays, and the page scrolls under it, at its top a bar that stays:
   the menu's button and the page's group. The menu slides in from the left over the page, which is dimmed and does
   not scroll behind it. */
@media (max-width: 800px) {
  .admin { display: flex; flex-direction: column; }
  .admin-main { flex: 1; min-height: 0; padding: 0 16px 40px; }
  .admin-bar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 -16px 16px;
    padding: 8px 16px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
    font-weight: 600;
    color: var(--navy);
  }
  .admin-bar > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .admin-bar .lucide { color: #888; margin-right: 2px; }
  .admin-bar .act.icon, .admin-nav-head .act.icon { padding: 9px; font-size: 16px; border-color: transparent; }
  .admin-bar .act.icon:hover, .admin-nav-head .act.icon:hover { border-color: transparent; background: var(--page); }
  .admin-bar .act.icon .lucide, .admin-nav-head .act.icon .lucide { color: inherit; margin: 0; }
  .admin-nav {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 81;                 /* above the top bar and its account menu */
    width: min(300px, 85%);
    padding: 0 10px 32px;
    background: var(--page);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    overscroll-behavior: contain;
    visibility: hidden;
    transform: translateX(-100%);
    transition: transform 0.2s ease, visibility 0s 0.2s;
  }
  .admin-nav.open { visibility: visible; transform: none; transition: transform 0.2s ease; }
  .admin-nav-head {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 -10px 8px;
    padding: 8px 10px 8px 18px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
    font-weight: 600;
    color: var(--navy);
  }
  .admin-nav a { padding: 9px 8px; }
  .admin-nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(0,0,0,0.35);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0s 0.2s;
  }
  .admin-nav.open + .admin-nav-backdrop { opacity: 1; visibility: visible; transition: opacity 0.2s; }
  /* The group above a page's title: in the bar already. */
  .admin-section { display: none; }
  html.admin-nav-locked .admin-main { overflow: hidden; }
}

/* ── Configurator ──────────────────────────────────────── */

/* The project page is as big as the window on every step: the bars stay
   where they are and only the card scrolls. On the layout step the editor
   fills the card. 100 % of <html>, not 100dvh (see body): with dvh, Next
   lay below the window in the installed app. */
body.workspace { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.workspace .page { flex: 1; min-height: 0; display: flex; flex-direction: column; width: 100%; max-width: none; padding: 12px 16px 0; }
.workspace .page-notice { max-width: none; margin: 12px 16px 0; }
.workspace .card { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; }
/* What was just done, e.g. a project created (Konfigurator) or deleted (the list): for a while at the top of the card or
   the list, also scrolled, as the editor's notices (canvas-notice); it takes no room. */
.toast {
  position: sticky; top: 12px; z-index: 20; flex: none; height: 0; overflow: visible;
  display: flex; justify-content: center; pointer-events: none; text-align: center;
}
.toast span { height: max-content; max-width: calc(100% - 32px); }
/* Without the bar at the bottom, apart from the bottom of the window. */
.workspace .card:not(:has(~ .wizard-nav)) { margin-bottom: 12px; }
.step-body { flex: 1 0 auto; }
.step-body:has(> .editor) { display: flex; flex-direction: column; }
/* The editor has a frame of its own. */
.card:has(> .step-body > .editor) { padding: 0; border: none; background: none; }

/* The project, its steps and whether it is saved, in one row; the steps only
   where they fit beside the whole name (Konfigurator, fitSteps). */
.project-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 12px;
}
/* The gap and the buttons of the history and the feed left beside it, so that they stay in its row. */
.project-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: calc(100% - 60px - 2 * var(--feed-toggle));
}
/* Back to the list of projects: only the arrow, its name is the label. */
.project-title .back-link { margin: 0; padding: 0 6px 2px 0; font-size: 24px; line-height: 1; }
.project-title h1 {
  font-size: 17px;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* The buttons of the history and the feed at the end of the row: the steps, or else the name, push them there. */
.project-bar { --feed-toggle: 36px; }
.project-bar .stepper { flex: none; margin-right: auto; }
.project-bar.steps-below .project-title { margin-right: auto; }
/* Where they do not fit beside the name, the steps in a row of their own under it, across the page, scrolled
   sideways like the tabs of an app. */
.project-bar.steps-below { flex-wrap: wrap; row-gap: 4px; }
.project-bar.steps-below .stepper {
  order: 1;
  flex: 0 0 calc(100% + 32px);
  margin: 0 -16px;
  padding: 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
  box-shadow: inset 0 -1px var(--line);
}
.project-bar.steps-below .stepper::-webkit-scrollbar { display: none; }
/* The buttons of the history and the feed close together: 8 px apart instead of the gap of the row. */
.project-bar .history-toggle { margin-right: -12px; }


.stepper { display: flex; gap: 2px; }
.stepper button {
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: none;
  padding: 10px 14px;
  font: inherit;
  font-size: 13px;
  color: #666;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}
.stepper button.active { color: var(--navy); font-weight: 600; border-bottom-color: var(--accent); }
.stepper button:disabled { color: #bbb; cursor: default; }
.stepper button:disabled .step-no { color: #bbb; background: #f0f2f4; }
.step-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  color: #666;
  background: #e8ebef;
}
.stepper button.active .step-no { color: #fff; background: var(--navy); }

/* The project's feed (FeedPanel), opened by its symbol at the end of the project's row, with how much of it is new. */
.feed-toggle { position: relative; flex: none; width: var(--feed-toggle); padding: 6px 0; font-size: 16px; line-height: 1; }
.feed-toggle .lucide { display: block; margin: 0 auto; }
.feed-toggle .unread {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
}
/* Beside whatever step is shown, from the right, over it; on phones the whole window. The history's (HistoryPanel)
   lies in the same place. */
.feed-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 70;                 /* above the editor's panels and the account menu */
  width: min(420px, 100vw);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-left: 1px solid var(--line);
  box-shadow: -6px 0 20px rgba(0,0,0,0.08);
}
.feed-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.feed-head h2 { font-size: 15px; color: var(--navy); }
.feed-filter { display: flex; gap: 2px; margin-right: auto; }
.feed-filter button {
  border: none;
  background: none;
  border-radius: 5px;
  padding: 5px 8px;
  font: inherit;
  font-size: 12px;
  color: #666;
  cursor: pointer;
}
.feed-filter button.active { background: var(--page); color: var(--navy); font-weight: 600; }
.feed-panel .panel-close, .feed-panel .panel-pin {
  display: block;
  font-size: 16px;
  line-height: 1;
  padding: 4px 6px;
  color: #666;
  text-decoration: none;
}
/* Pinned (Konfigurator, side), on a computer: the page, its top bar too, leaves the one open its place, beside it,
   without a shadow; on phones it lies over the page as before. */
@media (min-width: 700px) {
  body.side-pinned { padding-right: min(420px, 100vw); }
  body.side-pinned .feed-panel:not(.preview-panel) { box-shadow: none; }
}

/* A file looked at (PreviewPanel): in the feed's place, over it, twice as wide; on phones the whole window. */
.preview-panel { width: min(840px, 100vw); z-index: 71; outline: none; }
.preview-panel .feed-head { gap: 6px; }
.preview-panel .feed-head h2 { min-width: 0; margin-right: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-pages { flex: none; font-size: 12px; font-variant-numeric: tabular-nums; }
.preview-zoom { display: flex; flex: none; align-items: center; gap: 2px; }
.preview-percent { min-width: 46px; font-size: 12px; color: #666; text-align: center; font-variant-numeric: tabular-nums; }
.preview-panel .feed-head .icon { display: block; flex: none; padding: 4px 6px; border-radius: 5px; font-size: 16px; line-height: 1; color: #666; text-decoration: none; }
.preview-panel .feed-head .icon:hover:not(:disabled) { color: var(--navy); }
.preview-panel .feed-head .icon:disabled { opacity: 0.4; cursor: default; }
.preview-panel .feed-head .icon[aria-pressed="true"] { background: var(--page); color: var(--navy); }
/* Scrolled, dragged and zoomed by the panel itself (preview.js), also by fingers. */
.preview-view { position: relative; flex: 1; min-height: 0; overflow: auto; background: var(--page); touch-action: none; cursor: grab; outline: none; }
.preview-view.dragging { cursor: grabbing; }
.preview-view:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.preview-state { position: absolute; top: 16px; left: 16px; right: 16px; text-align: center; }
/* As wide as the file, at least as the view, which centres it; --zoom, and each item's --w and --h at zoom 1. */
.preview-content { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; box-sizing: border-box; width: max-content; min-width: 100%; min-height: 100%; padding: 16px; }
.preview-image, .preview-page { flex: none; width: calc(var(--w) * var(--zoom) * 1px); height: calc(var(--h) * var(--zoom) * 1px); }
.preview-image { display: block; background: #fff; user-select: none; -webkit-user-drag: none; }
.preview-page { position: relative; overflow: hidden; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18); }
/* The whole page, and over it the part in view, drawn sharper when zoomed in far (preview.js). */
.preview-page canvas { position: absolute; display: block; }
.preview-page canvas.detail { z-index: 1; }

/* The history (HistoryPanel): a row for each run of changes, newest first, the one shown marked. */
.history-panel .feed-head h2 { margin-right: auto; }
.history-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  background: var(--page);
}
.history-entry { background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.history-entry.shown { border-color: var(--accent); }
.history-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: none;
  font: inherit;
  font-size: 13px;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.history-list > .history-row { background: #fff; border: 1px solid var(--line); }
.history-row:hover { background: #f4f6f8; }
.history-row.active { background: #fff3ec; }
.history-when { font-size: 11px; color: #666; }
.history-what { overflow-wrap: anywhere; }
.history-more { margin: 0 10px 8px; font-size: 12px; }
.history-sets { list-style: none; margin: 0 6px 6px; padding-top: 4px; border-top: 1px solid var(--line); }

/* The project as it was after a change of its history, looked at only (Konfigurator): when, by whom, and back and
   forth. */
.past-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 0 0 12px;
  padding: 8px 12px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: #fff3ec;
  font-size: 13px;
}
.past-what .lucide { margin-right: 4px; vertical-align: -0.15em; }
.past-actions { display: flex; flex-wrap: wrap; gap: 8px; }
/* What changes the project, while it is shown as it was: as if it were not there, its fields greyed. */
fieldset.lock { min-width: 0; margin: 0; padding: 0; border: 0; }
/* Fields locked by different rights in one grid (the project step): their fields are its cells. */
fieldset.lock.contents { display: contents; }
/* A locked field looks locked, by its fieldset or on its own (e.g. a module's status without its right). */
fieldset.lock:disabled :is(input, select, textarea), .field :is(input, select, textarea):disabled {
  background-color: var(--page);
  color: #555;
}
/* Its entries in the order they arrived, the user's own messages on the right. */
.feed-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  background: var(--page);
}
.feed-event {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2px 8px;
  padding: 2px 8px;
  font-size: 12px;
  color: #555;
  text-align: center;
}
/* A line of its own, however short: who and when always below it. */
.feed-event-what { flex-basis: 100%; }
.feed-message {
  align-self: flex-start;
  max-width: 85%;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
}
.feed-message.own { align-self: flex-end; background: #e8f1fd; border-color: #c3d8f5; }
.feed-message.deleted { opacity: 0.7; }
.feed-message header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin-bottom: 4px; font-size: 11px; }
.feed-author { color: var(--navy); }
.feed-text { white-space: pre-wrap; overflow-wrap: anywhere; }
/* What a reply answers, above it; a click shows that one. */
.feed-quote {
  display: block;
  width: 100%;
  margin-bottom: 6px;
  padding: 4px 8px;
  border: none;
  border-left: 3px solid #3b82d6;
  border-radius: 4px;
  background: rgba(0,0,0,0.04);
  font: inherit;
  font-size: 12px;
  color: #555;
  text-align: left;
  overflow: hidden;
  overflow-wrap: anywhere;
  max-height: 3.2em;
  cursor: pointer;
}
.feed-files { list-style: none; display: flex; flex-direction: column; gap: 3px; margin-top: 6px; font-size: 12px; }
.feed-files li { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; overflow-wrap: anywhere; }
/* The size after the name, never broken; who deleted a file and when, below it where it does not fit, broken as
   the message is. */
.feed-files .muted { flex: none; white-space: nowrap; }
.feed-files s + .muted { flex: 1 1 auto; white-space: normal; }
.feed-about { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 12px; }
.feed-message footer { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.feed-actions { display: flex; gap: 8px; margin-left: auto; }
.feed-actions .link, .feed-event .link, .feed-compose .link.icon { color: #888; font-size: 14px; text-decoration: none; }
.feed-actions .link:hover, .feed-event .link:hover { color: var(--navy); }
.feed-actions .link.danger:hover { color: var(--danger); }
.feed-state { font-size: 11px; color: #8a6d1f; }
.feed-state.error { color: var(--danger); }
/* How much of a message's files has gone, while the sync sends them (feed.js, uploads). */
.upload-bar { height: 4px; margin-top: 6px; border-radius: 2px; background: var(--line); overflow: hidden; }
.upload-bar span { display: block; height: 100%; background: var(--accent); transition: width 0.2s; }
/* Shown from elsewhere, e.g. a comment's "Show in the feed". */
[data-entry].focused { outline: 2px solid var(--accent); outline-offset: 2px; }
.feed-edit textarea {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  font: inherit;
  font-size: 13px;
  resize: vertical;
}
.feed-edit .row { display: flex; gap: 6px; margin-top: 6px; }
/* Written at the bottom: what it answers, its files, the text and the buttons. */
.feed-compose { display: flex; flex-direction: column; gap: 6px; padding: 10px 14px; border-top: 1px solid var(--line); }
.feed-compose .feed-quote.replying { display: flex; align-items: center; gap: 6px; max-height: none; margin: 0; cursor: default; }
.feed-compose .feed-quote.replying span { flex: 1; min-width: 0; }
.feed-compose .feed-files { margin: 0; }
/* The text field one line high, as the buttons beside it, growing with what is written (FeedPanel, grow). */
.feed-compose-row { display: flex; align-items: flex-end; gap: 6px; }
.feed-compose textarea {
  flex: 1;
  min-width: 0;
  height: 38px;
  max-height: 140px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  line-height: 20px;
  resize: none;
  overflow-y: auto;
}
.feed-compose .act.icon, .feed-compose .btn.icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 17px;
  line-height: 1;
}
.feed-compose .act.icon .lucide, .feed-compose .btn.icon .lucide { margin: 0; }
.feed-compose label.act { cursor: pointer; }
.btn.icon .lucide { display: block; width: 1em; height: 1em; }
.btn:disabled { opacity: 0.4; cursor: default; }

/* A bar across the bottom of the window: creating a new project, printing at the last step. */
.wizard-nav {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 12px -16px 0;
  padding: 10px 16px;
  background: #fff;
  border-top: 1px solid var(--line);
}

/* 12-column form grid */
.form-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px 16px; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-6 { grid-column: span 6; }
.span-12 { grid-column: span 12; }
@media (max-width: 900px) {
  .span-3, .span-4 { grid-column: span 6; }
}
@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
  .span-3, .span-4, .span-6, .span-12 { grid-column: auto; }
  .card { padding: 14px; }
}

/* The tabs of the Project step (ProjectStep, .project-tabs): its participants, and its files with, below them, its
   offer and order form. */
.members, .project-files { margin-bottom: 16px; }
.sales-documents { margin: 24px 0 16px; }
.project-files h3, .sales-documents h3 { margin: 0 0 8px; font-size: 14px; }
/* The files of the project, and the versions of its offer and order form (ProjectFiles, SalesDocuments): a row
   each, as the participants: the file's type in a square, its name, who added it, when and its size, and ✕. The
   older versions grey; the offer and the order form named as the fields are. */
.file-list { list-style: none; margin: 0; padding: 0; }
.file-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--divider); }
.file-badge {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: #e8ecf3;
  color: var(--navy);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.file-who { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.file-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  color: var(--navy);
  text-decoration: none;
}
a.file-name:hover, button.file-name:hover { text-decoration: underline; }
.file-about { font-size: 12px; color: #888; }
.file-who .upload-bar { align-self: stretch; }
.file-remove { flex: none; width: 24px; }
.file-remove .lucide { width: 16px; height: 16px; }
.file-item.earlier .file-badge { opacity: 0.5; }
.file-item.earlier .file-name { color: #888; }
.project-files .act.upload, .sales-kind .act.upload { margin-top: 12px; }
.sales-kind + .sales-kind { margin-top: 20px; }
.sales-kind h4 { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; color: #777; }
/* A participant a row: their initials in a circle, name and user type (a long one cut short), their role, and ✕.
   One is added in a role, a button each, then chosen in a select, which adds them. */
.member-list { list-style: none; margin: 0; padding: 0; }
.member-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--divider); }
.member-initials {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e8ecf3;
  color: var(--navy);
  font-size: 12px;
  font-weight: 600;
}
.member-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.member-name, .member-about { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-name { font-size: 14px; color: #222; }
.member-about { font-size: 12px; color: #888; }
.members .member-row select { flex: none; width: 220px; }
.members select:disabled { background: var(--page); color: #888; }
.member-remove { flex: none; width: 24px; }
.member-remove .lucide { width: 16px; height: 16px; }
.member-add { margin-top: 14px; }
.member-add .row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.members .member-adding select { flex: 1; max-width: 360px; }
.member-adding .act { height: 39px; }
/* On phones in the same row, closer: the role as wide as its longest name, the name and user type the rest. */
@media (max-width: 600px) {
  .member-row { gap: 8px; }
  .members .member-row select { width: auto; max-width: 50%; }
}

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field .label {
  font-size: 11px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}
.field .label.required::after { content: ' *'; color: var(--accent); }
.field input, .field select, .field textarea, .members select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 8px 10px;
  font: inherit;
  font-size: 14px;
  color: #222;
  background: #fff;
}
/* Inputs and selects are one height: browsers size them differently from the same padding. */
.field input, .field select, .members select { height: 39px; }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .members select:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(36,36,36,0.12);
}
.field input.readonly { background: var(--page); font-weight: 700; color: var(--navy); }
.field-note { font-size: 11px; line-height: 1.4; color: #888; }
.field.invalid input { border-color: var(--danger); background: #fff5f5; }

.type-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 14px;
}
/* On the Configuration step one module type at a time, under its tab (.inspector-tabs), framed as the inspector's
   panels (.build-panel), which the open tab joins. */
.config-types .type-card { border-color: var(--border); border-radius: 6px; background: #fff; }
.config-types .inspector-tabs button { padding-left: 14px; padding-right: 14px; }
/* The actions stay on the right, however long the name: it wraps beside them. */
.type-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.type-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex: 1; min-width: 0; font-size: 15px; color: var(--navy); }
.type-title strong { margin-right: 4px; overflow-wrap: anywhere; }
.type-title .badges { display: flex; flex-wrap: wrap; gap: 6px; }
.type-actions { display: flex; gap: 6px; flex: none; }
/* The icon and the name apart: Vue drops the space between them, which ends a line of the template. */
.type-actions .act { display: inline-flex; align-items: center; gap: 4px; }
.badge {
  font-size: 11px;
  font-weight: 600;
  color: #555;
  background: var(--divider);
  border-radius: 999px;
  padding: 3px 9px;
}
.add-type { border-style: dashed; padding: 9px 14px; font-size: 13px; }
/* On a phone the actions at the top right, only their icons (their names still read, as .visually-hidden); the size
   and floor under the name, which is level with them. */
@media (max-width: 600px) {
  .type-head { align-items: flex-start; }
  .type-title:has(+ .type-actions) { padding-top: 8px; }
  .type-title .badges { flex-basis: 100%; }
  .type-actions .act { display: flex; padding: 8px; font-size: 16px; line-height: 1; }
  .type-actions .act .lucide { width: 1em; height: 1em; margin: 0; }
  .type-actions .act-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

.config-group { padding-top: 14px; margin-top: 14px; border-top: 1px solid var(--divider); }
.config-group:first-of-type { padding-top: 0; margin-top: 0; border-top: none; }
.config-group h3 { font-size: 13px; color: var(--navy); margin-bottom: 8px; }

/* Layer diagram of a build-up (as in V31) */
.layers {
  display: flex;
  height: 44px;
  border: 1px solid #c9d1d6;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 12px;
}
.layers span {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 4px;
  min-width: 0;
  font-size: 10px;
  font-weight: 700;
  color: #444;
  text-align: center;
  border-right: 1px solid #a9b6bd;
}
.layers span:last-child { border-right: none; }
.l-metal { background: #d8dde0; }
.l-pu { background: #f2dc82; }
.l-mw { background: #e8cba8; }
.l-gyp { background: #eee; }
.l-ply { background: #cfa779; }
.l-foil { background: #cce1e9; }
.l-pvc { background: #d8e5d1; }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 72px;
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
}
.swatch-color {
  width: 100%;
  height: 40px;
  border: 1px solid #c9d1d6;
  border-radius: 6px;
}
.swatch.selected .swatch-color { outline: 3px solid var(--accent); outline-offset: 2px; }
.swatch-label { font-size: 10px; line-height: 1.25; color: #555; text-align: center; }
.swatch.selected .swatch-label { color: var(--navy); font-weight: 600; }

.techref {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 16px;
  background: #fbfcfd;
}
.techref summary { padding: 10px 14px; font-size: 13px; font-weight: 600; color: var(--navy); cursor: pointer; }
.techref-body {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) 1.2fr;
  gap: 16px;
  align-items: center;
  padding: 0 14px 14px;
  font-size: 13px;
  line-height: 1.5;
}
.techref-body img {
  width: 100%;
  max-height: 380px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.techref-body ul { padding-left: 18px; margin-top: 8px; }
.techref-body li { margin: 4px 0; }
@media (max-width: 800px) {
  .techref-body { grid-template-columns: 1fr; }
}

/* ── Layout: palette, floors, canvas, selected module ──── */

/* What the card leaves below the hint; on short windows the page scrolls.
   Clipped, not scrolled: on tablets nothing in a closed panel, out of
   sight beside the canvas, scrolls the canvas aside to be shown. */
.editor {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: auto minmax(0, 1fr);
  flex: 1 1 0;
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  overflow: clip;
}
/* The bar across the top, the canvas below it; the palette on the left and
   the inspector on the right (LayoutStep), below the bar too. Pinned, one
   lies beside the canvas, and closed is not there; else it lies over the
   canvas, and closed is out of sight. */
.editor-main { display: contents; }
.editor-bar { grid-area: 1 / 1 / 2 / 4; }
.editor-canvas { grid-area: 2 / 2; }
.editor aside { display: flex; flex-direction: column; min-height: 0; padding: 0; overflow: hidden; background: #fff; }
/* The border also unpinned, unseen, so that pinning does not narrow what is in it. */
.editor-palette { width: 230px; border-right: 1px solid transparent; }
.editor-inspector { width: 300px; border-left: 1px solid transparent; }
.editor.palette-pinned .editor-palette { grid-area: 2 / 1; border-right-color: var(--line); }
.editor.inspector-pinned .editor-inspector { grid-area: 2 / 3; border-left-color: var(--line); }
.editor.palette-pinned:not(.palette-open) .editor-palette,
.editor.inspector-pinned:not(.inspector-open) .editor-inspector { display: none; }
.editor:not(.palette-pinned) .editor-palette,
.editor:not(.inspector-pinned) .editor-inspector {
  grid-area: 2 / 2;
  z-index: 20;                 /* over the canvas and its buttons */
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  visibility: hidden;
  transition: transform 0.2s ease, visibility 0s 0.2s;
}
.editor:not(.palette-pinned) .editor-palette { justify-self: start; transform: translateX(-100%); }
.editor:not(.inspector-pinned) .editor-inspector { justify-self: end; transform: translateX(100%); }
.editor.palette-open:not(.palette-pinned) .editor-palette,
.editor.inspector-open:not(.inspector-pinned) .editor-inspector { visibility: visible; transform: none; transition: transform 0.2s ease; }
/* Out of the way while something is dragged out of it, but there: it keeps the pointer. */
.editor.dragging-out .editor-palette { visibility: visible; }
/* The buttons on the canvas beside the inspector over it; those on the left stay there. */
.editor.inspector-open:not(.inspector-pinned) .canvas-actions:not(.plan-actions):not(.rule-actions) { right: 312px; }

/* The head of each: its name, its pin and its ✕; below it, its body scrolls. */
.panel-head {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
  padding: 8px 10px 8px 16px;
  border-bottom: 1px solid var(--line);
}
.panel-title {
  flex: 1;
  font-size: 11px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}
.panel-close, .panel-pin { font-size: 12px; line-height: 1; padding: 6px 6px; border-radius: 5px; color: #666; text-decoration: none; }
.panel-pin[aria-pressed="true"] { background: var(--page); }
.panel-body { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 16px 16px; }

/* The buttons of the bar that show and hide them. */
.panel-toggle { flex: none; white-space: nowrap; }
.editor-bar > .panel-toggle { margin-left: 12px; }
.panel-toggle[aria-expanded="true"] { border-color: var(--navy); background: var(--navy); color: #fff; }

.editor h2 {
  font-size: 11px;
  color: #666;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}
.editor h2:not(:first-child) { margin-top: 22px; }

.palette-type {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 10px;
  user-select: none;
}
.palette-type .name { font-weight: 600; font-size: 13px; }
.palette-type .dim { font-size: 11px; color: #888; margin-top: 3px; }
.palette-type .badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
/* One per wall layout; dragged onto the canvas. */
.preset {
  margin-top: 8px;
  padding: 4px;
  border-radius: 4px;
  cursor: grab;
  touch-action: pan-y;         /* a finger up or down scrolls the panel, sideways it drags (dragOut) */
  transition: background 0.15s;
}
.preset:hover { background: var(--divider); }
.preset.dragging { opacity: 0.4; }
/* Chosen to be placed by clicking on the plan. */
.preset.placing, .element-item.placing { box-shadow: 0 0 0 2px var(--accent); }
/* Its picture to scale (presetPictures), pixel for pixel and in the middle as the components' (component-picture). */
.preset img { display: block; max-width: 100%; height: auto; margin: 0 auto; image-rendering: pixelated; }
/* A module type for another floor. */
.palette-type.disabled .preset { opacity: 0.35; cursor: not-allowed; }
.palette-type.disabled .preset:hover { background: none; }

/* the element that follows the pointer while dragging out of the palette */
.editor-ghost {
  position: fixed; top: 0; left: 0;
  pointer-events: none; z-index: 50;
  background: rgba(255,255,255,0.9);
  border: 3px solid var(--navy);
  opacity: 0.85;
}
.editor-ghost.blocked { background: rgba(229,62,62,0.22); border-color: #e53e3e; }

/* The elements of the palette, by group; dragged into a wall or a module. */
.element-group { border-bottom: 1px solid var(--divider); }
.element-group summary { font-size: 13px; font-weight: 600; padding: 7px 0; cursor: pointer; }
.element-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px;
  padding: 6px 8px;
  margin: 0 0 4px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  cursor: grab;
  touch-action: pan-y;         /* a finger up or down scrolls the panel, sideways it drags (dragOut) */
  user-select: none;
}
.element-item:hover { border-color: var(--navy); }
.element-item.dragging { opacity: 0.4; }
.element-item.opening { border-left: 3px solid var(--navy); }
.element-item.partition { border-left: 3px solid #5d6d7e; }
.element-item.fixture { border-left: 3px solid #9cc3ea; }
.element-item.annotation { border-left: 3px solid #1c64f2; }
.element-item.comment { border-left: 3px solid #e03131; }
.element-item.point { border-left: 3px solid #2f9e44; }
/* Components apart as the project's module types are (.palette-type). */
.element-item.component, .element-item.modules { flex-wrap: wrap; margin-bottom: 10px; }
/* A component's picture, on a line of its own under its name. */
.component-picture { flex-basis: 100%; }
/* Drawn pixel for pixel of the screen (componentPicture), but where the page lays it out a pixel's fraction off
   them, e.g. at 125 %: taken as it is, not smoothed over two pixels, which blurs it. */
.component-picture img { display: block; max-width: 100%; height: auto; margin: 2px auto 0; image-rendering: pixelated; }
.element-item.modules { position: relative; }
/* A module saved: headed by its name and the size and floor of its module types as in Project modules, then its
   picture. The ⋮ sits in the top right corner over the card, so only the name keeps room for it and the badges get
   the full width. */
.element-item.modules .component-head { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.component-head .name { display: block; font-weight: 600; font-size: 13px; padding-right: 22px; overflow-wrap: anywhere; }
.component-head .badges { display: flex; flex-wrap: wrap; gap: 4px; }
/* The name takes what is left of the first line, wrapped there however long. */
.element-name { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
/* Turning and deleting a component: in the menu of the ⋮ in its top right corner, always shown; a component's
   name keeps room for it. */
.element-item.component { position: relative; }
.element-item.component .element-name { padding-right: 20px; }
.row-menu.component-menu { top: 3px; right: 3px; cursor: default; }
.component-menu .act.icon { padding: 3px; font-size: 14px; }
/* A checkbox with its text beside it. */
.check { display: flex; align-items: center; gap: 6px; font-size: 13px; margin: 0 0 10px; }
.element-ghost {
  position: fixed; top: 0; left: 0;
  pointer-events: none; z-index: 50;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.element-ghost.blocked { background: #e53e3e; opacity: 0.6; }
/* Placing by clicking: the picture of the item chosen, beside the pointer over the plan; red where it cannot go. An
   element's symbol larger than in the palette, the picture of a component or a wall layout smaller. */
.placing-picture {
  position: fixed; top: 0; left: 0;
  pointer-events: none; z-index: 50;
  padding: 4px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.placing-picture[hidden] { display: none; }
.placing-picture img { display: block; max-width: 72px; max-height: 56px; width: auto; height: auto; }
.placing-picture.symbol img { width: 32px; height: 32px; max-width: none; max-height: none; }
.placing-picture.blocked { border-color: #e53e3e; background: #fde8e8; }
.placing-picture.blocked img { opacity: 0.5; }

/* The floors, and undo/redo on the right. */
.editor-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.floor-tabs {
  display: flex;
  gap: 2px;
  padding: 0 12px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
}
.undo-redo { display: flex; gap: 6px; padding-right: 12px; flex: none; }
.undo-redo .act { white-space: nowrap; }
@media (max-width: 600px) {
  .undo-label { display: none; }
}
.floor-tabs button {
  border: none;
  background: none;
  padding: 12px 16px;
  font: inherit;
  font-size: 13px;
  color: #666;
  white-space: nowrap;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.floor-tabs button.active { color: var(--navy); font-weight: 600; border-bottom-color: var(--accent); }
.floor-tabs .count { color: #aaa; font-size: 11px; margin-left: 6px; }
/* On tablets and phones the floors as a list instead (see below). */
.floor-select { display: none; }

.editor-canvas { flex: 1; position: relative; min-height: 0; overflow: hidden; }
/* On the canvas, as on a map: multiple selection, and back to the modules
   wherever the view has gone. */
.editor-canvas .canvas-actions { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 6px; }
.canvas-actions .act { white-space: nowrap; box-shadow: 0 1px 4px rgba(0,0,0,0.12); }
/* The selected modules: turned, copied, deleted; top right, by their symbols. */
.editor-canvas .selection-actions { top: 12px; bottom: auto; }
/* Printing and saving the plan: bottom left. */
.editor-canvas .plan-actions { left: 12px; right: auto; }
/* On phones both in the menu of one button, opened upwards, each with its icon. */
.plan-menu { position: relative; }
.plan-menu .row-menu-list { top: auto; bottom: calc(100% + 6px); left: 0; right: auto; min-width: 200px; }
.plan-menu .row-menu-item { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.plan-menu .row-menu-item .lucide { flex: none; width: 16px; height: 16px; margin: 0; }
/* Elements against CROMEX's rules: top left, a red sign, which shows the project listing them. */
.editor-canvas .rule-actions { top: 12px; bottom: auto; left: 12px; right: auto; }
.rule-actions .act { color: var(--danger); }
/* While something takes a while, in place of a button's icon; turned by the
   browser also while the page is busy (a transform only). */
.spinner {
  display: block;
  width: 1em;
  height: 1em;
  margin: 0.1em auto;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spinner 0.7s linear infinite;
  will-change: transform;
}
@keyframes spinner { to { transform: rotate(360deg); } }
.act[aria-busy="true"]:disabled { opacity: 1; }
/* The right button's menu on the plan, where it was pressed. */
.canvas-menu {
  position: absolute;
  z-index: 60;
  min-width: 200px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}
.canvas-menu button {
  display: block;
  width: 100%;
  border: none;
  border-radius: 5px;
  background: none;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  text-align: left;
  color: #222;
  cursor: pointer;
}
.canvas-menu button:hover:not(:disabled), .canvas-menu button.active { background: var(--page); }
.canvas-menu button:disabled { opacity: 0.5; cursor: default; }
.canvas-menu hr { border: none; border-top: 1px solid var(--line); margin: 4px 0; }
/* An element with its symbol, as in the palette. */
.canvas-menu button.with-symbol { display: flex; align-items: center; gap: 8px; }
/* A group of elements: its elements open beside it, on the side where they fit, as high as they are
   (openGroup moves them up into the canvas, and scrolls them only where they are higher than it). */
.canvas-menu-group { position: relative; }
.canvas-menu-group > button { display: flex; align-items: center; }
.canvas-menu .menu-more { margin-left: auto; padding-left: 12px; color: #888; }
.canvas-submenu { top: -7px; left: calc(100% + 6px); overflow-y: auto; overscroll-behavior: contain; }
.canvas-menu.left .canvas-submenu { left: auto; right: calc(100% + 6px); }
/* On phones, as wide as the canvas (openMenu keeps it within it): a group's elements in place of the groups. */
.canvas-menu.stacked { left: 8px; right: 8px; min-width: 0; overflow-y: auto; overscroll-behavior: contain; }
.canvas-menu .menu-back { font-weight: 600; color: var(--navy); border-bottom: 1px solid var(--line); border-radius: 5px 5px 0 0; margin-bottom: 4px; }
/* Its title, above the groups. */
.canvas-menu-title { padding: 6px 10px 8px; font-size: 13px; font-weight: 600; color: var(--navy); border-bottom: 1px solid var(--line); margin-bottom: 4px; }
/* Why something was not done, e.g. no room to turn: top middle, clear of the buttons; clicks go through. */
.canvas-notice {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 280px);
  pointer-events: none; text-align: center;
}
.canvas-notice span, .toast span {
  display: inline-block; padding: 6px 12px; border-radius: 5px; background: var(--navy); color: #fff;
  font-size: 13px; line-height: 1.4; box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}
/* Square: as wide as high, a line (1.2em) and the padding and border (10px) high. */
.canvas-actions .act.icon { width: calc(1.2em + 10px); padding: 4px 0; font-size: 16px; line-height: 1.2; }
/* The X and Y axes, as in AutoCAD; clicks go through to the canvas. The
   editor moves the icon to the origin, which lies at (8, 56) in it. */
.ucs-icon {
  position: absolute; left: -8px; top: -56px; width: 64px; height: 64px;
  pointer-events: none; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}
.ucs-icon .origin { stroke: #666; }
.ucs-icon .x { stroke: #d62828; }
.ucs-icon .y { stroke: #2b9348; }
/* The rulers along the top and the left (rulers.js draws them, as wide as
   here); clicks go through to the canvas. The buttons on the canvas they
   would cover move in. */
.rulers { position: absolute; inset: 0; pointer-events: none; }
.ruler { position: absolute; top: 0; left: 0; display: block; background: rgba(255,255,255,0.6); color: #777; }
.ruler-top { width: 100%; height: 20px; }
.ruler-left { width: 20px; height: 100%; }
.ruler-corner {
  position: absolute; top: 0; left: 0; width: 20px; height: 20px; background: rgba(255,255,255,0.6);
  border-right: 1px solid #777; border-bottom: 1px solid #777; box-sizing: border-box;
}
/* Where the pointer is. */
.ruler-mark { position: absolute; top: 0; left: 0; background: var(--accent); }
.ruler-mark-x { width: 1px; height: 20px; }
.ruler-mark-y { width: 20px; height: 1px; }
.editor-canvas.with-rulers .selection-actions { top: 32px; }
.editor-canvas.with-rulers .rule-actions { top: 32px; left: 32px; }
.editor-canvas.with-rulers .plan-actions { left: 32px; }
.editor-canvas.with-rulers .canvas-notice { top: 32px; }
.editor-stage {
  position: absolute; inset: 0;
  touch-action: none;          /* pan/pinch are handled by Konva, not the browser */
  background-color: #fafbfc;
  background-image:
    linear-gradient(to right, #e8ebef 1px, transparent 1px),
    linear-gradient(to bottom, #e8ebef 1px, transparent 1px);
}

.editor .row { display: flex; gap: 6px; flex-wrap: wrap; }
.editor .row .act { flex: 1; min-width: 62px; }
.component-saved { margin-top: 8px; } /* under the button "Save as component" */
.component-note { margin-top: 8px; } /* under the buttons Save and Cancel */
/* The forms that save what is selected as a component, or move modules to
   another floor, framed as the rooms are; why it was not done at the top. */
.panel-form { border: 1px solid var(--border); border-radius: 5px; padding: 6px 10px 10px; margin: 0; }
.panel-form legend { padding: 0 4px; font-size: 12px; color: var(--navy); }
.panel-form .inspector-warn { margin-bottom: 8px; }
/* Under saving the modules: moving them to another floor; why any cannot go, a line each. */
.module-floor { margin-top: 8px; }
/* Under that, their report, and the floor's; why it was not made above it. */
.report-action { margin-top: 8px; }
.report-action .inspector-warn { margin-bottom: 8px; }
.report-action .row + .row { margin-top: 6px; } /* the floor's, then the project's */
.floor-refusals { margin: 4px 0 0; padding-left: 16px; }

dl.props { font-size: 12px; display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin-bottom: 12px; }
dl.props dt { color: #888; }
dl.props dd { text-align: right; font-variant-numeric: tabular-nums; }
/* A value that is edited, e.g. the module's name: an input in its row. */
dl.props dt { align-self: center; }
dl.props dd input {
  width: 100%;
  height: 26px;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 8px;
  font: inherit;
  text-align: right;
  color: #222;
  background: #fff;
}
dl.props dd input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(36,36,36,0.12); }
/* A number without the arrows that step it, e.g. the assembly number. */
dl.props dd input[type=number] { -moz-appearance: textfield; appearance: textfield; }
dl.props dd input[type=number]::-webkit-inner-spin-button,
dl.props dd input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.inspector-warn { font-size: 12px; line-height: 1.4; color: var(--danger); margin-bottom: 12px; }
dl.props .inspector-warn { grid-column: 1 / -1; margin-bottom: 0; } /* under its row, e.g. the module's name */

/* The walls of the selection as on the canvas: a click chooses a side. Open
   is a thin dashed line; several modules whose sides differ show a grey
   wall; the chosen side is in the accent colour. */
.walls-diagram { position: relative; }
.walls-module { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: #fafbfc; }
.wall-toggle { position: absolute; border: none; background: none; padding: 0; cursor: pointer; }
.wall-toggle::after { content: ''; position: absolute; border: 0 dashed #b0b6be; }
.wall-toggle.top, .wall-toggle.bottom { left: 0; right: 0; height: 18px; }
.wall-toggle.top { top: -9px; }
.wall-toggle.bottom { bottom: -9px; }
.wall-toggle.top::after, .wall-toggle.bottom::after { left: 0; right: 0; top: 8px; border-top-width: 2px; }
.wall-toggle.left, .wall-toggle.right { top: 0; bottom: 0; width: 18px; }
.wall-toggle.left { left: -9px; }
.wall-toggle.right { right: -9px; }
.wall-toggle.left::after, .wall-toggle.right::after { top: 0; bottom: 0; left: 8px; border-left-width: 2px; }
.wall-toggle:not(.open):is(.top, .bottom)::after { top: 6px; border-top-width: 6px; border-top-style: solid; }
.wall-toggle:not(.open):is(.left, .right)::after { left: 6px; border-left-width: 6px; border-left-style: solid; }
/* Every kind of wall alike, a corridor's too. */
.wall-toggle:is(.wall, .corridor)::after { border-color: var(--navy); }
.wall-toggle:hover::after, .wall-toggle.chosen::after { border-color: var(--accent); }
/* A tab per side, from the top clockwise, with what it is, its build-up and
   length, and how it is set. */
.wall-tabs { display: flex; margin-top: 8px; border-bottom: 1px solid var(--line); }
.wall-tabs button {
  flex: 1;
  border: none;
  background: none;
  padding: 7px 2px;
  font: inherit;
  font-size: 12px;
  color: #666;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.wall-tabs button:hover { color: var(--navy); }
.wall-tabs button.active { color: var(--navy); font-weight: 600; border-bottom-color: var(--accent); }
.wall-tabs button.warn { color: var(--danger); }
/* The selected modules and their room, and their walls, floor, roof and
   colours, a tab each, whose content has a frame of its own that the open
   tab joins; the walls have the tabs of their sides inside. */
.inspector-tabs { display: flex; gap: 4px; margin-top: 16px; padding: 0 6px; }
/* Right under the heading of the element selected. */
.editor h2 + .inspector-tabs { margin-top: 0; }
/* As wide as their text, from the left; a long one wraps where the panel is too narrow. */
.inspector-tabs button {
  flex: 0 1 auto;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  background: var(--page);
  padding: 7px 7px;
  font: inherit;
  font-size: 13px;
  color: #666;
  cursor: pointer;
}
.inspector-tabs button:hover { color: var(--navy); }
.inspector-tabs button:disabled { color: #bbb; cursor: default; }
.inspector-tabs button.active {
  position: relative;
  z-index: 1;
  margin-bottom: -1px; /* over the frame's top edge */
  padding-bottom: 8px;
  background: #fff;
  color: var(--navy);
  font-weight: 600;
  box-shadow: inset 0 2px 0 var(--accent);
}
/* A card with a single tab, its heading (h2), as the open tab of the others: what stands against the rules, the
   reference points and the rooms of the project. */
.inspector-tabs h2 {
  position: relative;
  z-index: 1;
  margin: 0 0 -1px;
  padding: 7px 7px 8px;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  background: #fff;
  box-shadow: inset 0 2px 0 var(--accent);
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  text-transform: none;
  letter-spacing: 0;
}
.build-panel {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 10px 4px;
  margin-bottom: 16px;
  background: #fff;
}
.build-panel .swatches { gap: 6px; }
.build-panel dl.props { margin-bottom: 8px; }
/* Several selected, one below the other; so are their rooms. */
.module-entry + .module-entry { border-top: 1px solid var(--divider); padding-top: 8px; }
.editor-inspector .empty { margin-bottom: 10px; }
.build-panel .field-note { margin-bottom: 10px; }
/* Buttons at the end of a tab keep off its frame, as the fields do. */
.build-panel .row { margin-bottom: 8px; }
/* The equipment to add, its number and the button on one line. */
.build-panel .fixture-add { margin-bottom: 10px; }
.build-panel .fixture-add .quantity { width: 48px; }
.wall-panel { padding: 10px 0 4px; }
.wall-presence { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 10px; }
.wall-presence label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--navy); cursor: pointer; }
.wall-presence input { margin: 0; accent-color: var(--accent); cursor: pointer; }
fieldset:disabled .wall-presence :is(label, input) { color: #888; cursor: default; }
/* The wall of the side chosen, and below it every wall of a kind at once, framed apart. */
.wall-side, .walls-all { min-width: 0; border: 1px solid var(--border); border-radius: 5px; padding: 6px 10px 0; margin: 0; }
.wall-side legend, .walls-all legend { padding: 0 4px; font-size: 12px; color: var(--navy); }
.walls-all { margin: 12px 0 10px; }
/* The project's corner posts, framed apart from the gap above them. */
.corner-posts { border: 1px solid var(--border); border-radius: 5px; padding: 6px 10px 0; margin: 0 0 10px; }
.corner-posts legend { padding: 0 4px; font-size: 12px; color: var(--navy); }
/* The build-up of the selected modules, its labels as those of the module's data. */
.editor-inspector .field { gap: 4px; margin-bottom: 10px; }
.editor-inspector .field .label { font-size: 12px; font-weight: 400; color: #888; text-transform: none; letter-spacing: 0; }
/* Its selects and inputs are one height: browsers size them differently from the same padding. */
.editor-inspector .field select, .editor-inspector .field input { height: 33px; font-size: 13px; padding: 6px 8px; }
/* Under the rooms of the selected modules: another room they go into, and beside it a new one. */
.editor-inspector .room-add { flex-direction: row; align-items: stretch; gap: 6px; }
.room-add select { flex: 1; min-width: 0; }
.room-add .act { flex: none; }
/* The note of equipment, and beside it the button that turns it on the plan. */
.part-note-line { display: flex; align-items: flex-start; gap: 6px; }
.part-note-line textarea { flex: 1; min-width: 0; resize: vertical; }
.part-note-line .act.icon { height: 33px; min-width: 34px; padding: 0 8px; font-size: 16px; line-height: 1; }
.editor-inspector textarea { font-size: 13px; }

/* What a module holds, its files, and a part of it. */
.part-list { list-style: none; padding: 0; margin: 0 0 8px; font-size: 12px; }
.part-list li { padding: 5px 0; border-bottom: 1px solid var(--divider); }
.part-list li > .muted { margin-left: 6px; }
.fixture-line { display: flex; align-items: center; gap: 8px; }
.fixture-name { flex: 1; min-width: 0; overflow-wrap: anywhere; text-align: left; }
/* In a list of rooms, beside a room's name: its type and how many modules it has. */
.room-meta { flex: none; color: #888; white-space: nowrap; }
/* An element against CROMEX's rules, beside its name. */
.rule-broken { display: flex; flex: none; color: var(--danger); }
.rule-broken .lucide { width: 16px; height: 16px; margin: 0; }
/* Deleting an element of the module, grey beside the red sign; so is deleting a reference point, dissolving a
   room and taking modules out of one. */
.link.part-remove { color: #888; text-decoration: none; }
/* In the list of elements against the rules: under the name, its module and floor, then why, in red. */
.broken-where { margin: 2px 0 0 28px; color: #888; }
/* The search in the panel on the right: its field as the panel's others, a magnifier at its start, over what it
   finds, each with where it lies. */
.search-panel .list-search { display: block; flex: none; max-width: none; }
.editor-inspector .search-panel .list-search input { padding-left: 32px; }
.search-panel .list-search .lucide { left: 9px; width: 15px; height: 15px; }
.found-where { margin: 2px 0 0 28px; color: #888; }
span.part-symbol { display: flex; align-items: center; justify-content: center; color: var(--navy); }
span.part-symbol .lucide { width: 18px; height: 18px; }
.broken-why { margin: 2px 0 0 28px; line-height: 1.4; color: var(--danger); }
.link.danger { color: var(--danger); text-decoration: none; }
/* A comment and its replies, the replies set in as bubbles of a chat, the user's own blue (as .feed-message). */
.note { padding: 4px 0; margin-bottom: 10px; }
.note.reply { margin-left: 14px; padding: 6px 10px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.note.reply.own { background: #e8f1fd; border-color: #c3d8f5; }
.note-meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #888; margin-bottom: 4px; }
.note-remove { margin-left: auto; color: var(--danger); text-decoration: none; }
.note-text { width: 100%; margin: 0; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
textarea.note-text { padding: 6px 8px; border: 1px solid var(--border); border-radius: 5px; font: inherit; font-size: 13px; resize: vertical; }
/* The numbers of the room's equipment and the line that adds to it, as high as the fields of the inspector. */
.editor-inspector .quantity {
  width: 60px; height: 33px; padding: 0 6px; border: 1px solid var(--border); border-radius: 5px; font: inherit; font-size: 13px;
}
.fixture-add { display: flex; gap: 6px; align-items: stretch; margin-bottom: 4px; }
.fixture-add select {
  flex: 1; min-width: 0; height: 33px; padding: 6px 8px; font: inherit; font-size: 13px;
  border: 1px solid var(--border); border-radius: 5px;
}
.fixture-add .act { padding-top: 0; padding-bottom: 0; }
/* A reference point in the list, as it is drawn on the plan; its colour picked in a field of the inspector. */
.point-symbol { flex: none; width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.5; }
/* An element of a module as the plan draws it (ModuleFixtures). */
.part-symbol { flex: none; width: 20px; height: 20px; object-fit: contain; }
.editor-inspector .field input[type="color"] { width: 64px; padding: 2px; cursor: pointer; }
/* Its note keeps off the button that adds one, as notes under the fields do. */
/* Grouping the elements selected, above saving them as a component. */
.group-actions { margin-bottom: 8px; }
.act.upload { display: inline-block; margin: 4px 0 8px; }
.act.upload.disabled { opacity: 0.4; cursor: default; }
.back-to-module { font-size: 12px; margin-bottom: 12px; }
/* The distances of an element (PartPanel): in a cross, as on the plan; red, nearer than the rules keep it. Its
   tabs, coordinates and distances, as the step's, closer. */
.position-tabs { margin: -4px 0 12px; }
.position-tabs button { padding: 6px 10px; font-size: 12px; }
.distance-cross {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-areas: ". top ." "left . right" ". bottom .";
  align-items: end;
  gap: 4px 8px;
  margin-bottom: 8px;
}
.distance-top { grid-area: top; }
.distance-left { grid-area: left; }
.distance-right { grid-area: right; }
.distance-bottom { grid-area: bottom; }
.distance-cross input.short { border-color: var(--danger); color: var(--danger); font-weight: 600; }
/* On the position tab of an element or a reference point: X and Y side by side. */
.part-position-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.part-position-fields input { width: 100%; }
/* Below X and Y: moved by as much as is entered. */
.part-move { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; margin-bottom: 10px; }
.part-move input { width: 100%; }
/* The button level with the fields, as high as they are. */
.part-move .field { margin-bottom: 0; }
.part-move .act { height: 33px; padding-top: 0; padding-bottom: 0; }

@media (max-width: 1199px) {
  /* The inspector over the canvas as wide as fits; the palette as wide as pinned (230px). */
  .editor:not(.inspector-pinned) .editor-inspector { width: min(300px, 85%); }
  .editor.inspector-open:not(.inspector-pinned) .canvas-actions:not(.plan-actions):not(.rule-actions) {
    right: calc(min(300px, 85%) + 12px);
  }
  /* The module types about as big as on a computer, all at one scale, in the middle of their card. */
  .editor-palette .preset { max-width: 180px; margin-right: auto; margin-left: auto; }

  /* The floors as a list, the buttons of the bar on its right. */
  .editor-bar { padding: 6px 0; }
  .floor-tabs { display: none; }
  .floor-select {
    display: block;
    flex: 0 1 240px;
    min-width: 0;
    margin-right: auto;
    height: 31px;
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 4px 8px;
    font: inherit;
    font-size: 13px;
    color: #222;
    background: #fff;
  }

}

@media (max-width: 699px) {
  /* From nothing, so that a long name never takes the buttons into another row (steps-below). */
  .project-title { flex: 1 1 0; max-width: none; }
  /* The palette over all of the canvas; the inspector a sheet from below. Never pinned (LayoutStep); nor are the
     feed and the history, over the whole window. */
  .panel-pin, .feed-panel .panel-pin { display: none; }
  .editor:not(.palette-pinned) .editor-palette,
  .editor:not(.inspector-pinned) .editor-inspector { width: 100%; }
  .editor:not(.inspector-pinned) .editor-inspector {
    justify-self: stretch;
    align-self: end;
    height: 62%;
    border-left: none;
    border-top: 1px solid var(--line);
    border-radius: 12px 12px 0 0;
    transform: translateY(100%);
  }
  /* The buttons on the canvas above it; those at the top stay there. */
  .editor.inspector-open:not(.inspector-pinned) .canvas-actions:not(.plan-actions):not(.rule-actions) { right: 12px; }
  .editor.inspector-open:not(.inspector-pinned) .canvas-actions:not(.selection-actions):not(.rule-actions) {
    bottom: calc(62% + 12px);
  }
  /* Below the buttons for the selection, as wide as the canvas allows. */
  .canvas-notice { top: 56px; max-width: calc(100% - 24px); }
  .editor-canvas.with-rulers .canvas-notice { top: 76px; }
}

/* ── Review: the inquiry as it is printed or saved as PDF ── */

.report { max-width: 1100px; margin: 0 auto; }
.report-title { border-bottom: 3px solid var(--navy); padding-bottom: 10px; margin-bottom: 14px; }
.report-brand { font-size: 12px; font-weight: 700; letter-spacing: 0.8px; color: var(--accent); }
.report-title h2 { font-size: 18px; color: var(--navy); margin: 4px 0 6px; }
.report-title p { font-size: 13px; line-height: 1.5; }

.summary { border: 1px solid var(--line); border-radius: 8px; padding: 14px; margin-bottom: 10px; }
.summary h3 { font-size: 15px; color: var(--navy); margin-bottom: 6px; }
.detail-head { font-size: 13px; color: var(--navy); margin: 14px 0 2px; }
.line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 0;
  border-bottom: 1px solid var(--divider);
  font-size: 13px;
}
.line span { color: #555; }
.line b { text-align: right; font-weight: 600; }
.line .pre { white-space: pre-line; }

.warnbox, .okbox { border-radius: 8px; padding: 12px 14px; margin: 12px 0; font-size: 13px; line-height: 1.6; }
.warnbox { border: 1px solid #e0b84f; background: #fff9e8; }
.notice { margin: 0 0 12px; }
.notice-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.okbox { border: 1px solid #86bea2; background: #f0faf5; }

.contact-box {
  border: 2px solid var(--navy);
  border-radius: 8px;
  padding: 14px;
  margin-top: 16px;
  background: #f8f9fb;
  font-size: 13px;
  line-height: 1.5;
}
.contact-box h3 { font-size: 15px; color: var(--navy); margin-bottom: 8px; }
.contact-box a { color: var(--navy); }
.contact-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 8px; }
.minihelp { font-size: 11px; color: #666; margin-top: 10px; }

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

/* The arrow of a select, a little away from its right edge: browsers draw their own at the edge, whatever the
   padding. Last, over the padding and background of the selects above; the chevron is Lucide's. */
select:not([multiple]):not([size]) {
  appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 14px;
}

/* Only the inquiry goes on paper. */
/* The plan printed (LayoutStep, printPlan): only it, on a page of its own, filling it. */
.plan-print { display: none; }
@media print {
  body.printing-plan > :not(.plan-print) { display: none !important; }
  body.printing-plan .plan-print { display: flex; flex-direction: column; gap: 3mm; height: 100vh; }
  .plan-print header { display: flex; gap: 4mm; align-items: baseline; font-size: 11pt; }
  .plan-print header span { color: #555; }
  .plan-print img { flex: 1; min-height: 0; width: 100%; object-fit: contain; }
}
@media print {
  .topbar, .page-notice, .project-bar, .notice, .wizard-nav, .toast, .feed-panel, .past-actions { display: none !important; }
  html:has(> body.workspace), body.workspace, .workspace .page, .workspace .card { display: block; height: auto; min-height: 0; overflow: visible; }
  body { background: #fff; }
  .workspace .page, .report { max-width: none; padding: 0; }
  .card { border: 0; padding: 0; }
  .summary { border-color: #b9c8cf; break-inside: avoid; }
  .contact-box { break-inside: avoid; }
}
