:root {
  color-scheme: light;
}

body {
  font-family: 'Roboto', system-ui, sans-serif;
}

dialog::backdrop {
  background: rgba(51, 64, 89, .35);
}

/* The hidden attribute must also win over Tailwind display utilities such as
   flex: the advanced filter panel and the bulk action rely on it. */
[hidden] {
  display: none !important;
}

/* Spinner used by the global loading overlay and live run banners. */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  animation: spin .8s linear infinite;
}

/* Personal-board drag and drop. The move form is a hidden carrier of the
   target column and CSRF token; there is no visible status switcher. */
.board-column {
  background-color: #f8fafc;
  transition: background-color .15s, border-color .15s;
}

/* Pastel column surfaces from the status settings palette. */
.board-column[data-color="blue"] {
  background-color: #e8f1ff;
  border-color: #cfe0f7;
}

.board-column[data-color="sky"] {
  background-color: #e6f6ff;
  border-color: #c7e8f7;
}

.board-column[data-color="teal"] {
  background-color: #e6f7f7;
  border-color: #c4e6e6;
}

.board-column[data-color="mint"] {
  background-color: #e7f8ef;
  border-color: #c9ead7;
}

.board-column[data-color="green"] {
  background-color: #e9f7ef;
  border-color: #c8e8d4;
}

.board-column[data-color="lime"] {
  background-color: #eef8dd;
  border-color: #d8e9b7;
}

.board-column[data-color="lemon"] {
  background-color: #fbf7d8;
  border-color: #eee3a8;
}

.board-column[data-color="amber"] {
  background-color: #fff6e5;
  border-color: #f0d58a;
}

.board-column[data-color="peach"] {
  background-color: #ffeadf;
  border-color: #f5d0bd;
}

.board-column[data-color="rose"] {
  background-color: #fdecea;
  border-color: #f5c6c1;
}

.board-column[data-color="pink"] {
  background-color: #fdeaf1;
  border-color: #f4c9d9;
}

.board-column[data-color="violet"] {
  background-color: #f3edff;
  border-color: #ded1f7;
}

.board-column[data-color="slate"] {
  background-color: #eef1f7;
  border-color: #d8deea;
}

.board-column.drop-target {
  background-color: #f0f6ff;
  border-color: #0065dd;
}

.column-row.dragging {
  opacity: .45;
  background: #fafbfe;
}

/* Square pastel swatch picker used by the client status columns. The panel is
   deliberately white and the swatches keep the same tint as the board. */
.color-picker {
  position: relative;
  flex: 0 0 auto;
}

.color-picker-trigger {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px 4px;
  border: 1px solid #e4e7f2;
  border-radius: 2px;
  background: #fff;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.color-picker-trigger::-webkit-details-marker {
  display: none;
}

.color-picker-trigger::marker {
  content: "";
}

.color-picker-trigger:hover,
.color-picker[open] .color-picker-trigger {
  border-color: #0065dd;
}

.color-picker-trigger:focus-visible {
  outline: 2px solid rgba(0, 101, 221, .25);
  outline-offset: 1px;
}

.color-picker-dot {
  width: 16px;
  height: 16px;
  border: 1px solid rgba(51, 64, 89, .14);
  border-radius: 2px;
}

.color-picker-dot.color-none {
  background: #fff;
}

.color-picker-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 80;
  width: 206px;
  padding: 8px;
  border: 1px solid #e4e7f2;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(51, 64, 89, .14);
}

.color-picker-title {
  margin: 0 0 6px;
  color: #6f7c98;
  font-size: 11px;
}

.color-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, 22px);
  gap: 6px;
}

.color-chip {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid rgba(51, 64, 89, .14);
  border-radius: 2px;
  background: #fff;
  cursor: pointer;
}

.color-chip:hover {
  border-color: #0065dd;
}

.color-chip:focus-visible {
  outline: 2px solid rgba(0, 101, 221, .25);
  outline-offset: 1px;
}

.color-chip.is-current {
  box-shadow: inset 0 0 0 2px #0065dd;
}

.color-chip.color-none {
  position: relative;
}

.color-chip.color-none::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 3px;
  right: 3px;
  height: 1px;
  background: #cbd3e1;
  transform: rotate(-45deg);
}

.color-picker-dot.color-blue,
.color-chip.color-blue { background-color: #e8f1ff; }
.color-picker-dot.color-sky,
.color-chip.color-sky { background-color: #e6f6ff; }
.color-picker-dot.color-teal,
.color-chip.color-teal { background-color: #e6f7f7; }
.color-picker-dot.color-mint,
.color-chip.color-mint { background-color: #e7f8ef; }
.color-picker-dot.color-green,
.color-chip.color-green { background-color: #e9f7ef; }
.color-picker-dot.color-lime,
.color-chip.color-lime { background-color: #eef8dd; }
.color-picker-dot.color-lemon,
.color-chip.color-lemon { background-color: #fbf7d8; }
.color-picker-dot.color-amber,
.color-chip.color-amber { background-color: #fff6e5; }
.color-picker-dot.color-peach,
.color-chip.color-peach { background-color: #ffeadf; }
.color-picker-dot.color-rose,
.color-chip.color-rose { background-color: #fdecea; }
.color-picker-dot.color-pink,
.color-chip.color-pink { background-color: #fdeaf1; }
.color-picker-dot.color-violet,
.color-chip.color-violet { background-color: #f3edff; }
.color-picker-dot.color-slate,
.color-chip.color-slate { background-color: #eef1f7; }

[draggable="true"].dragging {
  opacity: .45;
}

/* Gateway ordering: only the grip starts a drag, so a row keeps its buttons
   and links usable. The dragging row is dimmed while it moves. */
.gateway-row.dragging {
  opacity: .45;
  background: #fafbfe;
}

[data-drag-handle] {
  cursor: grab;
}

[data-drag-handle]:active {
  cursor: grabbing;
}

[data-drag-handle]:disabled {
  cursor: not-allowed;
}

/* Touch devices cannot start an HTML5 drag; the handle cell shows two compact
   arrows instead and hides the grip. */
.touch-order {
  display: none;
}

.touch-order .icon-button {
  width: 22px;
  height: 20px;
}

.touch-order .icon-button svg {
  width: 12px;
  height: 12px;
}

@media (hover: none) {
  button[data-drag-handle] {
    display: none;
  }

  .touch-order {
    display: inline-flex;
  }
}

form.card-move {
  display: none;
}

/* Single-line selects get a custom chevron with a predictable inset instead of
   the native arrow, which sits almost on the right border in some browsers. */
select:not([multiple]) {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236f7c98' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 12px 12px;
  padding-right: 34px !important;
}

/* The native clock glyph in time inputs is drawn in black; replace it with an
   accent-coloured copy so the picker matches the rest of the form. */
input[type="time"]::-webkit-calendar-picker-indicator {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  margin: 0 0 0 4px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230065dd' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E") no-repeat center / contain;
  cursor: pointer;
}

/* The list search fields draw their own reset icon inside the field; hide the
   browser's native search clear control so two crosses never overlap. */
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

/* Inputs below 16px make iOS Safari zoom the page on focus. */
@media (max-width: 640px) {
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea {
    font-size: 16px;
  }
}

/* Never let a long word, table or image push the page sideways. */
img {
  max-width: 100%;
}

.prose-break {
  overflow-wrap: anywhere;
}

/* Rows and cards keep their semantic test/JS hooks; visual classes live on
   child elements so the exact class attributes stay stable. */
tr.contract-row {
  border-top: 1px solid #e4e7f2;
  vertical-align: top;
}

tr.contract-row:hover {
  background: #fafbfe;
}

article.client-row {
  display: block;
}

/* The bulk action is hidden until at least one row is selected; the attribute
   must win over the inline-flex utility on the button. */
[data-bulk-delete][hidden] {
  display: none !important;
}

/* Long filter phrases and messages stay on one or two lines; the full value is
   still in the title and in the HTML for screen readers. */
.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* A pipeline choice is a compact card: the checked state is visible without
   relying on the native checkbox alone. */
.pipeline-option {
  transition: border-color .15s, background-color .15s;
}

.pipeline-option:hover {
  border-color: #b9d3f5;
}

.pipeline-option:has(input:checked) {
  border-color: #0065dd;
  background: #f5f9ff;
}

.pipeline-option:focus-within {
  box-shadow: 0 0 0 2px rgba(0, 101, 221, .15);
}

/* Error details are a tooltip on hover/focus instead of a permanent red text
   block: the row stays compact, the full text is still available. */
.error-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: #e8523d;
  cursor: help;
  vertical-align: middle;
  border-radius: 50%;
  outline: none;
}

.error-tip svg {
  width: 15px;
  height: 15px;
}

.error-tip:focus-visible {
  box-shadow: 0 0 0 2px rgba(232, 82, 61, .25);
}

.ui-tooltip {
  position: fixed;
  z-index: 2000;
  max-width: min(420px, calc(100vw - 24px));
  max-height: 220px;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 8px 10px;
  border-radius: 3px;
  background: #334059;
  color: #fff;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  box-shadow: 0 4px 14px rgba(51, 64, 89, .25);
  pointer-events: auto;
}

/* Tag picker used by the region and keyword fields. The visual state is a
   colour, never a literal "!" or "-" in the tag text. */
.tag-picker {
  border: 1px solid #dae4ee;
  border-radius: 2px;
  background: #fff;
  transition: border-color .15s;
}

.tag-picker:focus-within {
  border-color: #0065dd;
}

.tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 8px 0;
}

.tag-chips:empty {
  padding: 0;
}

/* Keyword picker: the chips and the "add a word" input share one compact
   line instead of the input sitting on a second row. */
[data-tag-picker] {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
}

[data-tag-picker].hidden {
  display: none !important;
}

[data-tag-picker] .tag-chips {
  display: contents;
}

[data-tag-picker] .tag-search {
  flex: 1 1 180px;
  min-width: 120px;
  padding: 4px 2px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border: 1px solid #e2e8f0;
  border-radius: 3px;
  background: #f0f4f9;
  color: #334059;
  font-size: 12px;
  line-height: 1.5;
  cursor: pointer;
  user-select: none;
}

.tag-required {
  border-color: rgba(0, 101, 221, .25);
  background: rgba(0, 101, 221, .1);
  color: #0065dd;
  font-weight: 500;
}

.tag-excluded {
  border-color: rgba(232, 82, 61, .25);
  background: rgba(232, 82, 61, .1);
  color: #e8523d;
  font-weight: 500;
  text-decoration: line-through;
  text-decoration-color: rgba(232, 82, 61, .45);
}

.tag-remove {
  border: 0;
  background: transparent;
  color: #909ebb;
  font-size: 14px;
  line-height: 1;
  padding: 0 1px;
  cursor: pointer;
}

.tag-remove:hover {
  color: #e8523d;
}

.tag-search {
  flex: 1;
  min-width: 120px;
  border: 0;
  outline: 0;
  padding: 6px 4px 8px;
  background: transparent;
  color: #334059;
  font-size: 13px;
}

.region-options {
  max-height: 240px;
  overflow: auto;
  border-top: 1px solid #e4e7f2;
  margin-top: 6px;
}

.region-group-title {
  padding: 6px 10px 2px;
  color: #909ebb;
  font-size: 10px;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.region-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 6px 10px;
  border: 0;
  background: transparent;
  color: #334059;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.region-option:hover {
  background: #f5f8fd;
}

.region-option[aria-selected="true"] {
  background: #f0f6ff;
  color: #0065dd;
  font-weight: 500;
}

.region-option:disabled {
  color: #909ebb;
  cursor: not-allowed;
}

/* Compact icon action buttons: the label lives in the tooltip and aria-label. */
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: #6f7c98;
  cursor: pointer;
  transition: background-color .15s, color .15s;
}

.icon-button svg {
  width: 16px;
  height: 16px;
}

.icon-button:hover,
.icon-button:focus-visible {
  color: #0065dd;
  background: #eff0f2;
  outline: none;
}

.icon-button-primary {
  background: #0065dd;
  color: #fff;
}

.icon-button-primary:hover,
.icon-button-primary:focus-visible {
  background: #014da8;
  color: #fff;
}

.icon-button-danger:hover,
.icon-button-danger:focus-visible {
  background: #ffebee;
  color: #e8523d;
}

.icon-button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

/* Vertical stage timeline of the contract card: square numbered markers,
   compact step cards and a connecting line. States follow the semantic
   statuses of contractStageView (ok/error/warning/pending/none/skipped).
   The contract page owns these classes; purchase_detail only uses the shared
   .stage-badge and .stage-detail, so badges must stay untouched here. */
.stage-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: stage;
}

.stage-step {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  column-gap: 10px;
  padding-bottom: 10px;
  counter-increment: stage;
}

.stage-step:last-child {
  padding-bottom: 0;
}

/* The line between the square markers: starts under the marker and runs
   through the gap to the next card. */
.stage-step::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 34px;
  bottom: 0;
  width: 2px;
  background: #e4e7f2;
}

.stage-step:last-child::before {
  display: none;
}

.stage-marker {
  position: relative;
  z-index: 1;
  align-self: start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 2px;
  background: rgba(144, 158, 187, .14);
  color: #909ebb;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
}

.stage-marker::before {
  content: counter(stage);
}

.stage-step--ok .stage-marker {
  background: rgba(0, 101, 221, .1);
  color: #0065dd;
}

.stage-step--ok .stage-marker::before {
  content: "✓";
}

.stage-step--error .stage-marker {
  background: rgba(232, 82, 61, .1);
  color: #e8523d;
}

.stage-step--warning .stage-marker {
  background: rgba(160, 90, 0, .1);
  color: #a05a00;
}

.stage-step--error .stage-marker::before,
.stage-step--warning .stage-marker::before {
  content: "!";
}

.stage-step--skipped .stage-marker::before,
.stage-step--none .stage-marker::before {
  content: "•";
  font-size: 14px;
}

.stage-body {
  min-width: 0;
  padding: 6px 10px 8px;
  border: 1px solid #e4e7f2;
  border-radius: 2px;
  background: #fff;
}

/* A soft tint makes the state visible on the card itself, not only in the
   marker and the badge. Text colours stay the same, so contrast does not
   drop. */
.stage-step--ok .stage-body {
  border-color: rgba(0, 101, 221, .22);
}

.stage-step--warning .stage-body {
  border-color: rgba(160, 90, 0, .24);
  background: #fffbf4;
}

.stage-step--error .stage-body {
  border-color: rgba(232, 82, 61, .28);
  background: #fff9f8;
}

.stage-step--skipped .stage-body,
.stage-step--none .stage-body {
  background: #fafbfe;
}

.stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.stage-title {
  color: #334059;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

.stage-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 1px 7px;
  border-radius: 2px;
  font-size: 11px;
  line-height: 1.5;
  white-space: nowrap;
}

.stage-badge--ok {
  background: rgba(0, 101, 221, .1);
  color: #0065dd;
}

.stage-badge--error {
  background: rgba(232, 82, 61, .1);
  color: #e8523d;
}

.stage-badge--warning {
  background: rgba(160, 90, 0, .1);
  color: #a05a00;
}

.stage-badge--pending,
.stage-badge--none,
.stage-badge--skipped {
  background: rgba(144, 158, 187, .12);
  color: #909ebb;
}

.stage-badge--running {
  background: rgba(0, 101, 221, .1);
  color: #0065dd;
}

.stage-card--running {
  border-color: #cfe0f7;
  background: #fafcff;
}

.stage-step--running .stage-marker {
  background: rgba(0, 101, 221, .1);
  color: #0065dd;
}

.stage-step--running .stage-marker::before {
  content: "";
  width: 10px;
  height: 10px;
  border: 2px solid rgba(0, 101, 221, .25);
  border-top-color: #0065dd;
  border-radius: 50%;
  animation: stage-spin .8s linear infinite;
}

/* Live indicator above the stage timeline; the same markup is reused on the
   purchase card, where the steps are simple cards. */
.stage-live {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 8px 10px;
  border: 1px solid #cfe0f7;
  border-radius: 2px;
  background: #f5f9ff;
  color: #0065dd;
  font-size: 12px;
  line-height: 1.45;
}

.stage-live::before {
  content: "";
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(0, 101, 221, .25);
  border-top-color: #0065dd;
  border-radius: 50%;
  animation: stage-spin .8s linear infinite;
}

.stage-live--error {
  border-color: #f3c9c3;
  background: #fdecea;
  color: #e8523d;
}

.stage-live--error::before {
  display: none;
}

@keyframes stage-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .stage-step--running .stage-marker::before,
  .stage-live::before {
    animation: none;
  }
}

.stage-desc {
  margin-top: 2px;
  color: #909ebb;
  font-size: 11px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.stage-meta {
  margin-top: 2px;
  color: #6f7c98;
  font-size: 11px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.stage-detail {
  margin-top: 4px;
  color: #334059;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.stage-step--warning .stage-detail {
  color: #a05a00;
}

.stage-error {
  margin-top: 4px;
  color: #e8523d;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.stage-head-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* The square marker is the stage action: it shows the step number or status
   glyph until hovered or focused, then turns into play/refresh. The form uses
   display:contents so the button stays the first grid column. */
.stage-marker-form {
  display: contents;
}

.stage-marker-action {
  padding: 0;
  border: 0;
  font: inherit;
  cursor: pointer;
}

.stage-marker-action:focus-visible {
  outline: 2px solid #8bbcf5;
  outline-offset: 2px;
}

.stage-marker-action:disabled {
  cursor: default;
}

.stage-marker-icon {
  display: none;
  width: 14px;
  height: 14px;
}

.stage-marker-action:hover::before,
.stage-marker-action:focus-visible::before {
  content: "";
}

.stage-marker-action:hover .stage-marker-icon,
.stage-marker-action:focus-visible .stage-marker-icon {
  display: block;
}

/* The running spinner replaces the action icon even while the pointer stays
   on the marker. */
.stage-step--running .stage-marker-action .stage-marker-icon,
.stage-step--running .stage-marker-action:hover .stage-marker-icon,
.stage-step--running .stage-marker-action:focus-visible .stage-marker-icon {
  display: none;
}

@media (hover: none) {
  .stage-marker-action::before {
    content: "";
  }

  .stage-marker-action .stage-marker-icon {
    display: block;
  }
}

.stage-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 6px;
}

.stage-action {
  display: inline-flex;
  align-items: center;
  padding: 0;
  border: 0;
  background: none;
  color: #0065dd;
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
  text-decoration: none;
}

.stage-action:hover {
  text-decoration: underline;
}

.stage-action:focus-visible {
  outline: 2px solid rgba(0, 101, 221, .25);
  outline-offset: 2px;
}

/* Remaining documents are folded into a closed details block: the selected
   smetas stay visible, the whole list is one click away. */
.docs-more {
  margin-top: 12px;
}

.docs-more > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  color: #0065dd;
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.docs-more > summary::-webkit-details-marker {
  display: none;
}

.docs-more > summary::marker {
  content: "";
}

.docs-more > summary::before {
  content: "";
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 5px solid currentColor;
  transition: transform .15s;
}

.docs-more[open] > summary::before {
  transform: rotate(90deg);
}

.docs-more > summary:hover {
  text-decoration: underline;
}

.docs-more > summary:focus-visible {
  outline: 2px solid rgba(0, 101, 221, .25);
  outline-offset: 2px;
}

.docs-more[open] > summary {
  margin-bottom: 8px;
}

/* Detail cards: a readable label/value grid and tinted summary tiles instead
   of grey rows. The blue/amber accents match the status language of the app. */
.detail-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.detail-tile {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #e4e7f2;
  border-radius: 2px;
  background: #fff;
}

.detail-tile--primary {
  border-color: #cfe0f7;
  background: #f5f9ff;
}

.detail-tile-label {
  display: block;
  color: #909ebb;
  font-size: 10px;
  letter-spacing: .05em;
  line-height: 1.4;
  text-transform: uppercase;
}

.detail-tile-value {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
  color: #334059;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
}

.detail-tile--primary .detail-tile-value {
  color: #014da8;
}

.detail-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e4e7f2;
}

.detail-summary + .detail-section {
  margin-top: 18px;
  padding-top: 0;
  border-top: 0;
}

.detail-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.detail-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 2px;
  background: #e8f1ff;
  color: #0065dd;
}

.detail-icon svg {
  width: 15px;
  height: 15px;
}

.detail-title {
  color: #334059;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

.detail-grid {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  column-gap: 16px;
  row-gap: 8px;
  font-size: 13px;
  line-height: 1.45;
}

.detail-label {
  color: #6f7c98;
}

.detail-value {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #334059;
}

.detail-value a {
  color: #0065dd;
  text-decoration: none;
}

.detail-value a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .detail-summary {
    grid-template-columns: 1fr;
  }

  .detail-grid {
    grid-template-columns: 120px minmax(0, 1fr);
    column-gap: 12px;
    row-gap: 7px;
    font-size: 12px;
  }
}

/* The note delete action stays out of the way until the message is hovered. */
.note-row .note-delete {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.note-row:hover .note-delete,
.note-delete:focus-visible {
  opacity: 1;
  pointer-events: auto;
}

@media (hover: none) {
  .note-row .note-delete {
    opacity: 1;
    pointer-events: auto;
  }
}

/* List view of CRM: a whole status group accepts a dragged row. */
.list-column.drop-target {
  border-radius: 2px;
  outline: 2px dashed #8bbcf5;
  outline-offset: 4px;
}

.list-column.drop-target .list-table {
  background-color: #f0f6ff;
}
