.contact-history-experiment {
  --history-panel: #f1f3f2;
  --history-line: #cfd5d3;
  --history-ink: #111111;
}

.contact-history-page {
  padding-top: clamp(3rem, 6vw, 6rem);
  padding-bottom: clamp(3rem, 6vw, 6rem);
}

.contact-history-page .contact-panel-heading h1 {
  margin: 0.65rem 0 0;
  font-size: clamp(2.2rem, 3.4vw, 3.8rem);
  font-weight: 660;
  letter-spacing: -0.065em;
  line-height: 0.98;
  white-space: nowrap;
}

.contact-history-heading {
  align-items: start;
}

.contact-mode-switch {
  display: grid;
  min-width: 12.5rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid #d8dddb;
  border-radius: 999px;
  background: #eef1ef;
}

.contact-mode-switch button {
  min-height: 2.45rem;
  padding: 0 0.9rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #5f6764;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 720;
  transition:
    background-color 180ms ease,
    box-shadow 180ms ease,
    color 180ms ease;
}

.contact-history-page .contact-field-label b,
.contact-history-page .contact-reply-method legend b,
.contact-history-page .contact-field-label em[data-required="true"],
.contact-history-page .contact-consent small b {
  color: #765342;
}

.contact-history-page .contact-field-label em,
.contact-history-page .contact-field-label b[data-optional="true"] {
  color: #6b716f;
}

.contact-history-page .contact-segmented-control span {
  color: #626866;
}

.contact-history-page .contact-file-drop small,
.contact-history-page .contact-file-drop em {
  color: #666c6a;
}

.contact-mode-switch button[aria-pressed="true"] {
  background: var(--history-ink);
  box-shadow: 0 0.5rem 1.2rem rgb(20 29 26 / 13%);
  color: #ffffff;
}

.contact-mode-switch button:focus-visible {
  outline: 2px solid var(--history-ink);
  outline-offset: 2px;
}

.contact-workspace.is-mode-switching > :not(.contact-guide-intro) {
  opacity: 0;
  transform: translateY(0.5rem);
}

.contact-history-index,
.contact-history-detail {
  min-width: 0;
  min-height: clamp(45rem, 72svh, 60rem);
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 180ms ease,
    transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.contact-new-inquiry-panel[hidden],
.contact-history-page .contact-guide[hidden],
.contact-history-index[hidden],
.contact-history-detail[hidden] {
  display: none !important;
}

.contact-workspace[data-mode="history"] {
  grid-template-columns: minmax(25rem, 0.78fr) minmax(32rem, 1.22fr);
  background: var(--history-ink);
}

.contact-history-index {
  background: rgb(255 255 255 / 97%);
}

.contact-history-index-content {
  display: grid;
  align-content: start;
  gap: clamp(1.8rem, 3vw, 2.7rem);
  min-height: 100%;
  padding: clamp(2rem, 4vw, 4rem);
}

.contact-history-prototype-note {
  margin: 0;
  padding: 1rem 1.1rem;
  border: 1px solid #d7ddda;
  border-radius: 0.9rem;
  background: #f5f7f6;
  color: #626a67;
  font-size: 0.69rem;
  line-height: 1.6;
}

.contact-history-list {
  display: grid;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--history-line);
  list-style: none;
}

.contact-history-list li {
  border-bottom: 1px solid var(--history-line);
}

.contact-history-list button {
  display: grid;
  width: 100%;
  grid-template-columns: 2.2rem minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 1.45rem 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.contact-history-list button:focus-visible {
  outline: 2px solid var(--history-ink);
  outline-offset: 3px;
}

.contact-history-list-number {
  display: grid;
  width: 2.05rem;
  height: 2.05rem;
  place-items: center;
  border: 1px solid #c4cbc8;
  border-radius: 50%;
  color: #7b8480;
  font-size: 0.58rem;
  font-weight: 760;
}

.contact-history-list-copy {
  display: grid;
  gap: 0.48rem;
}

.contact-history-list-copy small {
  color: #818986;
  font-size: 0.6rem;
  letter-spacing: 0.025em;
}

.contact-history-list-copy strong {
  font-size: clamp(0.95rem, 1.25vw, 1.18rem);
  font-weight: 690;
  letter-spacing: -0.035em;
}

.contact-history-list-copy > span {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.contact-history-list-copy em {
  padding: 0.32rem 0.52rem;
  border-radius: 999px;
  background: #edf0ef;
  color: #68716d;
  font-size: 0.56rem;
  font-style: normal;
  font-weight: 680;
}

.contact-history-list button > i {
  font-style: normal;
  transition: transform 180ms ease;
}

.contact-history-list button:hover > i,
.contact-history-list button:focus-visible > i {
  transform: translateX(0.22rem);
}

.contact-history-list button[aria-current="true"] .contact-history-list-number {
  border-color: var(--history-ink);
  background: var(--history-ink);
  color: #ffffff;
}

.contact-history-list button[aria-current="true"] .contact-history-list-copy strong {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.35rem;
}

.contact-history-detail {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: clamp(2rem, 3.5vw, 3.5rem);
  border-left: 1px solid var(--history-ink);
  background: var(--history-panel);
}

.contact-history-detail-heading {
  padding-bottom: clamp(1.5rem, 3vw, 2.6rem);
  border-bottom: 1px solid #d9dedd;
}

.contact-history-detail-heading p,
.contact-history-detail-heading h2,
.contact-history-detail-heading small {
  margin: 0;
}

.contact-history-detail-heading p {
  font-size: 0.62rem;
  font-weight: 760;
  letter-spacing: 0.2em;
}

.contact-history-detail-heading h2 {
  margin-top: 0.65rem;
  font-size: clamp(2.2rem, 3.4vw, 3.8rem);
  font-weight: 660;
  letter-spacing: -0.065em;
  line-height: 0.98;
}

.contact-history-detail-heading small {
  display: block;
  margin-top: 1rem;
  color: #69706e;
  font-size: 0.7rem;
}

.contact-history-detail-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: clamp(1.7rem, 3vw, 2.8rem) 0;
  overscroll-behavior: contain;
  scrollbar-color: #a9b1ae transparent;
  scrollbar-width: thin;
}

.contact-history-detail article {
  display: grid;
  gap: 2rem;
}

.contact-history-detail article[hidden] {
  display: none;
}

.contact-history-detail article header,
.contact-history-detail article section {
  display: grid;
  gap: 0.8rem;
}

.contact-history-detail h3,
.contact-history-detail h4,
.contact-history-detail p {
  margin: 0;
}

.contact-history-detail article header small {
  color: #737b78;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
}

.contact-history-detail h3 {
  max-width: 18ch;
  font-size: clamp(1.65rem, 2.45vw, 2.65rem);
  font-weight: 680;
  letter-spacing: -0.055em;
  line-height: 1.08;
}

.contact-history-detail h4 {
  padding-bottom: 0.65rem;
  border-bottom: 1px solid #d4dad8;
  color: #5d6562;
  font-size: 0.64rem;
  font-weight: 760;
  letter-spacing: 0.08em;
}

.contact-history-detail article section > p {
  color: #414744;
  font-size: 0.83rem;
  letter-spacing: -0.018em;
  line-height: 1.8;
}

.contact-history-files {
  display: grid;
  gap: 0.55rem;
}

.contact-history-files button {
  display: flex;
  min-height: 3.4rem;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1rem;
  border: 1px solid #d4dad8;
  border-radius: 0.8rem;
  background: rgb(255 255 255 / 70%);
  color: #262b29;
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 680;
  text-align: left;
}

.contact-history-files button::after {
  content: "↗";
}

.contact-history-files button span {
  margin-left: auto;
  color: #7a827f;
  font-size: 0.6rem;
  font-weight: 560;
}

.contact-history-files button:hover,
.contact-history-files button:focus-visible {
  border-color: #76807c;
  background: #ffffff;
}

.contact-history-empty {
  color: #858d8a !important;
}

.contact-history-status {
  min-height: 1.2rem;
  margin: 0;
  color: #4d625a;
  font-size: 0.65rem;
}

@media (max-width: 74rem) {
  .contact-mode-switch {
    min-width: 11.5rem;
  }

  .contact-workspace[data-mode="history"] {
    grid-template-columns: minmax(21rem, 0.8fr) minmax(27rem, 1.2fr);
  }
}

@media (max-width: 48rem) {
  .contact-history-page {
    padding: 2rem 1rem 3rem;
  }

  .contact-history-page .contact-form-content {
    width: 100%;
  }

  .contact-history-heading {
    display: grid;
  }

  .contact-mode-switch {
    width: 100%;
    min-width: 0;
  }

  .contact-workspace[data-mode="history"] {
    grid-template-columns: 1fr;
  }

  .contact-history-index,
  .contact-history-detail {
    min-height: auto;
  }

  .contact-history-index-content,
  .contact-history-detail {
    padding: 1.5rem;
  }

  .contact-history-detail {
    border-top: 1px solid var(--history-ink);
    border-left: 0;
  }

  .contact-history-detail-body {
    overflow: visible;
  }

  .contact-history-list button {
    grid-template-columns: 2.1rem minmax(0, 1fr) auto;
  }

  .contact-history-files button {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .contact-history-files button span {
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .contact-workspace.is-mode-switching > :not(.contact-guide-intro),
  .contact-history-index,
  .contact-history-detail {
    transition-duration: 0.01ms !important;
  }
}
