.matching-section,
.inquiry-section,
.board-section {
  scroll-margin-top: 84px;
}

.matching-section {
  padding: 64px 6vw;
  background: linear-gradient(180deg, #ffffff 0%, #f2f7fa 100%), var(--paper);
}

.matching-shell,
.match-results-panel,
.inquiry-layout {
  display: grid;
  gap: 22px;
}

.matching-shell {
  grid-template-columns: minmax(300px, 0.78fr) minmax(420px, 1.22fr);
  align-items: start;
}

.matching-console,
.match-detail,
.account-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 20px 52px rgba(20, 32, 51, 0.08);
}

.matching-console {
  display: grid;
  gap: 18px;
  padding: 22px;
  background: #0b2847;
}

.wizard-step {
  display: grid;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

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

.wizard-step > span,
.account-head strong {
  color: #bfeee7;
  font-weight: 900;
}

.wizard-step h3,
.account-head h3 {
  margin: 0;
  color: var(--white);
}

.mode-toggle,
.choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mode-toggle button,
.choice-chip {
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 0 13px;
  color: #dceefa;
  background: rgba(255, 255, 255, 0.07);
  font-weight: 900;
  cursor: pointer;
}

.mode-toggle button.is-active,
.choice-chip.is-active {
  color: #09243d;
  background: var(--yellow);
  border-color: var(--yellow);
}

.choice-chip:disabled {
  color: rgba(255, 255, 255, 0.42);
  cursor: not-allowed;
}

.match-results-panel {
  grid-template-columns: minmax(260px, 0.85fr) minmax(300px, 1fr);
  align-items: start;
}

.match-list {
  display: grid;
  gap: 12px;
}

.match-card {
  display: grid;
  gap: 10px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 17px;
  color: var(--ink);
  text-align: left;
  background: var(--white);
  box-shadow: 0 14px 34px rgba(20, 32, 51, 0.06);
  cursor: pointer;
}

.match-card:hover,
.match-card.is-selected {
  border-color: var(--teal);
  box-shadow:
    inset 5px 0 0 var(--teal),
    0 16px 36px rgba(0, 139, 143, 0.12);
}

.match-card h3,
.match-detail h3,
.account-head h3 {
  margin: 0;
}

.match-card p,
.match-detail p,
.board-requester {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.match-detail {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 16px;
  padding: 22px;
  background: var(--white);
}

.match-detail dl {
  display: grid;
  gap: 12px;
  margin: 0;
}

.match-detail dt {
  color: var(--muted);
  font-weight: 900;
}

.match-detail dd {
  margin: 0;
  line-height: 1.6;
}

.match-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 15px;
  color: #173c5f;
  background: #eef6ff;
  font-weight: 900;
  cursor: pointer;
}

.secondary-action:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.inquiry-layout {
  grid-template-columns: minmax(280px, 0.72fr) minmax(360px, 1.28fr);
  align-items: start;
}

.account-panel {
  display: grid;
  gap: 18px;
  padding: 22px;
  color: var(--white);
  background: linear-gradient(145deg, #082846, #0b5f66);
}

.account-forms,
.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form {
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.auth-form.signup-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.auth-form label {
  display: grid;
  gap: 7px;
  font-weight: 800;
}

.auth-form input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  padding: 12px 13px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

.auth-form input:focus {
  border-color: var(--yellow);
  outline: none;
}

.account-panel .secondary-button {
  border-color: rgba(255, 255, 255, 0.36);
}

.logout-button {
  display: none;
}

.account-panel.is-signed-in .account-forms {
  display: none;
}

.account-panel.is-signed-in .logout-button {
  display: inline-flex;
  justify-self: start;
}

.stats-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  max-width: 1080px;
  margin-bottom: 18px;
}

.stat-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #f8fbff;
}

.stat-item strong,
.stat-item span {
  display: block;
}

.stat-item span {
  margin-top: 6px;
  color: var(--teal);
  font-size: 1.25rem;
  font-weight: 900;
}

.stat-item p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.answer-list,
.answer-form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.answer-list article {
  border-left: 4px solid var(--teal);
  padding: 10px 0 10px 12px;
  background: #f6fbfa;
}

.answer-form textarea {
  width: 100%;
  border: 1px solid #b9c7d8;
  border-radius: 8px;
  padding: 12px;
  resize: vertical;
}

.support-dialog {
  width: min(1120px, calc(100vw - 32px));
  max-height: min(820px, calc(100vh - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  color: var(--ink);
  background: var(--white);
  box-shadow: 0 36px 90px rgba(5, 43, 85, 0.3);
}

.support-dialog::backdrop {
  background: rgba(5, 17, 31, 0.52);
  backdrop-filter: blur(4px);
}

.support-dialog-shell {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.support-dialog-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.support-dialog-header h2,
.support-dialog-header p {
  margin: 0;
}

.support-dialog-header p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.6;
}

.dialog-close {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--white);
  font-weight: 900;
  cursor: pointer;
}

.support-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.support-tabs button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: #25415f;
  background: #f5f8fb;
  font-weight: 900;
  cursor: pointer;
}

.support-tabs button.is-active {
  color: var(--white);
  border-color: var(--teal);
  background: var(--teal);
}

.support-table-wrap {
  max-height: 560px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.support-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  background: var(--white);
}

.support-table th,
.support-table td {
  border-bottom: 1px solid #c6d8e8;
  border-right: 1px solid #c6d8e8;
  padding: 13px 14px;
  text-align: left;
  vertical-align: top;
  line-height: 1.55;
}

.support-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--white);
  background: #2c96cf;
  font-weight: 900;
}

.support-table td:first-child {
  background: #e7f2fa;
  font-weight: 900;
}

@media (max-width: 980px) {
  .matching-shell,
  .match-results-panel,
  .inquiry-layout,
  .auth-form.signup-form {
    grid-template-columns: 1fr;
  }

  .match-detail {
    position: static;
  }

  .support-dialog-shell {
    padding: 18px;
  }

  .support-dialog-header {
    display: grid;
  }
}
