.contact-platform {
  --platform-line: rgba(255, 255, 255, 0.1);
  --platform-muted: #8e9692;
  --platform-green: #b9ec61;
  --platform-blue: #78a9ff;
  --platform-red: #ff8077;
  position: relative;
}

.contact-platform-toolbar {
  min-height: 50px;
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 16px 0;
  background: #101412;
}

.contact-platform-toolbar button,
.contact-platform-upload {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  justify-content: center;
  padding: 0;
  color: #aeb6b2;
  background: transparent;
  border: 0;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
}

.contact-platform-toolbar button:hover,
.contact-platform-toolbar button:focus-visible,
.contact-platform-upload:hover,
.contact-platform-upload:focus-within {
  color: #f1f5f3;
  background: #1a211e;
}

.contact-platform-toolbar button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.contact-platform-toolbar button:disabled:hover {
  color: #aeb6b2;
  background: transparent;
}

.contact-platform-toolbar button > span:first-child,
.contact-platform-upload > span:first-of-type {
  color: var(--platform-green);
  font-family: var(--font-mono);
  font-size: 0.62rem;
}

.contact-platform-menu[hidden] {
  display: none;
}

.contact-platform-menu {
  width: min(220px, calc(100vw - 40px));
  position: absolute;
  bottom: calc(100% + 6px);
  left: 16px;
  z-index: 8;
  display: grid;
  gap: 2px;
  padding: 6px;
  background: #151b18;
  border: 1px solid #38433e;
  border-radius: 5px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.48);
}

.contact-platform-menu button {
  width: 100%;
  height: auto;
  min-height: 44px;
  justify-content: flex-start;
  padding: 8px 10px;
  font-size: 0.72rem;
}

.contact-platform-menu button > span:first-child {
  color: inherit;
  font-family: inherit;
  font-size: inherit;
}

.contact-platform-upload input {
  width: 1px;
  height: 1px;
  position: absolute;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.contact-platform-upload.is-uploading {
  opacity: 0.55;
  pointer-events: none;
}

.contact-platform-status {
  min-width: 0;
  margin-left: auto;
  color: var(--platform-muted);
  font-size: 0.66rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-platform-status[data-state="success"] {
  color: var(--platform-green);
}

.contact-platform-status[data-state="error"] {
  color: var(--platform-red);
}

.contact-platform-dialog {
  width: min(960px, calc(100vw - 36px));
  max-height: min(820px, calc(100dvh - 36px));
  padding: 0;
  color: #e8edeb;
  background: #0c100e;
  border: 1px solid #343d39;
  border-radius: 6px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.55);
}

.contact-platform-dialog::backdrop {
  background: rgba(2, 4, 3, 0.8);
  backdrop-filter: blur(8px);
}

.contact-platform-dialog-shell {
  max-height: min(820px, calc(100dvh - 38px));
  overflow: auto;
}

.contact-platform-dialog-shell > header {
  min-height: 80px;
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 24px;
  background: rgba(12, 16, 14, 0.96);
  border-bottom: 1px solid var(--platform-line);
}

.contact-platform-dialog h3,
.contact-platform-dialog p {
  margin: 0;
}

.contact-platform-dialog h3 {
  margin-top: 3px;
  font-size: 1.05rem;
  line-height: 1.2;
}

.contact-platform-kicker {
  color: var(--platform-blue);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
}

.contact-platform-dialog-shell > header > button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #a8b0ac;
  background: #151a18;
  border: 1px solid #303834;
  border-radius: 4px;
  font-size: 1.2rem;
}

.contact-platform-tabs {
  position: sticky;
  top: 80px;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: #101512;
  border-bottom: 1px solid var(--platform-line);
}

.contact-platform-tabs button {
  min-height: 46px;
  position: relative;
  color: #8f9893;
  background: transparent;
  border: 0;
  font-size: 0.72rem;
  font-weight: 700;
}

.contact-platform-tabs button[aria-selected="true"] {
  color: #ecf1ee;
}

.contact-platform-tabs button[aria-selected="true"]::after {
  content: "";
  height: 2px;
  position: absolute;
  right: 22px;
  bottom: -1px;
  left: 22px;
  background: var(--platform-green);
}

[data-platform-panel] {
  padding: 30px 32px 34px;
}

[data-platform-panel][hidden] {
  display: none;
}

.contact-platform-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.contact-platform-section-heading > div {
  display: grid;
  gap: 4px;
}

.contact-platform-section-heading strong {
  color: #edf2ef;
  font-size: 0.86rem;
}

.contact-platform-section-heading span,
.contact-platform-section-heading p {
  color: var(--platform-muted);
  font-size: 0.65rem;
}

.contact-platform-section-heading p {
  max-width: 430px;
  line-height: 1.6;
  text-align: right;
}

.contact-platform-section-heading span[data-state="visitor_confirmed"],
.contact-platform-section-heading span[data-state="approved"] {
  color: var(--platform-green);
}

.contact-platform-fields {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

.contact-platform-fields-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.contact-platform-fields-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.contact-platform-fields label,
.contact-platform-wide-field {
  min-width: 0;
  display: grid;
  gap: 7px;
  margin: 0;
}

.contact-platform-wide-field + .contact-platform-wide-field {
  margin-top: 18px;
}

.contact-platform-fields label > span,
.contact-platform-wide-field > span {
  color: #adb6b1;
  font-size: 0.68rem;
  font-weight: 700;
}

.contact-platform-fields input,
.contact-platform-fields select,
.contact-platform-fields textarea,
.contact-platform-wide-field textarea {
  width: 100%;
  min-width: 0;
  color: #edf2ef;
  background: #131815;
  border: 1px solid #303834;
  border-radius: 4px;
  box-shadow: none;
  font-size: 0.75rem;
}

.contact-platform-fields input,
.contact-platform-fields select {
  height: 42px;
  padding: 0 11px;
}

.contact-platform-fields textarea,
.contact-platform-wide-field textarea {
  min-height: 88px;
  padding: 11px;
  resize: vertical;
  line-height: 1.6;
}

.contact-brief-form footer,
.contact-booking-form footer {
  min-height: 56px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--platform-line);
}

.contact-brief-form footer > span,
.contact-booking-form footer > span {
  margin-right: auto;
  color: var(--platform-muted);
  font-size: 0.68rem;
}

.contact-brief-form footer > span[data-state="error"],
.contact-booking-form footer > span[data-state="error"] {
  color: var(--platform-red);
}

.contact-brief-form footer > span[data-state="success"],
.contact-booking-form footer > span[data-state="success"] {
  color: var(--platform-green);
}

.contact-platform-primary,
.contact-platform-secondary {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 800;
}

.contact-platform-primary {
  color: #11150c;
  background: var(--platform-green);
  border: 1px solid var(--platform-green);
}

.contact-platform-secondary {
  color: #d7ddda;
  background: transparent;
  border: 1px solid #3a4540;
}

.contact-booking-provider {
  min-height: 62px;
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  margin-bottom: 30px;
  padding: 0 16px;
  background: #111713;
  border-top: 1px solid #2f3934;
  border-bottom: 1px solid #2f3934;
}

.contact-booking-provider-signal {
  width: 7px;
  height: 7px;
  background: #6e7773;
  border-radius: 50%;
}

.contact-booking-provider[data-state="configured"] .contact-booking-provider-signal {
  background: var(--platform-green);
  box-shadow: 0 0 0 4px rgba(185, 236, 97, 0.09);
}

.contact-booking-provider > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.contact-booking-provider strong {
  font-size: 0.75rem;
}

.contact-booking-provider small {
  color: var(--platform-muted);
  font-size: 0.64rem;
}

.contact-booking-provider a {
  color: var(--platform-green);
  font-size: 0.68rem;
  font-weight: 700;
}

.contact-booking-history {
  margin-top: 38px;
  padding-top: 28px;
  border-top: 1px solid var(--platform-line);
}

.contact-booking-item {
  min-height: 66px;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 10px 0;
  border-bottom: 1px solid #252d29;
}

.contact-booking-marker {
  width: 6px;
  height: 6px;
  background: #727b77;
  border-radius: 50%;
}

.contact-booking-item[data-state="confirmed"] .contact-booking-marker {
  background: var(--platform-green);
}

.contact-booking-item[data-state="declined"] .contact-booking-marker,
.contact-booking-item[data-state="canceled"] .contact-booking-marker {
  background: var(--platform-red);
}

.contact-booking-item > div:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.contact-booking-item strong {
  color: #dfe5e2;
  font-size: 0.73rem;
}

.contact-booking-item small,
.contact-booking-item p {
  color: var(--platform-muted);
  font-size: 0.64rem;
}

.contact-booking-item p {
  margin-top: 4px;
  line-height: 1.5;
}

.contact-booking-item > div:last-child {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.contact-booking-item a,
.contact-booking-item button {
  min-height: 30px;
  padding: 0 8px;
  color: #cbd3cf;
  background: transparent;
  border: 1px solid #36403b;
  border-radius: 3px;
  font-size: 0.63rem;
}

.contact-platform-empty {
  padding: 22px 0;
  color: var(--platform-muted);
  font-size: 0.7rem;
}

@media (max-width: 760px) {
  .contact-platform-toolbar {
    overflow: visible;
  }

  .contact-platform-toolbar button,
  .contact-platform-upload {
    flex: 0 0 auto;
  }

  .contact-platform-status {
    display: none;
  }

  .contact-platform-dialog {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
  }

  .contact-platform-dialog-shell {
    max-height: 100dvh;
  }

  [data-platform-panel] {
    padding: 24px 18px 30px;
  }

  .contact-platform-fields-three,
  .contact-platform-fields-two {
    grid-template-columns: minmax(0, 1fr);
  }

  .contact-platform-section-heading {
    flex-direction: column;
    gap: 7px;
  }

  .contact-platform-section-heading p {
    text-align: left;
  }

  .contact-brief-form footer,
  .contact-booking-form footer {
    align-items: stretch;
    flex-direction: column;
  }

  .contact-brief-form footer > span,
  .contact-booking-form footer > span {
    min-height: 20px;
    margin: 0;
  }

  .contact-booking-provider {
    grid-template-columns: 9px minmax(0, 1fr);
    padding: 12px;
  }

  .contact-booking-provider a {
    grid-column: 2;
  }

  .contact-booking-item {
    grid-template-columns: 8px minmax(0, 1fr);
  }

  .contact-booking-item > div:last-child {
    grid-column: 2;
    justify-content: flex-start;
  }
}

@media (max-width: 430px) {
  .contact-platform-toolbar {
    display: flex;
    gap: 4px;
    padding: 6px 12px 0;
  }

  .contact-platform-toolbar button,
  .contact-platform-upload {
    width: 44px;
    flex-basis: 44px;
  }

  .contact-platform-menu {
    left: 12px;
  }

  .contact-platform-menu button {
    width: 100%;
    height: auto;
    flex-basis: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .contact-platform-dialog::backdrop {
    backdrop-filter: none;
  }
}
