body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: system-ui, sans-serif;
  background: #f3f4f6;
  color: #111827;
}

.card {
  box-sizing: border-box; /* so that the padding is inside the 90vw limit on a phone */
  width: min(424px, 90vw);
  padding: 2rem;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .08);
}

h1 {
  margin: 0 0 1.5rem;
  font-size: 1.5rem;
}

label {
  display: block;
  margin-bottom: 1rem;
  font-size: .9rem;
}

input {
  display: block;
  box-sizing: border-box;
  width: 100%;
  margin-top: .35rem;
  padding: .6rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font: inherit;
}

button {
  width: 100%;
  padding: .7rem;
  border: 0;
  border-radius: 6px;
  background: #2563eb;
  color: #fff;
  font: inherit;
  cursor: pointer;
}

button:disabled {
  opacity: .6;
  cursor: default;
}

.error {
  margin: 0 0 1rem;
  padding: .6rem;
  border-radius: 6px;
  background: #fee2e2;
  color: #991b1b;
}

.success {
  margin: 0;
  color: #166534;
}

/* Application pages: the dashboard uses the full width instead of the centered login card. */
body.app {
  display: block;
}

.app-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}

.app-header h1 {
  margin: 0;
  font-size: 1.25rem;
}

.app-user {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  font-size: .9rem;
}

.app-user form {
  margin: 0;
}

main {
  box-sizing: border-box;
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

/* The dashboard has a sidebar on the left, whose items are the sections of the page. The page fills the window,
   so the sidebar goes down to the bottom of it. */
body.app-dashboard {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
}

.app-layout {
  display: flex;
  flex: 1;
}

.sidebar {
  display: flex;
  flex: 0 0 200px;
  flex-direction: column;
  gap: .25rem;
  padding: 1rem .75rem;
  background: #fff;
  border-right: 1px solid #e5e7eb;
}

.sidebar a {
  padding: .55rem .75rem;
  border-radius: 6px;
  color: #1f2937;
  font-size: .95rem;
  text-decoration: none;
}

.sidebar a:hover {
  background: #f3f4f6;
}

.sidebar a[aria-current="page"] {
  background: #dbeafe;
  color: #1e40af;
  font-weight: 600;
}

.app-layout main {
  flex: 1 1 auto;
  min-width: 0;
}

.card.wide {
  width: 100%;
  box-sizing: border-box;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.toolbar h2 {
  margin: 0;
  font-size: 1.1rem;
}

.table-filter {
  display: block;
  margin: 0 0 .75rem;
  font-size: .9rem;
}

/* The search field above a table, with the "Afficher tout" box beside it when there is one. */
.table-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1rem;
  margin: 0 0 .75rem;
}

.table-filters .table-filter {
  margin: 0;
}

.table-search-label {
  display: block;
  flex: 1 1 14rem;
  margin: 0 0 .75rem;
}

.table-filters .table-search-label {
  margin: 0;
}

.table-search {
  box-sizing: border-box;
  width: 100%;
}

/* A reminder that needs attention: the label carries the meaning, the colour only reinforces it. */
.badge {
  display: inline-block;
  padding: .1rem .45rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-late {
  background: #fee2e2;
  color: #991b1b;
}

.badge-today {
  background: #ffedd5;
  color: #9a3412;
}

/* The number of reminders due, next to "Observations" in the sidebar. */
.nav-count {
  display: inline-block;
  min-width: 1.3rem;
  margin-left: .4rem;
  padding: .05rem .4rem;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  text-align: center;
}

.nav-count[hidden] {
  display: none;
}

.reminder-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: -.25rem 0 1rem;
}

.notice {
  margin: 0 0 1rem;
  padding: .6rem;
  border-radius: 6px;
  background: #dcfce7;
  color: #166534;
}

/* A wide table scrolls inside its box, never the page. The box is the containing block of its
   visually hidden labels, so they do not widen the page. */
.table-wrap {
  position: relative;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}

th,
td {
  padding: .6rem .5rem;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: top;
  /* A long word wraps rather than overflowing its cell. */
  overflow-wrap: break-word;
}

th {
  color: #6b7280;
  font-weight: 600;
  white-space: nowrap;
}

/* The buttons of a row have the same width and stay side by side when there is room. width: 1% shrinks the cell to
   its content, so that a long remark does not squeeze the buttons onto two lines. A row with three buttons only
   does this on a wide screen: on a tablet they wrap, as the table would otherwise scroll sideways. On a phone each
   row is a block and the buttons wrap (see the last media query). */
.row-actions {
  text-align: right;
}

@media (min-width: 721px) {
  .row-actions:not(:has(button:nth-of-type(3))) {
    width: 1%;
    white-space: nowrap;
  }
}

@media (min-width: 1100px) {
  .row-actions {
    width: 1%;
    white-space: nowrap;
  }
}

.row-actions button {
  width: 6.5rem;
  margin: .15rem 0 .15rem .25rem;
}

.empty {
  color: #6b7280;
  text-align: center;
}

.btn-inline {
  width: auto;
  padding: .45rem .9rem;
}

button.secondary {
  background: #fff;
  color: #1f2937;
  border: 1px solid #d1d5db;
}

button.danger {
  background: #fff;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* A checkbox keeps its size and sits beside its label text. */
input[type="checkbox"] {
  display: inline;
  width: auto;
  margin: 0 .5rem 0 0;
  vertical-align: middle;
}

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

dialog {
  box-sizing: border-box;
  width: min(480px, 90vw);
  padding: 1.5rem;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .2);
}

/* The confirmation dialog is narrower than the forms. */
#confirm-dialog {
  width: min(380px, 90vw);
}

#confirm-dialog p {
  margin: 0 0 1.25rem;
}

button.confirm-ok {
  background: #b91c1c;
  color: #fff;
  border: 1px solid #b91c1c;
}

.dialog-wide {
  width: min(720px, 90vw);
}

/* The follow-up of a prospect: one block per observation, with the whole remark and its line breaks. */
.follow-list {
  position: relative; /* the offsetParent of its items, to measure where the 6th one starts */
  list-style: none;
  margin: 0 0 1rem;
  padding: 0 .5rem 0 0; /* room for the scrollbar, which would cover the buttons */
  max-height: 60vh; /* a fallback: the page script limits the list to 5 observations */
  overflow-y: auto;
}

.follow-list li {
  padding: .75rem 0;
  border-bottom: 1px solid #e5e7eb;
}

.follow-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1rem;
  color: #6b7280;
  font-size: .85rem;
}

/* The edit and delete buttons stay together, at the end of the line of the date or under it. */
.follow-actions {
  display: flex;
  gap: .35rem;
  margin-left: auto;
}

.follow-actions button {
  width: 6rem;
  padding: .2rem .6rem;
  font-size: .85rem;
}

.follow-remark {
  margin: .35rem 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

dialog::backdrop {
  background: rgba(17, 24, 39, .5);
}

dialog h2 {
  margin: 0 0 1rem;
  font-size: 1.2rem;
}

textarea,
select {
  display: block;
  box-sizing: border-box;
  width: 100%;
  margin-top: .35rem;
  padding: .6rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  font: inherit;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
}

.muted {
  color: #6b7280;
  font-size: .9rem;
}

/* The agenda: the controls, then the days as a grid (month, week) or a list (planning). */
.agenda-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1rem;
  margin-bottom: 1rem;
}

.agenda-nav {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
}

.agenda-arrow {
  padding-inline: .8rem;
  font-size: 1.1rem;
  line-height: 1;
}

.agenda-title {
  margin: 0 0 0 .5rem;
  font-size: 1.05rem;
}

/* The month names are in lower case: only the first letter of the title is raised ("Octobre 2026"). */
.agenda-title::first-letter {
  text-transform: uppercase;
}

.agenda-year {
  margin: 0;
}

.agenda-year label {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0;
}

.agenda-year select {
  width: auto;
  margin: 0;
  padding: .4rem .5rem;
}

.agenda-views {
  display: flex;
  gap: .25rem;
}

.agenda-views button[aria-pressed="true"] {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1e40af;
  font-weight: 600;
}

.agenda-weekdays,
.agenda-month,
.agenda-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.agenda-weekdays span {
  padding: .35rem .5rem;
  color: #6b7280;
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
}

.agenda-month,
.agenda-week {
  border-top: 1px solid #e5e7eb;
  border-left: 1px solid #e5e7eb;
}

.agenda-day {
  box-sizing: border-box;
  cursor: pointer;
  min-width: 0;
  padding: .3rem;
  border-right: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
}

.agenda-month .agenda-day {
  min-height: 6.5rem;
}

.agenda-week .agenda-day {
  min-height: 14rem;
}

.agenda-day.is-outside {
  background: #f9fafb;
}

.agenda-day.is-outside .agenda-day-num {
  color: #9ca3af;
}

.agenda-day-head {
  margin: 0 0 .25rem;
  font-size: .8rem;
  font-weight: 600;
}

/* A click anywhere on a day adds an observation to it; the number of the day is the button for the keyboard. */
.agenda-day:hover {
  background: #f9fafb;
}

.agenda-day.is-outside:hover {
  background: #f3f4f6;
}

.agenda-day-add {
  width: auto;
  min-height: 0;
  padding: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
}

/* The grid shows the number of the day under the names of the weekdays; the full name is for the list. */
.agenda-month .agenda-day-label,
.agenda-week .agenda-day-label {
  display: none;
}

.agenda-day.is-today .agenda-day-num {
  display: inline-block;
  min-width: 1.5rem;
  padding: .1rem;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  text-align: center;
}

.agenda-event {
  display: block;
  width: 100%;
  margin: 0 0 .2rem;
  padding: .2rem .4rem;
  overflow: hidden;
  background: #dbeafe;
  color: #1e3a8a;
  font-size: .78rem;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agenda-event:hover {
  background: #bfdbfe;
}

/* A processed observation is greyed out. */
.agenda-event.is-done {
  background: #e5e7eb;
  color: #6b7280;
  text-decoration: line-through;
}

.agenda-prospect {
  font-weight: 600;
}

.agenda-remark {
  display: none;
}

/* The planning: one line per day that has reminders, with the whole remark. */
.agenda-planning .agenda-day {
  display: grid;
  grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr);
  gap: .5rem 1rem;
  padding: .75rem .25rem;
  border-right: 0;
}

.agenda-planning .agenda-day-head {
  font-size: .9rem;
}

.agenda-planning .agenda-day .agenda-day-num {
  display: none;
}

.agenda-planning .agenda-event {
  font-size: .9rem;
  white-space: normal;
}

.agenda-planning .agenda-remark {
  display: inline;
  color: #374151;
}

.agenda-planning .is-done .agenda-remark {
  color: inherit;
}

.agenda-empty {
  margin: 1rem 0 0;
}

/* The dots and the detail of a day are for the month on a phone (see the media query below). */
.agenda-dots,
.agenda-detail {
  display: none;
}

.agenda-detail h4 {
  margin: 0 0 .5rem;
  font-size: .95rem;
}

.agenda-detail .agenda-event {
  margin-bottom: .35rem;
}

.agenda-detail .agenda-add {
  width: auto;
  margin-top: .25rem;
}

/* A tablet in portrait (and anything narrower): the sidebar becomes a bar above the page, which gives the table
   the whole width. */
@media (max-width: 900px) {
  .app-layout {
    flex-direction: column;
  }

  .sidebar {
    flex: none;
    flex-direction: row;
    padding: .5rem 1rem;
    border-right: 0;
    border-bottom: 1px solid #e5e7eb;
  }

  .card {
    padding: 1.25rem;
  }

  /* An auto margin would size main to its content in a column, so a long word could push it past the screen. */
  .app-layout main {
    width: 100%;
    margin: 0;
  }
}

/* On a phone each observation becomes a block, with the column names in front of the values. */
@media (max-width: 720px) {
  thead {
    display: none;
  }

  table,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  tr {
    padding: .5rem 0;
    border-bottom: 1px solid #e5e7eb;
  }

  td {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .25rem 0;
    border: 0;
    text-align: right;
    /* Cells are blocks here, so a long email or word can break anywhere without squeezing a table column. */
    overflow-wrap: anywhere;
  }

  td::before {
    flex: none;
    content: attr(data-label);
    color: #6b7280;
    font-weight: 600;
    text-align: left;
  }

  td.empty {
    display: block;
    text-align: center;
  }

  .row-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .5rem;
  }

  .row-actions button {
    margin: 0;
  }

  dialog {
    padding: 1rem;
  }

  /* The agenda on a phone. The month stays a grid of seven columns, but compact: a number and a dot per reminder,
     and the reminders of the day touched are listed under the grid (a script fills .agenda-detail). The week is a
     list of its seven days, empty ones included, and the planning a list of the days that have reminders. */
  .agenda-weekdays-week {
    display: none;
  }

  .agenda-weekdays span {
    padding: .25rem 0;
    font-size: .7rem;
    text-align: center;
  }

  .agenda-month .agenda-day {
    min-height: 3.1rem;
    padding: .25rem 0;
    text-align: center;
  }

  .agenda-month .agenda-events {
    display: none;
  }

  .agenda-month .agenda-day.is-selected {
    background: #dbeafe;
  }

  .agenda-month .agenda-dots {
    display: flex;
    justify-content: center;
    gap: 3px;
    margin-top: .2rem;
  }

  .agenda-month .agenda-dots i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #2563eb;
  }

  .agenda-detail {
    display: block;
    margin-top: 1rem;
  }

  .agenda-week {
    display: block;
    border-left: 0;
  }

  .agenda-week .agenda-day,
  .agenda-planning .agenda-day {
    display: block;
    min-height: 0;
    padding: .6rem .25rem;
    border-right: 0;
  }

  .agenda-week .agenda-day-label,
  .agenda-planning .agenda-day-label {
    display: inline;
  }

  .agenda-week .agenda-day .agenda-day-num {
    display: none;
  }

  .agenda-week .agenda-day:not(.has-events) .agenda-events::after {
    content: "Aucun rappel";
    color: #9ca3af;
    font-size: .85rem;
  }

  .agenda-day.is-today .agenda-day-label,
  .agenda-detail h4 {
    color: #2563eb;
  }

  .agenda-event {
    font-size: .85rem;
    white-space: normal;
  }

  .agenda-remark {
    display: inline;
  }

  .agenda-nav,
  .agenda-views {
    flex-wrap: wrap;
  }

  .app-header {
    padding: .75rem 1rem;
  }

  main {
    padding: 1rem .75rem;
  }
}

/* Fingers need bigger targets than a mouse pointer. */
@media (pointer: coarse) {
  button {
    min-height: 2.5rem;
  }

  .follow-actions button {
    min-height: 2.25rem;
  }

  input[type="checkbox"] {
    width: 1.35rem;
    height: 1.35rem;
  }

  .sidebar a {
    padding: .7rem .9rem;
  }
}

/* Links that look like buttons (the CSV exports). */
a.button {
  display: inline-block;
  box-sizing: border-box;
  border-radius: 6px;
  text-align: center;
  text-decoration: none;
  font: inherit;
  line-height: 1.3;
}

a.button.secondary {
  background: #fff;
  color: #1f2937;
  border: 1px solid #d1d5db;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

/* The summary above the observations table: each card is a filter, the last one a link to the prospects. */
.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: .75rem;
  margin: 0 0 1rem;
}

.summary-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .1rem;
  box-sizing: border-box;
  width: 100%;
  padding: .6rem .8rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.summary-card strong {
  font-size: 1.5rem;
  line-height: 1.1;
}

.summary-card span {
  font-size: .8rem;
  color: #6b7280;
}

.summary-card:hover {
  border-color: #93c5fd;
}

.summary-card[aria-pressed="true"] {
  background: #dbeafe;
  border-color: #2563eb;
}

.summary-late strong {
  color: #b91c1c;
}

.summary-today strong {
  color: #9a3412;
}

/* Sortable column headers. */
.th-sort {
  width: auto;
  padding: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  text-align: left;
  cursor: pointer;
}

.th-sort::after {
  content: "\2195";
  margin-left: .3rem;
  opacity: .35;
}

th[aria-sort="ascending"] .th-sort::after {
  content: "\2191";
  opacity: 1;
}

th[aria-sort="descending"] .th-sort::after {
  content: "\2193";
  opacity: 1;
}

.load-more td {
  text-align: center;
}

.badge-shared {
  background: #e0e7ff;
  color: #3730a3;
}

/* A prospect row with four buttons wraps below 1300px, so that the table never scrolls sideways. */
@media (min-width: 721px) and (max-width: 1299px) {
  .row-actions-owner {
    white-space: normal;
    width: auto;
  }
}

.share-list,
.import-list {
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.share-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .4rem 0;
  border-bottom: 1px solid #e5e7eb;
}

.import-list {
  max-height: 10rem;
  overflow-y: auto;
  font-size: .85rem;
}

.shortcuts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .4rem 1rem;
  margin: 0 0 1rem;
}

.shortcuts dt,
.shortcuts dd {
  margin: 0;
}

kbd {
  padding: .1rem .45rem;
  border: 1px solid #d1d5db;
  border-bottom-width: 2px;
  border-radius: 4px;
  font: inherit;
  font-size: .85rem;
}

.help-button {
  width: 2rem;
  padding: .3rem 0;
}

.account-card {
  max-width: 32rem;
}

/* Request feedback: a thin bar at the top while something loads, toasts for the result. */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  height: 3px;
  background: linear-gradient(90deg, transparent, #2563eb, transparent);
  background-size: 40% 100%;
  background-repeat: no-repeat;
  animation: progress-slide 1s linear infinite;
}

.progress[hidden] {
  display: none;
}

@keyframes progress-slide {
  from { background-position: -40% 0; }
  to { background-position: 140% 0; }
}

button.htmx-request {
  cursor: progress;
}

.toast-region {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  max-width: min(24rem, calc(100vw - 2rem));
}

.toast {
  padding: .7rem 1rem;
  border-radius: 8px;
  background: #1f2937;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
  font-size: .9rem;
}

.toast-error {
  background: #b91c1c;
}

@media (prefers-reduced-motion: reduce) {
  .progress {
    animation: none;
    background-size: 100% 100%;
  }
}

/* Dark theme, from the system setting. */
/* The partners board: the three phases of the pipeline side by side, stacked on a phone. */
.board-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

.board-column {
  box-sizing: border-box;
  padding: .75rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
}

.board-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .1rem .75rem;
}

.board-header h3 {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0;
  font-size: 1.05rem;
}

.board-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  font-size: .85rem;
}

.board-detail {
  margin: 0;
  color: #6b7280;
  font-size: .85rem;
}

.board-hint {
  margin: .35rem 0 .75rem;
  font-size: .8rem;
}

.board-cards {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.board-cards .empty {
  padding: .5rem 0;
  text-align: center;
}

.board-empty {
  margin: 0 0 1rem;
}

.partner-card {
  padding: .7rem .8rem;
  border: 1px solid #d1d5db;
  border-left: 4px solid #94a3b8;
  border-radius: 6px;
  background: #fff;
  overflow-wrap: anywhere;
}

.partner-meeting {
  border-left-color: #2563eb;
}

.partner-partner {
  border-left-color: #16a34a;
}

.partner-declined {
  border-left-color: #9ca3af;
  opacity: .85;
}

.partner-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .25rem .5rem;
}

.partner-company {
  color: #4b5563;
  font-size: .9rem;
}

.partner-meta,
.partner-contact {
  display: flex;
  flex-wrap: wrap;
  gap: .15rem .75rem;
  margin-top: .3rem;
  color: #6b7280;
  font-size: .85rem;
}

.partner-meeting-line {
  margin-top: .3rem;
  font-size: .9rem;
}

.partner-notes {
  margin: .4rem 0 0;
  color: #374151;
  font-size: .85rem;
  white-space: pre-wrap;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.partner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .6rem;
}

.partner-actions button {
  width: auto;
  padding: .3rem .7rem;
  font-size: .85rem;
}

.badge-channel {
  background: #f3f4f6;
  color: #374151;
}

.badge-partner {
  background: #dcfce7;
  color: #166534;
}

.badge-declined {
  background: #e5e7eb;
  color: #4b5563;
}

/* Two fields side by side in a form, one under the other on a phone. */
.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 .75rem;
}

.form-row[hidden] {
  display: none;
}

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

@media (max-width: 520px) {
  .form-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Blue theme: shades of blue for the chrome (header, sidebar, tables, buttons, cards). Red and orange stay for
   the reminders that need attention. These rules come last on purpose: they override the neutral greys above. */
:root {
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-300: #93c5fd;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-800: #1e40af;
  --blue-900: #1e3a8a;
  --sky-100: #e0f2fe;
  --indigo-100: #e0e7ff;
}

body {
  background: linear-gradient(160deg, #e6f0ff 0%, #f4f8ff 55%, #dbeafe 100%) fixed;
  color: #0f2447;
}

h1,
h2,
h3 {
  color: var(--blue-900);
}

a {
  color: var(--blue-700);
}

.card {
  border: 1px solid var(--blue-200);
  border-top: 3px solid var(--blue-600);
  box-shadow: 0 4px 16px rgba(30, 64, 175, .1);
}

.app-header {
  background: linear-gradient(90deg, var(--blue-900), var(--blue-700) 60%, var(--blue-500));
  color: #fff;
  box-shadow: 0 2px 8px rgba(30, 58, 138, .35);
}

.app-header h1,
.app-header a {
  color: #fff;
}

.app-header button.secondary {
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .55);
  color: #fff;
}

.app-header button.secondary:hover {
  background: rgba(255, 255, 255, .25);
}

.sidebar {
  background: linear-gradient(180deg, var(--blue-50), var(--blue-100));
  border-right: 1px solid var(--blue-200);
}

.sidebar a {
  color: var(--blue-900);
}

.sidebar a:hover {
  background: var(--blue-200);
}

.sidebar a[aria-current="page"] {
  background: var(--blue-600);
  color: #fff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, .35);
}

button {
  background: var(--blue-600);
}

button:hover:not(:disabled) {
  background: var(--blue-700);
}

button.secondary {
  background: var(--blue-50);
  color: var(--blue-800);
  border-color: var(--blue-300);
}

button.secondary:hover:not(:disabled) {
  background: var(--blue-100);
}

button.danger {
  background: #fff;
  color: #b91c1c;
  border-color: #fecaca;
}

button.danger:hover:not(:disabled) {
  background: #fee2e2;
}

a.button.secondary {
  background: var(--blue-50);
  color: var(--blue-800);
  border-color: var(--blue-300);
}

input,
textarea,
select {
  border-color: var(--blue-300);
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--blue-500);
  outline-offset: 1px;
  border-color: var(--blue-600);
}

dialog {
  border-top: 4px solid var(--blue-600);
}

dialog h2 {
  color: var(--blue-900);
}

table {
  border: 1px solid var(--blue-200);
  border-radius: 6px;
}

th {
  background: var(--blue-100);
  color: var(--blue-900);
  border-bottom: 2px solid var(--blue-300);
}

td {
  border-bottom-color: var(--blue-100);
}

tbody tr:nth-child(even) {
  background: #f5f9ff;
}

tbody tr:hover {
  background: var(--blue-50);
}

.muted,
.empty,
.board-detail {
  color: #4a638f;
}

.summary-card {
  background: var(--blue-50);
  border: 1px solid var(--blue-200);
  border-left: 4px solid var(--blue-500);
  color: var(--blue-900);
}

.summary-card span {
  color: #4a638f;
}

.summary-card:hover {
  border-color: var(--blue-500);
  background: var(--blue-100);
}

.summary-card[aria-pressed="true"] {
  background: var(--blue-600);
  border-color: var(--blue-800);
  color: #fff;
}

.summary-card[aria-pressed="true"] span,
.summary-card[aria-pressed="true"] strong {
  color: #fff;
}

.badge-shared {
  background: var(--blue-200);
  color: var(--blue-900);
}

.badge-channel {
  background: var(--sky-100);
  color: #075985;
}

.badge-partner {
  background: var(--blue-700);
  color: #fff;
}

.badge-declined {
  background: #e2e8f0;
  color: #475569;
}

.board-column {
  background: var(--blue-50);
  border: 1px solid var(--blue-200);
  border-top: 4px solid var(--blue-500);
}

.board-column-1 {
  background: #f0f9ff;
  border-top-color: #0ea5e9;
}

.board-column-1 .board-step {
  background: #0ea5e9;
}

.board-column-2 {
  border-top-color: var(--blue-600);
}

.board-column-3 {
  background: #eef2ff;
  border-top-color: var(--blue-900);
}

.board-column-3 .board-step {
  background: var(--blue-900);
}

.partner-card {
  background: #fff;
  border-color: var(--blue-200);
  border-left-color: var(--blue-300);
  box-shadow: 0 1px 3px rgba(30, 64, 175, .1);
}

.partner-potential {
  border-left-color: #0ea5e9;
}

.partner-meeting {
  border-left-color: var(--blue-600);
}

.partner-partner {
  border-left-color: var(--blue-900);
}

.partner-declined {
  border-left-color: #94a3b8;
}

.partner-company,
.partner-notes {
  color: #2c4a7c;
}

.agenda-event {
  background: var(--blue-100);
  color: var(--blue-900);
}

.agenda-event:hover {
  background: var(--blue-200);
}

.agenda-views button[aria-pressed="true"] {
  background: var(--blue-600);
  border-color: var(--blue-800);
  color: #fff;
}

.agenda-weekdays span {
  color: var(--blue-800);
}

.agenda-day {
  border-color: var(--blue-200);
}

.agenda-day:hover {
  background: var(--blue-50);
}

.agenda-day.is-outside {
  background: #f5f9ff;
}

.toast {
  background: var(--blue-900);
  color: #fff;
}

.toast-error {
  background: #b91c1c;
}

.progress {
  background: var(--blue-600);
}

button.confirm-ok {
  background: var(--blue-700);
  border-color: var(--blue-700);
}

kbd {
  background: var(--blue-50);
  border-color: var(--blue-300);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
  }

  body {
    background: #0f172a;
    color: #e5e7eb;
  }

  .card,
  .app-header,
  .sidebar,
  dialog,
  .summary-card,
  button.secondary,
  button.danger,
  a.button.secondary,
  select {
    background: #1e293b;
    color: #e5e7eb;
  }

  input,
  select,
  button.secondary,
  a.button.secondary,
  .summary-card,
  kbd {
    border-color: #475569;
  }

  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="date"],
  input[type="search"],
  input[type="password"],
  input[type="file"],
  textarea {
    background: #0f172a;
    color: #e5e7eb;
  }

  .sidebar,
  .sidebar a,
  .sidebar a[aria-current="page"] {
    color: #e5e7eb;
  }

  .sidebar a:hover,
  .agenda-day:hover,
  .agenda-day.is-outside,
  .agenda-day.is-outside:hover {
    background: #334155;
  }

  .sidebar a[aria-current="page"],
  .agenda-views button[aria-pressed="true"],
  .summary-card[aria-pressed="true"],
  .agenda-month .agenda-day.is-selected {
    background: #1e3a8a;
    border-color: #3b82f6;
    color: #dbeafe;
  }

  .sidebar,
  th,
  td,
  tr,
  .follow-list li,
  .share-list li,
  .agenda-week,
  .agenda-day {
    border-color: #334155;
  }

  th,
  .empty,
  .muted,
  .follow-meta,
  .agenda-weekdays span,
  .summary-card span,
  td::before {
    color: #94a3b8;
  }

  .error,
  .badge-late {
    background: #7f1d1d;
    color: #fecaca;
  }

  .badge-today {
    background: #7c2d12;
    color: #fed7aa;
  }

  .badge-shared {
    background: #312e81;
    color: #c7d2fe;
  }

  .notice {
    background: #14532d;
    color: #bbf7d0;
  }

  button.danger {
    color: #fca5a5;
    border-color: #7f1d1d;
  }

  .summary-late strong {
    color: #fca5a5;
  }

  .summary-today strong {
    color: #fdba74;
  }

  .agenda-event {
    background: #1e3a8a;
    color: #dbeafe;
  }

  .agenda-event:hover {
    background: #1d4ed8;
  }

  .agenda-event.is-done {
    background: #334155;
    color: #94a3b8;
  }

  .agenda-planning .agenda-remark {
    color: #cbd5e1;
  }

  dialog::backdrop {
    background: rgba(0, 0, 0, .65);
  }
}

@media (prefers-color-scheme: dark) {
  .board-column {
    background: #162033;
    border-color: #334155;
  }

  .partner-card {
    background: #1e293b;
    border-color: #475569;
  }

  .partner-company,
  .partner-notes {
    color: #cbd5e1;
  }

  .partner-meta,
  .partner-contact,
  .board-detail {
    color: #94a3b8;
  }

  .badge-channel {
    background: #334155;
    color: #e2e8f0;
  }

  .badge-partner {
    background: #14532d;
    color: #bbf7d0;
  }

  .badge-declined {
    background: #334155;
    color: #cbd5e1;
  }
}

/* Dark theme of the blue theme: deep navy surfaces, bright blue accents. */
@media (prefers-color-scheme: dark) {
  :root {
    --blue-50: #172554;
    --blue-100: #1e3a8a;
    --blue-200: #1e40af;
    --blue-300: #3b82f6;
  }

  body {
    background: linear-gradient(160deg, #0b1330 0%, #0f1b3d 60%, #0a1228 100%) fixed;
    color: #e0eaff;
  }

  h1,
  h2,
  h3,
  dialog h2,
  .sidebar a {
    color: #dbeafe;
  }

  a {
    color: #93c5fd;
  }

  .card,
  dialog {
    background: #12204a;
    border-color: #1e40af;
    border-top-color: #3b82f6;
  }

  .app-header {
    background: linear-gradient(90deg, #0b1b4d, #1e3a8a 60%, #1d4ed8);
  }

  .sidebar {
    background: linear-gradient(180deg, #0f1c44, #0b1534);
    border-right-color: #1e3a8a;
  }

  .sidebar a:hover {
    background: #1e3a8a;
  }

  .sidebar a[aria-current="page"] {
    background: #2563eb;
    color: #fff;
  }

  button.secondary,
  a.button.secondary {
    background: #172554;
    color: #bfdbfe;
    border-color: #3b82f6;
  }

  button.secondary:hover:not(:disabled) {
    background: #1e3a8a;
  }

  button.danger {
    background: #12204a;
    color: #fca5a5;
    border-color: #7f1d1d;
  }

  input,
  textarea,
  select {
    border-color: #3b82f6;
  }

  th {
    background: #1e3a8a;
    color: #dbeafe;
    border-bottom-color: #3b82f6;
  }

  table {
    border-color: #1e40af;
  }

  td,
  tr {
    border-color: #1e3a8a;
  }

  tbody tr:nth-child(even) {
    background: #0f1b3d;
  }

  tbody tr:hover {
    background: #172554;
  }

  .muted,
  .empty,
  .board-detail,
  .summary-card span,
  .partner-meta,
  .partner-contact {
    color: #93b4e6;
  }

  .summary-card {
    background: #172554;
    border-color: #1e40af;
    border-left-color: #3b82f6;
    color: #dbeafe;
  }

  .summary-card:hover {
    background: #1e3a8a;
  }

  .summary-card[aria-pressed="true"] {
    background: #2563eb;
    border-color: #60a5fa;
  }

  .badge-shared {
    background: #1e3a8a;
    color: #bfdbfe;
  }

  .badge-channel {
    background: #0c4a6e;
    color: #bae6fd;
  }

  .badge-partner {
    background: #2563eb;
    color: #fff;
  }

  .badge-declined {
    background: #334155;
    color: #cbd5e1;
  }

  .board-column,
  .board-column-1,
  .board-column-2,
  .board-column-3 {
    background: #0f1b3d;
    border-color: #1e3a8a;
  }

  .partner-card {
    background: #12204a;
    border-color: #1e40af;
  }

  .partner-company,
  .partner-notes {
    color: #c7d7f5;
  }

  .agenda-event {
    background: #1e3a8a;
    color: #dbeafe;
  }

  .agenda-event:hover {
    background: #1d4ed8;
  }

  .agenda-day {
    border-color: #1e3a8a;
  }

  .agenda-day:hover,
  .agenda-day.is-outside {
    background: #172554;
  }

  .agenda-weekdays span {
    color: #93c5fd;
  }

  .toast {
    background: #1d4ed8;
  }

  .toast-error {
    background: #b91c1c;
  }

  kbd {
    background: #172554;
    border-color: #3b82f6;
  }
}

@media (prefers-color-scheme: dark) {
  .board-column-1 {
    border-top-color: #38bdf8;
  }

  .board-column-2 {
    border-top-color: #3b82f6;
  }

  .board-column-3 {
    border-top-color: #818cf8;
  }

  .board-column-3 .board-step {
    background: #6366f1;
  }
}
