.hn-ai-bridge,
.hn-ai-bridge * {
  box-sizing: border-box;
}

.hn-ai-bridge {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 18px;
  border: 1px solid rgba(255, 115, 38, .16);
  border-radius: 24px;
  background: #fffdfb;
  box-shadow: 0 18px 42px rgba(255, 118, 35, .11), 0 4px 16px rgba(80, 40, 20, .05);
  color: #2a221d;
}

.hn-ai-bridge__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.hn-ai-bridge__kicker {
  margin: 0 0 3px;
  color: #ff6b1a;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
}

.hn-ai-bridge__head h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
}

.hn-ai-bridge__status {
  flex: none;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff2ea;
  color: #9a3412;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.hn-ai-bridge__notice {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff7ed;
  color: #7c2d12;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.7;
}

.hn-ai-bridge__messages {
  display: grid;
  gap: 12px;
  min-height: 160px;
  max-height: none;
  overflow-y: visible;
  padding: 14px;
  border: 1px solid rgba(255, 115, 38, .12);
  border-radius: 18px;
  background: #fffaf6;
}

.hn-ai-bridge__message {
  display: grid;
  gap: 4px;
  max-width: min(92%, 760px);
}

.hn-ai-bridge__message--user {
  justify-self: end;
}

.hn-ai-bridge__message--assistant,
.hn-ai-bridge__message--system {
  justify-self: start;
}

.hn-ai-bridge__role {
  color: #8a7b72;
  font-size: 11px;
  font-weight: 800;
}

.hn-ai-bridge__bubble {
  padding: 12px 14px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(255, 115, 38, .12);
  color: #342b25;
  font-size: 15px;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.hn-ai-bridge__message--user .hn-ai-bridge__bubble {
  background: linear-gradient(135deg, #ff8a3a, #ff6417);
  color: #fff;
  border-color: transparent;
}

.hn-ai-bridge__message--system .hn-ai-bridge__bubble {
  background: #fff7ed;
  color: #7c2d12;
}

.hn-ai-bridge__form {
  position: relative;
  margin-top: 14px;
}

.hn-ai-bridge__textarea {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  min-height: 150px;
  padding: 16px 16px 68px;
  border: 1px solid rgba(255, 118, 35, .2);
  border-radius: 18px;
  background: #fff;
  color: #2a221d;
  font: inherit;
  font-size: 16px;
  line-height: 1.7;
  resize: vertical;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.5);
}

.hn-ai-bridge__textarea:focus {
  border-color: rgba(255, 107, 26, .58);
  box-shadow: 0 0 0 4px rgba(255, 107, 26, .12);
}

.hn-ai-bridge__submit {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 132px;
  min-height: 44px;
  padding: 11px 18px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff8a3a, #ff6417);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(255, 111, 28, .26);
}

.hn-ai-bridge__submit:disabled {
  opacity: .62;
  cursor: wait;
}

@media (min-width: 900px) {
  .hn-ai-bridge {
    padding: 24px;
  }
  .hn-ai-bridge__head h2 {
    font-size: 28px;
  }
  .hn-ai-bridge__textarea {
    min-height: 170px;
  }
}


/* v0.1.3: 考え中表示・タイプライター表示 */
.hn-ai-bridge__message--thinking .hn-ai-bridge__bubble {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fff7ed;
  color: #9a3412;
  font-weight: 800;
}

.hn-ai-bridge__thinking-dots::after {
  content: '……';
  display: inline-block;
  width: 0;
  max-width: 1.8em;
  overflow: hidden;
  white-space: nowrap;
  vertical-align: bottom;
  opacity: .25;
  animation: hnAiThinkingDots 1.35s ease-in-out infinite;
}

.hn-ai-bridge__bubble.is-typing::after {
  content: '▌';
  display: inline-block;
  margin-left: 2px;
  color: #ff6b1a;
  animation: hnAiCaretBlink .8s steps(1, end) infinite;
}

@keyframes hnAiThinkingDots {
  0% {
    width: 0;
    opacity: .18;
  }
  42% {
    width: 1.1em;
    opacity: .95;
  }
  72% {
    width: 1.8em;
    opacity: 1;
  }
  100% {
    width: 1.8em;
    opacity: .28;
  }
}

@keyframes hnAiCaretBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* v0.1.4: AI相談室上部注意文 */

/* v0.1.8: AI条件整理後の求人カード表示 */
.hn-ai-bridge__job-results-wrap {
  width: 100%;
  max-width: 100%;
}

.hn-ai-job-results {
  margin: 8px 0 0;
  padding: 16px;
  border: 1px solid rgba(255, 115, 38, .16);
  border-radius: 18px;
  background: #fffdfb;
}

.hn-ai-job-results__head {
  margin-bottom: 12px;
}

.hn-ai-job-results__kicker {
  margin: 0 0 4px;
  color: #ff6b1a;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
}

.hn-ai-job-results__head h3 {
  margin: 0 0 6px;
  color: #2a221d;
  font-size: 20px;
  line-height: 1.35;
}

.hn-ai-job-results__head p {
  margin: 0;
  color: #6b5c53;
  font-size: 13px;
  line-height: 1.7;
}

.hn-ai-job-results__empty {
  padding: 14px;
  border-radius: 14px;
  background: #fff7ed;
  color: #7c2d12;
  font-size: 14px;
  line-height: 1.7;
}

.hn-ai-job-results__grid {
  display: grid;
  gap: 12px;
}

.hn-ai-job-card {
  overflow: hidden;
  border: 1px solid rgba(255, 115, 38, .16);
  border-radius: 16px;
  background: #fff;
}

.hn-ai-job-card__inner,
.hn-ai-job-card__link {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 12px;
  padding: 12px;
  color: inherit;
  text-decoration: none;
}

.hn-ai-job-card__thumb {
  overflow: hidden;
  min-height: 112px;
  border-radius: 12px;
  background: #fff7ed;
}

.hn-ai-job-card__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 112px;
  object-fit: cover;
}

.hn-ai-job-card__body {
  min-width: 0;
}

.hn-ai-job-card h4 {
  margin: 0 0 5px;
  color: #2a221d;
  font-size: 16px;
  line-height: 1.45;
}

.hn-ai-job-card h4 a {
  color: inherit;
  text-decoration: none;
}

.hn-ai-job-card h4 a:hover {
  text-decoration: underline;
}

.hn-ai-job-card__meta,
.hn-ai-job-card__summary {
  margin: 0 0 7px;
  color: #6b5c53;
  font-size: 13px;
  line-height: 1.65;
}

.hn-ai-job-card__meta a {
  color: inherit;
  text-decoration: none;
}

.hn-ai-job-card__meta a:hover {
  color: #ea580c;
  text-decoration: underline;
}

.hn-ai-job-card__salary {
  margin: 0 0 7px;
  color: #ea580c;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.5;
}

.hn-ai-job-card__reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
}

.hn-ai-job-card__reasons li {
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 12px;
  font-weight: 800;
}

.hn-ai-job-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.hn-ai-job-card__tags span,
.hn-ai-job-card__tags a {
  padding: 3px 7px;
  border-radius: 999px;
  background: #f8fafc;
  color: #695b52;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

.hn-ai-job-card__tags a:hover {
  background: #fff7ed;
  color: #ea580c;
}

.hn-ai-job-card__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  padding: 8px 13px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff8a3a, #ff6417);
  color: #fff !important;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.hn-ai-job-card__button:hover {
  opacity: .9;
}

@media (max-width: 640px) {
  .hn-ai-job-card__inner,
.hn-ai-job-card__link {
    grid-template-columns: 86px 1fr;
    gap: 10px;
  }
  .hn-ai-job-card__thumb,
  .hn-ai-job-card__thumb img {
    min-height: 86px;
  }
}


/* v0.1.9: はい/いいえ・選択肢ボタン */
.hn-ai-bridge__quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.hn-ai-bridge__quick-reply {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 13px;
  border: 1px solid rgba(255, 115, 38, .24);
  border-radius: 999px;
  background: #fff;
  color: #9a3412;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255, 118, 35, .08);
  transition: background .16s ease, transform .16s ease, box-shadow .16s ease;
}

.hn-ai-bridge__quick-reply:hover,
.hn-ai-bridge__quick-reply:focus-visible {
  background: #fff7ed;
  transform: translateY(-1px);
  box-shadow: 0 7px 18px rgba(255, 118, 35, .14);
  outline: none;
}

.hn-ai-bridge.is-busy .hn-ai-bridge__quick-reply {
  pointer-events: none;
  opacity: .55;
}

@media (max-width: 640px) {
  .hn-ai-bridge__quick-replies {
    gap: 7px;
  }
  .hn-ai-bridge__quick-reply {
    min-height: 34px;
    padding: 7px 11px;
    font-size: 12px;
  }
}


/* v0.1.32: AI求人候補を求人アーカイブカード表示へ寄せる */
.hn-ai-bridge__job-results-wrap {
  width: 100%;
  max-width: 100%;
  margin-top: 14px;
}

.hn-ai-job-results.hn-ai-job-results--archive {
  margin: 8px 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.hn-ai-job-results--archive .hn-ai-job-results__head {
  margin: 0 0 14px;
  padding: 0 2px;
}

.hn-ai-job-results--archive .hn-ai-job-results__kicker {
  margin-bottom: 3px;
}

.hn-ai-job-results--archive .hn-ai-job-results__head h3 {
  font-size: 22px;
}

.hn-ai-job-results--archive .hn-ai-job-results__head p {
  font-size: 14px;
}

.hn-ai-job-results__grid.hn-ai-job-results__grid--archive,
.hn-ai-job-results--archive .hn-job-list {
  display: grid;
  gap: 18px;
}

.hn-ai-job-results--archive .hn-job-card {
  width: 100%;
  max-width: 100%;
}

.hn-ai-job-results--archive .hn-job-card__cta-btn,
.hn-ai-job-results--archive .hn-job-card__button {
  color: #fff !important;
}

/* v0.1.33: ページ遷移後の相談再開表示 */
.hn-ai-bridge__resume-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 115, 38, .14);
  border-radius: 14px;
  background: #fff7ed;
  color: #7c2d12;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.5;
}

.hn-ai-bridge__resume-notice button {
  flex: none;
  min-height: 32px;
  padding: 6px 11px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #ea580c;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255, 118, 35, .1);
}

@media (max-width: 640px) {
  .hn-ai-bridge__resume-notice {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Salary reverse result groups (v0.1.74) */
.hn-ai-job-results--salary-reverse .hn-ai-job-results__match-note {
  margin-top: 10px;
}

.hn-ai-job-results__salary-group {
  margin-top: 20px;
}

.hn-ai-job-results__salary-group > h4 {
  margin: 0 0 6px;
  color: #2a221d;
  font-size: 16px;
  line-height: 1.5;
}

.hn-ai-job-results__salary-group > p {
  margin: 0 0 12px;
  color: #6b5c53;
  font-size: 13px;
  line-height: 1.7;
}

.hn-ai-job-results__salary-group--incentive {
  padding-top: 16px;
  border-top: 1px solid #eadfd7;
}
