/* bulthaup design: tokens from design/tokens.json, light theme only. */
:root {
  --page: #ffffff;
  --surface: #f4f3f3;
  --sunken: #eceae9;
  --line: #dfdddc;
  --line-strong: #988e86;
  --ink: #141414;
  --ink-2: #5e5650;
  --muted: #6e6660;
  --action: #5e5650;
  --on-action: #ffffff;
  --late: #a31212;

  --avatar-1: #5e5650;
  --avatar-2: #405a75;
  --avatar-3: #3f6158;
  --avatar-4: #6b4f5e;
  --avatar-5: #7a5c3e;
  --avatar-6: #4a4e57;
  --avatar-7: #6a5a8a;

  --font-sans: 'Alegreya Sans', sans-serif;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;

  --tap: 44px;
  --hairline: 1px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 17px/24px var(--font-sans);
  font-weight: 400;
  overflow-wrap: anywhere;
}

h1,
h2 {
  font-weight: 300;
  margin: 0;
}

a {
  color: var(--ink-2);
}

a:hover {
  color: var(--ink);
}

button,
input,
textarea,
select {
  font: inherit;
  color: var(--ink);
  border-radius: 0;
}

button,
input,
textarea {
  background: var(--page);
}

.field label,
.installer-form label {
  display: block;
  font-size: 15px;
  font-weight: 500;
  margin-bottom: var(--space-2);
}

.field input {
  width: 100%;
  min-height: var(--tap);
  border: var(--hairline) solid var(--line-strong);
  padding: 0 var(--space-3);
  font-size: 18px;
}

/* Buttons --------------------------------------------------------------- */

button {
  cursor: pointer;
  border: var(--hairline) solid var(--line-strong);
  min-height: var(--tap);
  padding: 0 var(--space-4);
}

button.primary,
.primary {
  background: var(--action);
  color: var(--on-action);
  border: 0;
  font-weight: 500;
  font-size: 17px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button.secondary,
.secondary {
  background: var(--page);
  color: var(--ink-2);
  border: var(--hairline) solid var(--line-strong);
}

.field-error,
.error {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--late);
  font-size: 15px;
  margin: var(--space-2) 0 0;
}

.field-error::before,
.error::before {
  content: '';
  flex: none;
  width: 8px;
  height: 8px;
  background: currentColor;
}

.notice {
  background: var(--surface);
  border: var(--hairline) solid var(--line);
  padding: 14px var(--space-4);
  margin: 0;
  font-size: 16px;
}

/* Avatars ----------------------------------------------------------------- */

.avatar {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--page);
  font-size: 14px;
  font-weight: 500;
}

/* Intro loader -------------------------------------------------------------- */

.intro-loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--page);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  animation: intro-out 0.6s ease 2.2s forwards;
}

.intro-loader-logo {
  width: 168px;
  height: auto;
  opacity: 0;
  animation: intro-in 0.9s ease 0.2s forwards;
}

.intro-loader-bar {
  width: 168px;
  height: 1px;
  background: var(--line);
  display: block;
  opacity: 0;
  animation: intro-in 0.9s ease 0.2s forwards;
}

.intro-loader-fill {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--ink);
  transform-origin: left center;
  transform: scaleX(0);
  animation: intro-fill 1.8s cubic-bezier(0.3, 0.6, 0.3, 1) 0.4s forwards;
}

.intro-loader-credit {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 20px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

@media (min-width: 720px) {
  .intro-loader {
    gap: 24px;
  }

  .intro-loader-logo,
  .intro-loader-bar {
    width: 240px;
  }
}

@keyframes intro-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes intro-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes intro-fill {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .intro-loader-logo,
  .intro-loader-bar {
    animation: none;
    opacity: 1;
  }
  .intro-loader-fill {
    animation: intro-fill 1.2s linear 0.2s forwards;
  }
  .intro-loader {
    animation: intro-out 0.3s linear 1.6s forwards;
  }
}

/* Passcode screen ----------------------------------------------------------- */

.passcode {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  box-sizing: border-box;
  padding: 56px 24px 40px;
  background: var(--page);
}

.passcode-intro {
  display: contents;
}

.passcode-logo {
  display: block;
  width: 116px;
  height: auto;
}

.passcode-intro h1 {
  margin-top: auto;
  font-size: 36px;
  line-height: 40px;
  font-weight: 300;
  letter-spacing: -0.5px;
}

.passcode-panel {
  margin-top: var(--space-8);
  margin-bottom: auto;
}

.passcode-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.passcode-form h2 {
  display: none;
  font-size: 28px;
  font-weight: 300;
}

.passcode-form .primary {
  min-height: 52px;
  font-size: 18px;
  font-weight: 500;
}

.passcode-form .field-row {
  display: flex;
  align-items: stretch;
  height: 52px;
  box-sizing: border-box;
  border: var(--hairline) solid var(--ink);
}

.passcode-form .field-row:has(input[aria-invalid='true']) {
  border-color: var(--late);
}

.field .field-row input {
  flex: 1;
  min-width: 0;
  min-height: 0;
  border: 0;
  padding: 0 14px;
  font-size: 20px;
  letter-spacing: 2px;
  background: transparent;
}

.field-toggle {
  border: 0;
  background: transparent;
  color: var(--ink-2);
  min-width: 88px;
  min-height: 0;
  padding: 0 14px;
  font-size: 15px;
}

@media (min-width: 720px) {
  .passcode {
    flex-direction: row;
    flex-wrap: wrap;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .passcode-intro {
    position: relative;
    flex: 1 1 520px;
    min-width: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 56px 64px;
    background: var(--surface);
  }

  .passcode-logo {
    position: absolute;
    top: 56px;
    left: 64px;
    width: 138px;
  }

  .passcode-intro h1 {
    margin-top: 0;
    max-width: 560px;
    font-size: 64px;
    line-height: 68px;
    letter-spacing: -1px;
  }

  .passcode-panel {
    flex: 1 1 440px;
    min-width: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 56px 64px;
  }

  .passcode-form {
    max-width: 400px;
    gap: var(--space-6);
  }

  .passcode-form h2 {
    display: block;
  }
}

/* App shell ------------------------------------------------------------------ */

.topbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 56px;
  padding: 0 var(--space-2) 0 var(--space-4);
  background: var(--page);
  border-bottom: var(--hairline) solid var(--line);
  flex-wrap: wrap;
}

.topbar-back {
  display: none;
  flex: none;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  color: var(--ink);
}

.topbar-logo {
  width: 88px;
  height: auto;
  display: block;
}

.topbar-nav {
  margin-left: auto;
  display: flex;
  gap: var(--space-1);
}

.topbar-nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 10px;
  font-size: 16px;
  text-decoration: none;
}

.topbar-nav a.current {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--ink);
}

@media (max-width: 719px) {
  #app[data-route='installateurs'] .topbar-back,
  #app[data-route='archives'] .topbar-back {
    display: inline-flex;
  }

  #app[data-route='installateurs'] .topbar-nav,
  #app[data-route='archives'] .topbar-nav {
    display: none;
  }

  #app[data-route='installateurs'] .topbar,
  #app[data-route='archives'] .topbar {
    padding: 0 var(--space-4) 0 var(--space-2);
  }

}

#app {
  min-height: 100vh;
}

#app[data-route='rapports'],
#app[data-route='installateurs'],
#app[data-route='archives'] {
  background: var(--surface);
}

main {
  padding: 20px var(--space-4) var(--space-8);
}

#view-rapports,
#view-archives,
#view-installateurs {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.rapports-title,
.archives-title,
.installateurs-title {
  font-size: 28px;
  line-height: 32px;
  letter-spacing: -0.4px;
}

/* Empty states -------------------------------------------------------------- */

.empty-state {
  background: var(--page);
  border: var(--hairline) solid var(--line);
  padding: var(--space-8) 28px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  color: var(--line-strong);
}

.empty-state svg {
  width: 48px;
  height: 48px;
}

.empty-state p {
  margin: 0;
  font-size: 24px;
  line-height: 28px;
  font-weight: 300;
  color: var(--ink);
}

@media (max-width: 719px) {
  .empty-state {
    background: var(--surface);
    padding: 28px 20px;
    gap: var(--space-2);
  }

  .empty-state svg {
    display: none;
  }

  .empty-state p {
    font-size: 20px;
    font-weight: 500;
  }
}

/* Installers ------------------------------------------------------------------ */

.installer-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.installer-form label {
  margin: 0;
}

.installer-form .field-row {
  display: flex;
  gap: var(--space-2);
}

.installer-form input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  font-size: 17px;
  border: var(--hairline) solid var(--line-strong);
  padding: 0 var(--space-3);
}

.installer-form input[aria-invalid='true'] {
  border-color: var(--late);
}

.installer-form .primary {
  min-height: 48px;
  padding: 0 18px;
}

#installer-form-error {
  margin: 0;
}

.installers {
  list-style: none;
  margin: 0;
  padding: 0;
  border: var(--hairline) solid var(--line);
  background: var(--page);
}

.installer-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 60px;
  padding: 8px var(--space-2) 8px var(--space-4);
  border-top: var(--hairline) solid var(--sunken);
}

.installer-row:first-child {
  border-top: 0;
}

.installer-name {
  flex: 1;
  font-size: 17px;
}

.installer-rename,
.installer-archive {
  border: 0;
  background: none;
  padding: 0 var(--space-2);
  min-height: var(--tap);
  font-size: 16px;
  color: var(--ink-2);
}

.installer-row.is-archived .installer-name {
  color: var(--ink-2);
}

.rename {
  display: flex;
  flex: 1;
  gap: 6px;
  min-width: 0;
  align-items: center;
  padding: var(--space-2) 0;
}

.rename input {
  flex: 1;
  min-width: 0;
  height: 44px;
  border: var(--hairline) solid var(--ink);
  padding: 0 10px;
  font-size: 17px;
}

.rename button {
  padding: 0 var(--space-3);
  font-size: 16px;
}

#archived-installers {
  border-top: var(--hairline) solid var(--line);
  border-bottom: var(--hairline) solid var(--line);
}

summary {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  color: var(--ink-2);
  font-size: 17px;
}

summary::-webkit-details-marker {
  display: none;
}

#archived-installers[open] .archived-chevron {
  transform: rotate(180deg);
}

#archived-installers-list {
  margin: 0 0 var(--space-2);
  border-top: 0;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
}

.installer-row.is-archived {
  min-height: 56px;
  border-top: 0;
}

/* Desktop breakpoint ------------------------------------------------------------- */

@media (min-width: 720px) {
  main {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--space-12) 40px var(--space-16);
  }

  #view-rapports,
  #view-archives,
  #view-installateurs {
    gap: 28px;
  }

  .rapports-title,
  .archives-title,
  .installateurs-title {
    font-size: 44px;
    line-height: 48px;
    letter-spacing: -0.6px;
  }

  .topbar {
    min-height: 64px;
    /* Lines the header up with the 720 px column every artboard centres. */
    padding: 8px max(40px, calc((100% - 720px) / 2));
    gap: var(--space-3) var(--space-6);
  }

  .topbar-nav {
    gap: var(--space-2);
  }

  .topbar-nav a {
    padding: 0 var(--space-3);
    font-size: 17px;
  }

  .topbar-logo {
    width: 110px;
  }

  .topbar-back {
    display: none !important;
  }

  .installer-form .primary {
    padding: 0 var(--space-6);
  }

  .installer-row {
    gap: var(--space-4);
    min-height: 68px;
  }

  .installer-rename,
  .installer-archive {
    min-height: 40px;
    padding: 0 14px;
    border: var(--hairline) solid var(--line);
    background: var(--page);
    font-size: 15px;
  }

  .rename {
    gap: var(--space-2);
    padding: 0;
  }

  .rename input {
    font-size: 18px;
  }

  .rename .primary {
    padding: 0 var(--space-4);
  }

  .rename .secondary {
    border: 0;
  }

  #archived-installers {
    border-top: 0;
  }

  .installer-row.is-archived {
    min-height: 60px;
  }
}

/* Reports: tokens the list, the report and the archives add ------------------- */

:root {
  --pending: #8f4500;
  --pending-bg: #fbeedd;
  --pending-line: #ebcfae;
  --danger: #a31212;
  --danger-bg: #f8e6e6;
  --toast-bg: #141414;
  --toast-action: #e9dccf;
  --skeleton: #eceae9;
}

/* Top bar on the report route ------------------------------------------------- */

.topbar-report {
  display: none;
  flex: 1;
  min-width: 0;
  flex-direction: column;
}

#report-heading-client {
  font-size: 17px;
  line-height: 21px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#report-heading-project {
  font-size: 14px;
  line-height: 18px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#app[data-route='rapport'] .topbar-report {
  display: flex;
}

#app[data-route='rapport'] .topbar-logo,
#app[data-route='rapport'] .topbar-nav {
  display: none;
}

#app[data-route='rapport'] .topbar-back {
  display: inline-flex;
  flex: none;
}

.save-state {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--ink-2);
}

.save-state.is-pending {
  padding: 3px 8px;
  background: var(--pending-bg);
  color: var(--pending);
  font-weight: 500;
}

.save-state.is-pending::before {
  content: '';
  width: 8px;
  height: 8px;
  background: currentColor;
}

/* Building a PDF of a 20-photo report takes a moment; the button says so. */
.pdf-button[aria-busy='true'] {
  opacity: 0.55;
  cursor: progress;
}

/* Unsaved banner --------------------------------------------------------------- */

.banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 6px max(var(--space-2), calc((100% - 720px) / 2 + var(--space-2))) 6px
    max(var(--space-4), calc((100% - 720px) / 2 + var(--space-4)));
  background: var(--pending-bg);
  border-bottom: var(--hairline) solid var(--pending-line);
  color: var(--pending);
  font-size: 15px;
  font-weight: 500;
}

.banner svg {
  flex: none;
}

#unsaved-banner-text {
  flex: 1;
}

.banner-action {
  flex: none;
  border: 0;
  background: transparent;
  padding: 0 var(--space-2);
  color: inherit;
  font-weight: 700;
  font-size: 15px;
  text-decoration: underline;
}

/* List tools -------------------------------------------------------------------- */

#app[data-route='rapport'] {
  background: var(--surface);
}

.list-tools {
  display: flex;
  gap: var(--space-2);
}

.search {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  height: 48px;
  padding: 0 var(--space-1) 0 var(--space-3);
  border: var(--hairline) solid var(--line-strong);
  background: var(--page);
  color: var(--ink-2);
}

.search svg {
  flex: none;
}

.search input {
  flex: 1;
  min-width: 0;
  height: 44px;
  border: 0;
  padding: 0;
  background: transparent;
  font-size: 17px;
}

.search input::-webkit-search-cancel-button {
  display: none;
}

#search-clear {
  flex: none;
  width: 40px;
  height: 40px;
  min-height: 0;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.filters-button {
  flex: none;
  height: 48px;
  min-height: 0;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 14px;
  border: var(--hairline) solid var(--line-strong);
  background: var(--page);
  color: var(--ink-2);
  font-size: 16px;
}

.filters-count {
  min-width: 20px;
  height: 20px;
  background: var(--ink);
  color: var(--page);
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Loading skeleton ---------------------------------------------------------------- */

.skeleton {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skeleton-title {
  display: block;
  height: 30px;
  width: 140px;
  background: #e6e3e1;
}

.skeleton-search {
  display: block;
  height: 48px;
  background: var(--skeleton);
}

.skeleton-card {
  display: block;
  height: 112px;
  border: var(--hairline) solid var(--line);
  background-color: var(--page);
  background-image: linear-gradient(var(--skeleton), var(--skeleton)),
    linear-gradient(var(--skeleton), var(--skeleton)),
    linear-gradient(var(--skeleton), var(--skeleton)),
    linear-gradient(var(--skeleton), var(--skeleton));
  background-size: 45% 18px, 64px 22px, 60% 14px, 120px 24px;
  background-position: 16px 16px, right 16px top 16px, 16px 48px, 16px 74px;
  background-repeat: no-repeat;
}

/* Report cards ---------------------------------------------------------------------- */

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card {
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
}

.card-swipe-action {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 96px;
  border: 0;
  background: var(--action);
  color: var(--on-action);
  font-size: 16px;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.card-sliding {
  position: relative;
  display: block;
  background: var(--page);
  border: var(--hairline) solid var(--line);
  transition: transform 0.18s ease;
}

.card-link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px var(--space-4);
  text-decoration: none;
  color: var(--ink);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.card-client {
  font-size: 18px;
  line-height: 23px;
  font-weight: 500;
}

.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 1px var(--space-2);
  border: var(--hairline) solid var(--line-strong);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
}

.chip.is-done {
  border-color: var(--sunken);
  background: var(--sunken);
  color: var(--ink);
}

.card-place {
  font-size: 16px;
  line-height: 21px;
  color: var(--ink-2);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 15px;
}

.card-date {
  margin-left: auto;
  font-size: 14px;
  color: var(--muted);
}

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

.avatar.is-small {
  width: 26px;
  height: 26px;
  font-size: 12px;
}

.card-pending {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 14px;
  font-weight: 500;
  color: var(--pending);
}

.card-pending::before {
  content: '';
  width: 8px;
  height: 8px;
  background: currentColor;
}

.card-footer {
  display: flex;
  justify-content: flex-end;
  border-top: var(--hairline) solid var(--sunken);
}

.card-action {
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: 0 var(--space-4);
  font-size: 17px;
  font-weight: 500;
  color: var(--ink-2);
}

/* No results ----------------------------------------------------------------------- */

.no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-6);
  text-align: center;
}

.no-results p {
  margin: 0;
  font-size: 17px;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: 16px;
  text-decoration: underline;
  padding: 0 var(--space-3);
}

.empty-state .primary {
  min-height: 52px;
  padding: 0 var(--space-6);
  align-self: center;
  gap: 10px;
  font-size: 18px;
}

/* Floating button and sticky bar ------------------------------------------------------ */

.fab {
  position: fixed;
  right: var(--space-4);
  bottom: var(--space-6);
  height: 56px;
  padding: 0 20px 0 var(--space-4);
  background: var(--action);
  color: var(--on-action);
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 17px;
  font-weight: 500;
  box-shadow: 0 6px 18px rgba(20, 20, 20, 0.18);
}
.skeleton-meta {
  display: block;
  height: 20px;
  width: 180px;
  margin-bottom: var(--space-3);
  background: var(--skeleton);
}

.skeleton-section {
  display: block;
  height: 60px;
  border: var(--hairline) solid var(--line);
  background-color: var(--page);
  background-image: linear-gradient(var(--skeleton), var(--skeleton)),
    linear-gradient(var(--skeleton), var(--skeleton)),
    linear-gradient(var(--skeleton), var(--skeleton));
  background-size: 22px 22px, 45% 18px, 48px 18px;
  background-position: 16px center, 50px center, right 16px center;
  background-repeat: no-repeat;
}

#app[data-route='rapports'] main {
  padding-bottom: 104px;
}

.sign-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  background: var(--page);
  border-top: var(--hairline) solid var(--line);
  padding: var(--space-3) var(--space-4) 20px;
}

#app.is-typing .sign-bar {
  display: none;
}

.sign-bar .primary {
  flex: 1;
  max-width: 720px;
  min-height: 52px;
  font-size: 18px;
}

.sign-bar .primary[disabled] {
  background: var(--sunken);
  color: var(--muted);
  cursor: not-allowed;
}

#app[data-route='rapport'] main {
  padding-bottom: 108px;
}

/* Toast ---------------------------------------------------------------------------- */

.toast {
  position: fixed;
  left: var(--space-4);
  right: var(--space-4);
  bottom: var(--space-6);
  max-width: 720px;
  margin: 0 auto;
  min-height: 56px;
  background: var(--toast-bg);
  color: var(--page);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 0 6px 0 var(--space-4);
  font-size: 16px;
}

#app[data-route='rapports'] .toast {
  bottom: 92px;
}

.toast.is-error #toast-text::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 10px;
  background: #f08a8a;
}

.toast-action {
  flex: none;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--toast-action);
  font-size: 16px;
  font-weight: 700;
}

/* Filters sheet ----------------------------------------------------------------------- */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 20, 0.4);
}

.sheet-panel {
  position: relative;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  background: var(--page);
  border-top: var(--hairline) solid var(--line);
  padding: var(--space-2) var(--space-4) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-height: 90vh;
  overflow-y: auto;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sheet-head h2 {
  font-size: 28px;
  line-height: 32px;
}

.icon-button {
  width: 44px;
  height: 44px;
  min-height: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.filter-installers {
  margin: 0;
  padding: 0;
  border: 0;
  display: flex;
  flex-direction: column;
}

.filter-installers legend {
  padding: 0 0 6px;
  font-size: 15px;
  font-weight: 500;
}

.filter-option {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border-bottom: var(--hairline) solid var(--sunken);
  font-size: 17px;
  cursor: pointer;
}

.filter-option input {
  appearance: none;
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  border: var(--hairline) solid var(--line-strong);
  background: var(--page);
  box-shadow: inset 0 0 0 4px var(--page);
}

.filter-option input:checked {
  border-color: var(--ink);
  background: var(--ink);
}

.filter-status {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#filters-status-label {
  font-size: 15px;
  font-weight: 500;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: var(--hairline) solid var(--line-strong);
  background: var(--page);
}

.segment {
  min-height: 48px;
  border: 0;
  border-left: var(--hairline) solid var(--line-strong);
  background: var(--page);
  color: var(--ink-2);
  font-size: 16px;
  font-weight: 500;
  padding: 0 var(--space-1);
}

.segment:first-child {
  border-left: 0;
}

.segment[aria-pressed='true'] {
  background: var(--ink);
  color: var(--page);
}

.segment[data-answer='problem'][aria-pressed='true'] {
  background: var(--danger);
}

.segment[data-answer='not_applicable'][aria-pressed='true'] {
  background: var(--action);
}

.sheet-actions {
  display: flex;
  gap: var(--space-2);
}

.sheet-actions .primary {
  flex: 1;
  min-height: 52px;
  font-size: 18px;
}

.sheet-actions .secondary {
  min-height: 52px;
}

/* Report page -------------------------------------------------------------------------- */

#view-rapport {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.report-title {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.report-title h1 {
  font-size: 28px;
  line-height: 32px;
  letter-spacing: -0.4px;
}

.report-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 15px;
  color: var(--muted);
}

.report-sections {
  display: flex;
  flex-direction: column;
  border-top: var(--hairline) solid var(--line);
}

.report-section {
  background: var(--page);
  border: var(--hairline) solid var(--line);
  border-top: 0;
}

.report-section h2 {
  margin: 0;
}

.section-head {
  width: 100%;
  min-height: 60px;
  padding: 10px var(--space-3) 10px var(--space-4);
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-align: left;
}

.section-number {
  width: 18px;
  flex: none;
  font-size: 15px;
  color: var(--muted);
}

.section-title {
  flex: 1;
  font-size: 18px;
  line-height: 23px;
  font-weight: 500;
}

.section-state {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
}

.section-state.is-complete {
  color: var(--ink);
}

.section-state.is-alert {
  color: var(--danger);
}

.section-state.is-pending {
  color: var(--pending);
}

.section-state.is-alert::before,
.section-state.is-pending::before {
  content: '';
  width: 8px;
  height: 8px;
  background: currentColor;
}

.section-chevron {
  flex: none;
  color: var(--ink-2);
  transition: transform 0.15s ease;
}

.section-head[aria-expanded='true'] .section-chevron {
  transform: rotate(180deg);
}

.section-body {
  padding: var(--space-1) var(--space-4) 20px;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.section-points {
  padding: var(--space-1) var(--space-3) var(--space-4);
  gap: 10px;
}

.field-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-block label,
.field-label {
  font-size: 15px;
  font-weight: 500;
}

.field-block input,
.field-block textarea {
  width: 100%;
  box-sizing: border-box;
  border: var(--hairline) solid var(--line-strong);
  background: var(--page);
  font-size: 17px;
}

.field-block input {
  height: 52px;
  padding: 0 14px;
}

.field-block textarea {
  padding: 12px 14px;
  line-height: 23px;
  resize: vertical;
}

.field-grid {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: var(--space-2);
}

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

/* iOS Safari gives a date input an intrinsic minimum width and centres its
   value, which pushes it past the edge of a narrow column. */
.field-block input[type='date'] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  min-width: 0;
  text-align: left;
  line-height: 50px;
}

.field-block input[type='date']::-webkit-date-and-time-value {
  text-align: left;
  margin: 0;
  line-height: 50px;
}

.field-block input[aria-invalid='true'] {
  border-color: var(--late);
}

.field-block .field-error {
  align-items: flex-start;
  margin: 0;
  line-height: 20px;
}

.field-block .field-error::before {
  margin-top: 6px;
}

/* Under the narrow postcode column the message runs on below its neighbour
   rather than breaking into three lines. */
.field-grid .field-error {
  white-space: nowrap;
}

/* Installer picker ---------------------------------------------------------------------- */

.picker-toggle {
  height: 52px;
  min-height: 0;
  border: var(--hairline) solid var(--line-strong);
  background: var(--page);
  padding: 0 var(--space-3);
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  font-size: 17px;
}

.picker-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.picker-list {
  border: var(--hairline) solid var(--line);
  border-top: 0;
  display: flex;
  flex-direction: column;
}

.picker-option,
.picker-add {
  min-height: 48px;
  border: 0;
  border-bottom: var(--hairline) solid var(--sunken);
  background: var(--page);
  padding: 0 var(--space-3);
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  font-size: 17px;
}

.picker-option[aria-selected='true'] {
  background: var(--surface);
}

.picker-add {
  color: var(--ink-2);
  border-bottom: 0;
  justify-content: flex-start;
}

.picker-form {
  padding: 10px var(--space-3) var(--space-3);
  background: var(--surface);
}

.picker-form-row {
  display: flex;
  gap: var(--space-2);
}

.picker-form input {
  flex: 1;
  min-width: 0;
  height: 48px;
  border: var(--hairline) solid var(--line-strong);
  padding: 0 var(--space-3);
  font-size: 17px;
}

.picker-form .secondary {
  min-height: 48px;
  border-color: var(--ink);
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
}

.picker-list .error {
  margin: 0 var(--space-3) var(--space-3);
}

/* Control points -------------------------------------------------------------------------- */

.point {
  background: var(--page);
  border: var(--hairline) solid var(--line);
  padding: 14px var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.point.is-problem {
  background: var(--danger-bg);
  border-color: var(--danger);
}

.point-question {
  margin: 0;
  font-size: 17px;
  line-height: 23px;
}

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

.point-custom {
  display: flex;
  gap: 6px;
}

.point-custom input {
  flex: 1;
  min-width: 0;
  height: 48px;
  border: var(--hairline) solid var(--line-strong);
  padding: 0 var(--space-3);
  font-size: 17px;
  background: var(--page);
}

.point-custom .icon-button {
  flex: none;
  width: 48px;
  height: 48px;
  border: var(--hairline) solid var(--line-strong);
  background: var(--page);
}

.secondary.wide {
  width: 100%;
  min-height: 52px;
}

.secondary.wide.point-photo-button {
  min-height: 48px;
  font-size: 16px;
}

.point-photo-button.is-missing {
  border-color: var(--danger);
}

/* Archives ------------------------------------------------------------------------------- */

.card.is-archived .archived-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--page);
  border: var(--hairline) solid var(--line);
  padding: 14px var(--space-3) 14px var(--space-4);
}

.card.is-archived.is-confirming .archived-row {
  border-color: var(--danger);
}

.card.is-archived .card-body {
  flex: 1;
  min-width: 0;
}

.card.is-archived .card-head {
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.card.is-archived .card-date {
  margin-left: 0;
}

.archived-actions {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.archived-actions button {
  min-height: 44px;
  padding: 0 14px;
  font-size: 16px;
}

.danger-link {
  border: 0;
  background: transparent;
  color: var(--danger);
}

.danger-link[disabled] {
  color: var(--line-strong);
  cursor: not-allowed;
}

.danger {
  border: 0;
  background: var(--danger);
  color: var(--page);
  font-weight: 500;
}

.confirm-delete {
  background: var(--danger-bg);
  border: var(--hairline) solid var(--danger);
  border-top: 0;
  padding: 10px var(--space-3) var(--space-3) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.confirm-delete p {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--danger);
}

.confirm-actions {
  display: flex;
  gap: var(--space-2);
}

.confirm-actions button {
  min-height: 44px;
}

/* Photos ------------------------------------------------------------------------------------ */

.photo-area {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.photo-pending-line {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 15px;
  font-weight: 500;
  color: var(--pending);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.photo-tile {
  position: relative;
}

.photo-open {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 0;
  background: var(--sunken);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

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

.photo-band {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 4px 6px;
  background: rgba(20, 20, 20, 0.72);
  color: #ffffff;
  font-size: 12px;
  line-height: 15px;
  display: flex;
  flex-direction: column;
  text-align: left;
}

.photo-caption {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-pending-badge {
  position: absolute;
  left: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  background: var(--pending-bg);
  color: var(--pending);
  font-size: 12px;
  font-weight: 500;
}

.photo-delete {
  position: absolute;
  right: 0;
  top: 0;
  width: var(--tap);
  height: var(--tap);
  padding: 0;
  border: 0;
  background: transparent;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  cursor: pointer;
}

.photo-delete-dot {
  width: 26px;
  height: 26px;
  background: rgba(20, 20, 20, 0.72);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
}

.photo-add-link {
  align-self: flex-start;
  min-height: var(--tap);
  margin: -8px 0 -8px -4px;
  padding: 0 var(--space-1);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  cursor: pointer;
}

.photo-required,
.comment-required {
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 15px;
  font-weight: 500;
  color: var(--danger);
}

.photo-required::before,
.comment-required::before {
  content: '';
  flex: none;
  width: 8px;
  height: 8px;
  background: currentColor;
}

.warning-banner {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  margin: 0;
  padding: var(--space-3) 14px;
  background: var(--pending-bg);
  border: var(--hairline) solid var(--pending-line);
  color: var(--pending);
  font-size: 16px;
  line-height: 21px;
  font-weight: 500;
}

.warning-banner::before {
  content: '';
  flex: none;
  margin-top: 6px;
  width: 8px;
  height: 8px;
  background: currentColor;
}

/* The full-screen photo viewer -------------------------------------------------------------- */

/* The viewer is the app's one dark screen: these are tokens.json's own "dark"
   theme values for ink, ink-2, late, line, surface and line-strong — the app
   stays light-only everywhere else, so nothing else needs them named. */
:root {
  --viewer-ink: #ffffff;
  --viewer-muted: #c9c2bc;
  --viewer-danger: #f08a8a;
  --viewer-border: #3a3633;
  --viewer-field: #1e1d1c;
  --viewer-field-border: #6e6660;
}

.viewer {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--toast-bg);
  color: var(--viewer-ink);
  display: flex;
  flex-direction: column;
}

.viewer-top {
  flex: none;
  height: 60px;
  padding: 0 var(--space-1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.viewer-icon {
  flex: none;
  width: var(--tap);
  height: var(--tap);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--viewer-ink);
  display: flex;
  align-items: center;
  justify-content: center;
}

.viewer-counter {
  color: var(--viewer-muted);
  font-size: 16px;
}

.viewer-delete {
  flex: none;
  min-height: var(--tap);
  padding: 0 var(--space-3);
  border: 0;
  background: transparent;
  color: var(--viewer-danger);
  font-size: 16px;
}

.viewer-stage {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: center;
}

.viewer-stage img {
  width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: var(--tap);
  height: var(--tap);
  padding: 0;
  border: 0;
  background: rgba(20, 20, 20, 0.6);
  color: var(--viewer-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.viewer-prev {
  left: var(--space-1);
}

.viewer-next {
  right: var(--space-1);
}

.viewer-footer {
  flex: none;
  padding: 14px var(--space-4) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: var(--hairline) solid var(--viewer-border);
}

.viewer-context {
  font-size: 15px;
  color: var(--viewer-muted);
}

.viewer-caption-label {
  font-size: 15px;
  font-weight: 500;
}

.viewer-caption-row {
  display: flex;
  gap: var(--space-2);
}

.viewer-caption-row input {
  flex: 1;
  min-width: 0;
  height: 52px;
  border: var(--hairline) solid var(--viewer-field-border);
  background: var(--viewer-field);
  padding: 0 14px;
  color: var(--viewer-ink);
  font-size: 17px;
}

.viewer-save {
  flex: none;
  height: 52px;
  padding: 0 18px;
  border: 0;
  background: var(--toast-action);
  color: var(--ink);
  font-weight: 500;
  font-size: 17px;
}

/* Desktop ---------------------------------------------------------------------------------- */

@media (max-width: 719px) {
  #app[data-route='rapport'] .topbar {
    padding: 0 var(--space-2);
  }
}

@media (min-width: 720px) {
  .rapports-title,
  .report-title h1 {
    font-size: 36px;
    line-height: 40px;
  }

  .archives-title {
    font-size: 44px;
  }

  #app[data-route='rapport'] .topbar-back {
    display: inline-flex !important;
  }

  .fab,
  .toast {
    right: max(var(--space-4), calc((100% - 720px) / 2));
    left: auto;
  }

  #app[data-route='rapports'] .toast,
  .toast {
    left: max(var(--space-4), calc((100% - 720px) / 2));
  }
}

/* The list's empty state is the artboard's: centred, no box, its own button. */
#rapports-empty {
  background: transparent;
  border: 0;
  align-items: center;
  text-align: center;
  gap: 20px;
  padding: 40px var(--space-4) 0;
}

#rapports-empty p {
  font-size: 17px;
  font-weight: 400;
}

/* Signing ------------------------------------------------------------------------------------ */

/* The signing screen and the signed report are the same place as the report as
   far as the top bar is concerned: one chantier, its name and its save state. */
#app[data-route='signature'] .topbar-report {
  display: flex;
}

#app[data-route='signature'] .topbar-logo,
#app[data-route='signature'] .topbar-nav {
  display: none;
}

#app[data-route='signature'] .topbar-back {
  display: inline-flex;
  flex: none;
}

#app[data-route='signature'] {
  background: var(--surface);
}

#app[data-route='signature'] main {
  padding-bottom: 108px;
}

.sign-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sign-page h1 {
  margin: 0;
  font-size: 28px;
  line-height: 32px;
  font-weight: 300;
  letter-spacing: -0.4px;
}

.sign-missing {
  background: var(--danger-bg);
  border: var(--hairline) solid var(--danger);
  display: flex;
  flex-direction: column;
}

.sign-missing-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  padding: 14px var(--space-4) 6px;
  font-size: 17px;
  font-weight: 500;
  color: var(--danger);
}

.sign-missing-title::before {
  content: '';
  width: 8px;
  height: 8px;
  background: currentColor;
}

.sign-missing-list {
  margin: 0;
  padding: 0 0 6px;
  list-style: none;
}

.sign-missing-item {
  width: 100%;
  min-height: 48px;
  padding: 0 var(--space-3) 0 var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  border: 0;
  border-top: var(--hairline) solid #ebc7c7;
  background: transparent;
  font-size: 16px;
  text-align: left;
  color: var(--ink);
}

.sign-missing-item svg {
  flex: none;
  color: var(--danger);
}

.sign-warning {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: var(--space-1) var(--space-2) var(--space-1) var(--space-4);
  background: var(--pending-bg);
  border: var(--hairline) solid var(--pending-line);
  color: var(--pending);
}

.sign-warning::before {
  content: '';
  flex: none;
  width: 8px;
  height: 8px;
  background: currentColor;
}

.sign-warning.is-block {
  align-items: flex-start;
  padding: 14px var(--space-4);
  font-size: 17px;
  line-height: 23px;
  font-weight: 500;
}

.sign-warning.is-block::before {
  margin-top: 7px;
}

.sign-warning-text {
  flex: 1;
  font-size: 16px;
  font-weight: 500;
}

.sign-warning-action {
  flex: none;
  min-height: var(--tap);
  padding: 0 var(--space-2);
  font-size: 16px;
  font-weight: 700;
  color: var(--pending);
  text-decoration: none;
}

.sign-sentence {
  margin: 0;
  padding: var(--space-4);
  background: var(--page);
  border: var(--hairline) solid var(--line);
  font-size: 18px;
  line-height: 26px;
}

/* The two dates share the row evenly; "Code postal / Ville" is the lopsided one. */
.sign-page .field-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sign-page .field-block input[type='date'] {
  height: 52px;
}

.sign-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.sign-pad {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sign-pad-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.sign-pad-label {
  font-size: 15px;
  font-weight: 500;
}

.sign-clear {
  flex: none;
  min-height: var(--tap);
  padding: 0 var(--space-1);
  font-size: 16px;
  color: var(--ink-2);
  text-decoration: underline;
}

.sign-box {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 358 / 180;
  background: var(--page);
  border: var(--hairline) solid var(--line-strong);
}

.sign-baseline {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 44px;
  height: 1px;
  background: var(--line);
}

.sign-start {
  position: relative;
  min-height: var(--tap);
  font-weight: 500;
}

.sign-image {
  display: block;
  width: 100%;
  height: 100%;
}

.sign-pad-actions {
  display: flex;
  flex: none;
}

html.is-signing,
html.is-signing body {
  overflow: hidden;
}

.sign-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: max(var(--space-4), env(safe-area-inset-top)) max(var(--space-4), env(safe-area-inset-right))
    max(var(--space-4), env(safe-area-inset-bottom)) max(var(--space-4), env(safe-area-inset-left));
  background: var(--page);
  color: var(--ink);
  overscroll-behavior: none;
}

.sign-overlay-title {
  font-size: 22px;
  line-height: 28px;
}

.sign-overlay-surface {
  position: relative;
  flex: 1;
  min-height: 0;
  border: var(--hairline) solid var(--line-strong);
}

.sign-overlay-surface .sign-baseline {
  bottom: 28%;
}

.sign-overlay-canvas {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.sign-overlay-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.sign-overlay-clear {
  min-height: var(--tap);
  margin-right: auto;
  padding: 0 var(--space-1);
}

.sign-overlay-actions .secondary,
.sign-overlay-actions .primary {
  min-height: 52px;
  min-width: 112px;
}

.sign-overlay-actions .primary[disabled] {
  background: var(--sunken);
  color: var(--muted);
  cursor: not-allowed;
}

.sign-switch {
  align-self: flex-start;
  min-height: var(--tap);
  padding: 0;
  font-size: 16px;
  color: var(--ink-2);
}

.sign-refusal {
  margin: 0;
  padding: var(--space-1) var(--space-4) var(--space-4);
  background: var(--page);
  border: var(--hairline) solid var(--ink);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.sign-refusal-legend {
  padding: 0;
  float: left;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 17px;
  font-weight: 500;
}

.sign-refusal-cancel {
  min-height: var(--tap);
  font-size: 16px;
  font-weight: 400;
  color: var(--ink-2);
}

.sign-reason {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border-top: var(--hairline) solid var(--sunken);
  font-size: 17px;
}

.sign-reason input,
.annex-author input {
  appearance: none;
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  border: var(--hairline) solid var(--line-strong);
  background: var(--page);
  box-shadow: inset 0 0 0 4px var(--page);
}

.sign-reason input:checked,
.annex-author input:checked {
  border-color: var(--ink);
  background: var(--ink);
}

.sign-refusal .field-block {
  margin-top: var(--space-2);
}

/* "Rapport signé" confirmation ----------------------------------------------------------------- */

#app[data-route='signature'] main:has(.signed-done) {
  padding: 0;
}

.signed-done {
  min-height: calc(100dvh - 57px);
  max-width: 720px;
  margin: 0 auto;
  padding: 56px var(--space-6) var(--space-8);
  background: var(--page);
  display: flex;
  flex-direction: column;
}

@media (min-width: 720px) {
  .signed-done {
    min-height: calc(100dvh - 65px);
  }
}

.signed-done-logo {
  width: 88px;
  height: auto;
  display: block;
}

.signed-done-middle {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
}

.signed-done-mark {
  width: 56px;
  height: 56px;
  background: var(--ink);
  color: var(--page);
  display: flex;
  align-items: center;
  justify-content: center;
}

.signed-done h1 {
  margin: 0;
  font-size: 36px;
  line-height: 40px;
  font-weight: 300;
  letter-spacing: -0.5px;
}

.signed-done-meta {
  margin: 0;
  font-size: 17px;
  line-height: 24px;
  color: var(--ink-2);
}

.signed-done-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.signed-done-actions .primary {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.pdf-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 17px;
}

/* The signed report ---------------------------------------------------------------------------- */

.signed {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.signed-card {
  background: var(--page);
  border: var(--hairline) solid var(--line);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.signed-card h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
}

.signed-card-number {
  color: var(--muted);
  font-weight: 400;
}

.signed-sentence {
  margin: 0;
  font-size: 16px;
  line-height: 23px;
}

.signed-place {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
}

.signature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.signature-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.signature-box {
  height: 96px;
  border: var(--hairline) solid var(--line);
  background: var(--page);
}

.signature-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.signature-figure figcaption {
  font-size: 14px;
  color: var(--muted);
}

.signed-refusal {
  padding: 10px var(--space-3);
  background: var(--sunken);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.signed-refusal-title {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
}

.signed-refusal-comment {
  margin: 0;
  font-size: 15px;
  line-height: 21px;
  color: var(--ink-2);
  white-space: pre-wrap;
}

.signed-infos {
  margin: 0;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 6px var(--space-3);
  font-size: 16px;
  line-height: 21px;
}

.signed-infos dt {
  color: var(--muted);
}

.signed-infos dd {
  margin: 0;
}

.signed-text {
  margin: 0;
  font-size: 16px;
  line-height: 23px;
  white-space: pre-wrap;
}

.signed-points {
  display: flex;
  flex-direction: column;
}

.signed-point {
  padding: 10px 0;
  border-top: var(--hairline) solid var(--sunken);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.signed-point-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.signed-point-question {
  font-size: 15px;
  line-height: 20px;
}

.answer-chip {
  flex: none;
  padding: 1px var(--space-2);
  border: var(--hairline) solid var(--ink);
  font-size: 14px;
  font-weight: 500;
}

.answer-chip[data-answer='not_applicable'],
.answer-chip[data-answer='none'] {
  background: var(--sunken);
  border-color: var(--sunken);
  color: var(--ink-2);
}

.answer-chip[data-answer='problem'] {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--on-action);
}

.signed-point-comment {
  margin: 0;
  padding: var(--space-2) 10px;
  background: var(--danger-bg);
  font-size: 15px;
  line-height: 21px;
  white-space: pre-wrap;
}

/* Annexes --------------------------------------------------------------------------------------- */

.annexes {
  margin-top: var(--space-3);
  border-top: 2px solid var(--ink);
  padding-top: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.annexes h2 {
  margin: 0;
  font-size: 24px;
  line-height: 28px;
  font-weight: 300;
}

.annex {
  background: var(--page);
  border: var(--hairline) solid var(--line);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.annex-titles {
  display: flex;
  flex-direction: column;
}

.annex-title {
  font-size: 16px;
  font-weight: 500;
}

.annex-date {
  font-size: 14px;
  color: var(--muted);
}

.annex-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  font-size: 18px;
}

.annex-sheet .sheet-panel {
  gap: var(--space-4);
}

.annex-sheet-photos {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.annex-sheet-photos .photo-tile img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.annex-pick {
  aspect-ratio: 1 / 1;
  border: var(--hairline) solid var(--line-strong);
  background: var(--page);
  color: var(--ink-2);
  font-size: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.annex-authors {
  margin: 0;
  padding: 0;
  border: 0;
  display: flex;
  flex-direction: column;
}

.annex-authors legend {
  padding: 0 0 6px;
  font-size: 15px;
  font-weight: 500;
}

.annex-author {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border-bottom: var(--hairline) solid var(--sunken);
  font-size: 17px;
}

.annex-sheet .primary.wide {
  min-height: 52px;
  font-size: 18px;
}

.viewer-caption-read {
  font-size: 16px;
  color: var(--viewer-ink);
}


.report-section {
  scroll-margin-top: var(--space-2);
}
