/*
 * CONTACT STRUCTURE AUDIT (Appily + legacy)
 * — Form left · map/details right · offset ledger split · pinboard scatter.
 * — CHANNEL_DECK_SLIM_FORM (retired): 2×2 channel tiles + centered slim form + registry card grid.
 * — Mailslot / Desk Intercom / Propagation Tray / Pneumatic Desk cousins on other Appily builds.
 *
 * THIS PAGE: PATCH_BAY_COMPOSE_WELL — vertical patch-bay jacks (direct lines) beside a compose well
 * with topic rail + fields; registry as a full-width label strip below.
 */

.page-contact,
.page-a122-seedlight.page-contact {
  overflow-x: visible;
  background: linear-gradient(
    165deg,
    var(--sg-paper) 0%,
    color-mix(in srgb, var(--sg-mist) 28%, var(--sg-bone)) 52%,
    var(--sg-bone) 100%
  );
}

.ct-desk {
  padding: var(--sg-space-5) 0 var(--sg-space-10);
  min-width: 0;
}

.ct-desk__wrap {
  display: flex;
  flex-direction: column;
  gap: var(--sg-space-5);
  min-width: 0;
  max-width: 46rem;
  margin-inline: auto;
}

@media (min-width: 768px) {
  .ct-desk__wrap {
    max-width: 54rem;
  }
}

@media (min-width: 1024px) {
  .ct-desk__wrap {
    max-width: 64rem;
  }
}

.ct-desk__mast {
  max-width: 52ch;
  min-width: 0;
}

.ct-desk__mast .ds-title {
  font-size: clamp(1.45rem, 3.5vw, 2rem);
}

.ct-desk__console {
  display: flex;
  flex-direction: column;
  gap: var(--sg-space-4);
  min-width: 0;
}

@media (min-width: 1024px) {
  .ct-desk__console {
    flex-direction: row;
    align-items: stretch;
    gap: var(--sg-space-5);
  }
}

/* Patch bay — stacked jacks */
.ct-patch {
  flex: 0 0 auto;
  min-width: 0;
  padding: var(--sg-space-4);
  border: 1px solid var(--sg-line);
  border-radius: var(--sg-radius-lg);
  background: color-mix(in srgb, var(--sg-charcoal) 4%, var(--sg-paper));
  box-shadow: var(--sg-shadow-sm, 0 1px 2px rgb(0 0 0 / 6%));
}

@media (min-width: 1024px) {
  .ct-patch {
    flex: 0 0 16.5rem;
    max-width: 18rem;
  }
}

.ct-patch__title {
  margin: 0 0 var(--sg-space-3);
  font-family: var(--sg-font-display);
  font-size: var(--sg-text-sm);
  font-weight: 700;
  color: var(--sg-sage-deep);
}

.ct-patch__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--sg-space-2);
}

.ct-patch__jack {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sg-space-3);
  align-items: start;
  min-height: var(--sg-touch);
  padding: var(--sg-space-3);
  border-radius: var(--sg-radius);
  border: 1px solid var(--sg-line);
  background: var(--sg-paper);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

a.ct-patch__jack:hover {
  border-color: var(--sg-sage);
  box-shadow: inset 3px 0 0 var(--sg-sage);
}

a.ct-patch__jack:focus-visible {
  outline: 2px solid var(--sg-sage);
  outline-offset: 2px;
}

.ct-patch__jack--static {
  cursor: default;
}

.ct-patch__led {
  width: 0.5rem;
  height: 0.5rem;
  margin-top: 0.35rem;
  border-radius: 50%;
  background: var(--sg-sage);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--sg-sage) 25%, transparent);
}

.ct-patch__led--chat {
  background: #3d9a5c;
}

.ct-patch__led--hours {
  background: var(--sg-clay);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--sg-clay) 30%, transparent);
}

.ct-patch__body {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.ct-patch__label {
  font-size: var(--sg-text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--sg-ink-muted);
}

.ct-patch__value {
  font-size: var(--sg-text-sm);
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.ct-patch__hint {
  font-size: var(--sg-text-xs);
  font-weight: 600;
  color: var(--sg-sage);
}

.ct-patch__shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sg-space-2);
  margin-top: var(--sg-space-4);
  padding-top: var(--sg-space-3);
  border-top: 1px dashed var(--sg-line);
}

.ct-patch__shortcuts .ds-btn {
  min-height: var(--sg-touch);
  flex: 1 1 auto;
}

/* Compose well */
.ct-well {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sg-space-3);
}

.ct-well__status {
  padding: var(--sg-space-3) var(--sg-space-4);
  font-size: var(--sg-text-sm);
  border: 1px solid var(--sg-line);
  border-radius: var(--sg-radius-lg);
  background: var(--sg-paper);
  line-height: 1.45;
}

.ct-well__status.is-success {
  border-left: 3px solid var(--sg-sage);
  background: color-mix(in srgb, var(--sg-sage) 10%, var(--sg-paper));
}

.ct-well__status.is-error {
  border-left: 3px solid #c45c4a;
  background: color-mix(in srgb, #c45c4a 10%, var(--sg-paper));
}

.ct-well__status strong {
  display: block;
  margin-bottom: 0.25rem;
}

.ct-well__panel {
  flex: 1;
  padding: var(--sg-space-4);
  border: 1px solid var(--sg-line);
  border-radius: var(--sg-radius-lg);
  background: var(--sg-paper);
  box-shadow: var(--sg-shadow-sm, 0 2px 8px rgb(0 0 0 / 6%));
  min-width: 0;
}

@media (min-width: 768px) {
  .ct-well__panel {
    padding: var(--sg-space-5);
  }
}

.ct-well__head .ds-title {
  font-size: var(--sg-text-lg);
  margin: 0;
}

.ct-well__lede {
  margin: var(--sg-space-2) 0 0;
  font-size: var(--sg-text-sm);
}

.ct-compose {
  display: grid;
  gap: var(--sg-space-4);
  margin-top: var(--sg-space-4);
  min-width: 0;
}

.ct-compose.is-client-error .ds-input:invalid {
  border-color: color-mix(in srgb, var(--sg-clay) 70%, var(--sg-line));
}

.ct-compose__split {
  display: flex;
  flex-direction: column;
  gap: var(--sg-space-4);
  min-width: 0;
}

@media (min-width: 720px) {
  .ct-compose__split {
    flex-direction: row;
    align-items: stretch;
    gap: var(--sg-space-5);
  }
}

.ct-compose__topics {
  margin: 0;
  padding: 0;
  border: none;
  min-width: 0;
}

@media (min-width: 720px) {
  .ct-compose__topics {
    flex: 0 0 9.5rem;
  }
}

.ct-compose__topics-legend {
  font-size: var(--sg-text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--sg-ink-muted);
  margin-bottom: var(--sg-space-2);
}

.ct-compose__topic-rail {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: var(--sg-space-2);
}

@media (min-width: 720px) {
  .ct-compose__topic-rail {
    flex-direction: column;
    flex-wrap: nowrap;
  }
}

.ct-compose__topic-btn {
  min-height: var(--sg-touch);
  padding: var(--sg-space-2) var(--sg-space-3);
  border-radius: var(--sg-radius);
  border: 1px solid var(--sg-line);
  background: color-mix(in srgb, var(--sg-mist) 12%, var(--sg-paper));
  font: inherit;
  font-size: var(--sg-text-sm);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  color: inherit;
  transition: border-color 0.2s ease, background 0.2s ease;
}

@media (min-width: 720px) {
  .ct-compose__topic-btn {
    border-left: 3px solid transparent;
  }

  .ct-compose__topic-btn.is-active {
    border-left-color: var(--sg-sage);
  }
}

.ct-compose__topic-btn.is-active {
  border-color: var(--sg-sage);
  background: color-mix(in srgb, var(--sg-sage) 12%, var(--sg-paper));
  color: var(--sg-sage-deep);
}

.ct-compose__topic-btn:focus-visible {
  outline: 2px solid var(--sg-sage);
  outline-offset: 2px;
}

.ct-compose__fields {
  margin: 0;
  padding: 0;
  border: none;
  flex: 1 1 auto;
  display: grid;
  gap: var(--sg-space-3);
  min-width: 0;
}

.ct-compose__field {
  display: grid;
  gap: 0.35rem;
  font-size: var(--sg-text-sm);
  font-weight: 600;
  min-width: 0;
}

.ct-compose__field .ds-input {
  width: 100%;
  min-height: var(--sg-touch);
}

.ct-compose__field textarea.ds-input {
  min-height: 8rem;
  resize: vertical;
  max-height: 24rem;
}

.ct-compose__hint {
  margin: 0;
  font-size: var(--sg-text-sm);
  font-weight: 600;
  color: color-mix(in srgb, var(--sg-clay) 85%, var(--sg-ink));
}

.ct-compose__hint[hidden] {
  display: none !important;
}

.ct-compose__submit {
  min-height: var(--sg-touch);
  width: 100%;
  justify-content: center;
}

@media (min-width: 480px) {
  .ct-compose__submit {
    width: auto;
    min-width: 12rem;
  }
}

.ct-compose__submit.is-pressing {
  opacity: 0.85;
}

/* Registry label strip */
.ct-strip {
  padding: var(--sg-space-4);
  min-width: 0;
  background: var(--sg-paper);
}

.ct-strip__facts {
  margin: var(--sg-space-3) 0 0;
  display: grid;
  gap: var(--sg-space-3);
  grid-template-columns: 1fr;
}

@media (min-width: 600px) {
  .ct-strip__facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .ct-strip__facts {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.ct-strip__fact {
  min-width: 0;
  padding: var(--sg-space-2) 0;
  border-top: 1px solid var(--sg-line);
}

.ct-strip__fact--wide {
  grid-column: 1 / -1;
}

.ct-strip__fact dt {
  margin: 0;
  font-size: var(--sg-text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--sg-ink-muted);
}

.ct-strip__fact dd {
  margin: 0.2rem 0 0;
  font-size: var(--sg-text-sm);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.ct-strip__address {
  display: block;
}

.ct-strip__meta {
  display: block;
  margin-top: var(--sg-space-2);
  font-size: var(--sg-text-xs);
  font-weight: 500;
  color: var(--sg-ink-muted);
}

@media (max-width: 359px) {
  .ct-patch__shortcuts .ds-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ct-patch__jack,
  .ct-compose__topic-btn {
    transition: none;
  }
}
