/* freehp.jp AIと電話で相談（試作）。chat.cssの色変数を流用し、全画面オーバーレイで通話UIを出す。 */

.call-overlay {
  position: fixed;
  inset: 0;
  z-index: 950;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(20, 29, 49, 0.55);
  font-family: "Zen Kaku Gothic New", sans-serif;
}

.call-panel {
  width: 380px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  background: var(--paper, #FBFAF6);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(20, 29, 49, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.call-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line, #E5E1D8);
  background: var(--white, #fff);
}

.call-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink, #1E2A44);
}

.call-close {
  border: none;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: var(--ink, #1E2A44);
  padding: 4px 6px;
}

.call-body {
  padding: 20px 18px;
  overflow-y: auto;
  flex: 1 1 auto;
}

/* 通話開始前の同意画面 */
.call-consent-note {
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink, #1E2A44);
  background: var(--white, #fff);
  border: 1px solid var(--yamabuki-deep, #D99A00);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.call-start-button {
  display: block;
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 14px;
  background: var(--ink, #1E2A44);
  color: var(--white, #fff);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.call-start-button:hover,
.call-start-button:focus-visible {
  background: var(--ink-deep, #141D31);
}

/* 通話非対応ブラウザの案内 */
.call-unsupported {
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink, #1E2A44);
}

.call-unsupported-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--yamabuki-text, #8F6400);
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  font-size: 13px;
  padding: 0;
}

/* 通話中エリア */
.call-status {
  text-align: center;
  font-size: 12px;
  color: var(--ink, #1E2A44);
  opacity: 0.7;
  margin-bottom: 10px;
}

.call-status.is-listening {
  color: var(--yamabuki-text, #8F6400);
  opacity: 1;
}

.call-status.is-speaking {
  color: var(--ink, #1E2A44);
  opacity: 1;
}

.call-caption {
  min-height: 72px;
  background: var(--white, #fff);
  border: 1px solid var(--line, #E5E1D8);
  border-radius: 12px;
  padding: 14px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink, #1E2A44);
  margin-bottom: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.call-log {
  max-height: 120px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.call-log-line {
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink, #1E2A44);
  opacity: 0.75;
}

.call-log-line.is-user::before {
  content: "あなた: ";
  font-weight: 700;
  opacity: 0.9;
}

.call-log-line.is-bot::before {
  content: "AI: ";
  font-weight: 700;
  opacity: 0.9;
}

.call-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 4px 0 8px;
}

.call-mic-button {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: none;
  background: var(--ink, #1E2A44);
  color: var(--white, #fff);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(20, 29, 49, 0.28);
}

.call-mic-button.is-listening {
  background: var(--yamabuki-deep, #D99A00);
}

.call-mic-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.call-hangup-button {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: #B3261E;
  color: var(--white, #fff);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(179, 38, 30, 0.28);
}

.call-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.call-links a {
  display: block;
  text-align: center;
  border: 1px solid var(--line, #E5E1D8);
  border-radius: 10px;
  padding: 10px;
  font-size: 13px;
  color: var(--ink, #1E2A44);
  text-decoration: none;
  background: var(--white, #fff);
}

.call-links a:hover,
.call-links a:focus-visible {
  border-color: var(--ink, #1E2A44);
}

@media (max-width: 420px) {
  .call-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .call-panel {
    width: 100%;
    max-width: 100vw;
    max-height: 92vh;
    border-radius: 16px 16px 0 0;
  }
}
