﻿/* 初回表示アニメーション (フライング防止＆ワクワク感) */
  .char-anim {
        opacity: 0;
        -webkit-animation: fadeInChar 0.1s forwards;
        animation: fadeInChar 0.1s forwards;
    }
    @-webkit-keyframes fadeInChar { to { opacity: 1; } }
    @keyframes fadeInChar { to { opacity: 1; } }

    #step-maker .maker-grid {
        opacity: 1;
    }
    @-webkit-keyframes fadeInSeq {
        to { opacity: 1; }
    }
    @keyframes fadeInSeq {
        to { opacity: 1; }
    }
    @-webkit-keyframes fadeInDownSeq {
        0% { opacity: 0; -webkit-transform: translateY(-20px); transform: translateY(-20px); }
        100% { opacity: 1; -webkit-transform: translateY(0); transform: translateY(0); }
    }
    @keyframes fadeInDownSeq {
        0% { opacity: 0; transform: translateY(-20px); }
        100% { opacity: 1; transform: translateY(0); }
    }

  /* カスタムダイアログ用CSS */
.dialogue-subtitle {
    font-size: 13px;
    font-weight: 600;
    color: #888;
    text-shadow: 1px 1px #000;
}
.dialogueCATCH {
    font-size: 19px;
    font-weight: bold;
    text-align: center;
    margin: 0 auto 20px auto;
    width: 95%;
    box-sizing: border-box;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    background: linear-gradient(135deg, rgba(40,40,40,0.9), rgba(20,20,20,0.9));
    border: 1px solid #444;
    border-top: 3px solid #d1121c;
    border-radius: 8px;
    padding: 15px 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    line-height: 1.4;
}
  @media (min-width: 768px) {
      .dialogueCATCH {
          width: 92%;
      }
  }

  .dialogue-skip-btn {
      color: #f7e56f !important;
      font-size: 14px;
      text-decoration: none !important;
      position: relative;
      display: inline-block;
      border-bottom: 1px solid rgba(247, 229, 111, 0.4);
      margin-right: 15px;
      padding-bottom: 2px;
  }
  .dialogue-skip-btn::before {
      content: "＞";
      position: absolute;
      right: -15px;
      top: 50%;
      transform: translateY(-50%);
      font-size: 12px;
      color: rgba(247, 229, 111, 0.7);
  }

  /* チャットUI化用スタイル */


  .progress-bar-container {
    display: flex;
    height: 14px;
    width: 92%;
    margin: 0 auto;
}
.progress-segment {
    flex: 1;
    position: relative;
    background: #000;
    border-top: 1px solid #333;
    border-bottom: 1px solid #333;
    box-sizing: border-box;
}
.progress-segment:first-child {
    border-left: 1px solid #333;
    border-radius: 3px 0 0 3px;
    z-index: 3;
}
.progress-segment:nth-child(2) {
    z-index: 2;
}
.progress-segment:last-child {
    border-right: 1px solid #333;
    border-radius: 0 3px 3px 0;
    z-index: 1;
}
.progress-segment::after {
    content: '';
    position: absolute;
    top: -1px;
    right: -14px;
    width: 0;
    height: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 14px solid #000;
    z-index: 2;
}
.progress-segment::before {
    content: '';
    position: absolute;
    top: -1px;
    right: -15px;
    width: 0;
    height: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 14px solid #555;
    z-index: 1;
}
.progress-segment:last-child::after,
.progress-segment:last-child::before {
    display: none;
}
.progress-segment.completed, .progress-segment.active {
    background: #f7e56f;
    border-color: #d4b000;
}
.progress-segment.completed::after, .progress-segment.active::after {
    border-left-color: #f7e56f;
}
.progress-segment.completed::before, .progress-segment.active::before {
    border-left-color: #d4b000;
}
.progress-label.completed {
      cursor: pointer;
  }
  .progress-label.completed:hover {
      text-decoration: underline;
      color: #d1121c;
  }
  .chat-avatar img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center 15%; /* 顔にフォーカス */
  }
  .chat-catch-wrapper .dialogueCATCH {
      flex: 1;
      min-width: 0; /* フレックスアイテムの突き破り防止 */
      word-break: normal;
      overflow-wrap: break-word; /* 溢れる場合は折り返す */
      margin: 0 !important;
      border-radius: 12px;
      border-top-left-radius: 2px;
      position: relative;
  }
  .chat-catch-wrapper .dialogueCATCH::before {
      content: '';
      position: absolute;
      top: 15px;
      left: -8px;
      width: 0;
      height: 0;
      border-top: 7px solid transparent;
      border-bottom: 7px solid transparent;
      border-right: 8px solid #444;
  }
  .chat-catch-wrapper .dialogueCATCH::after {
      content: '';
      position: absolute;
      top: 16px;
      left: -6px;
      width: 0;
      height: 0;
      border-top: 6px solid transparent;
      border-bottom: 6px solid transparent;
      border-right: 7px solid #282828;
  }
  
  #step-calendar .dialogueCATCH {
      text-align: left !important;
  }

.dialogueCATCH .small-text {
    font-size: 0.7em;
    font-weight: normal;
    color: #ddd;
}
/* プログレスバー（ステップフロー） */
.step-progress-wrapper {
    margin-top: 15px;
    width: 100%;
}
.progress-labels {
    display: flex;
    width: 92%;
    margin: 0 auto 5px auto;
}
.progress-label {
    flex: 1;
    text-align: center;
    font-size: 11px;
    color: #999;
}
.progress-bar-container {
    display: flex;
    height: 14px;
    width: 92%;
    margin: 0 auto;
}
.progress-segment {
    flex: 1;
    position: relative;
    background: #000;
    border-top: 1px solid #333;
    border-bottom: 1px solid #333;
    box-sizing: border-box;
}
.progress-segment:first-child {
    border-left: 1px solid #333;
    border-radius: 3px 0 0 3px;
    z-index: 3;
}
.progress-segment:nth-child(2) {
    z-index: 2;
}
.progress-segment:last-child {
    border-right: 1px solid #333;
    border-radius: 0 3px 3px 0;
    z-index: 1;
}
.progress-segment::after {
    content: '';
    position: absolute;
    top: -1px;
    right: -14px;
    width: 0;
    height: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 14px solid #000;
    z-index: 2;
}
.progress-segment::before {
    content: '';
    position: absolute;
    top: -1px;
    right: -15px;
    width: 0;
    height: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 14px solid #555;
    z-index: 1;
}
.progress-segment:last-child::after,
.progress-segment:last-child::before {
    display: none;
}
.progress-segment.completed {
    background: #f7e56f;
    border-color: #d4b000;
}
.progress-segment.completed::after {
    border-left-color: #f7e56f;
}
.progress-segment.completed::before {
    border-left-color: #d4b000;
}
.progress-segment.active {
    background: #fcf6ba; /* 少し薄くて上品なイエロー */
    border-color: #e5cd4d;
}
.progress-segment.active::after {
    border-left-color: #fcf6ba;
}
.progress-segment.active::before {
    border-left-color: #e5cd4d;
}
.progress-label.completed {
    color: #fff;
    font-weight: bold;
}
.progress-label.active {
    color: #fcf6ba; /* テキストも少し淡いイエローに */
    font-weight: bold;
}
.progress-bar-container {
    display: flex;
    height: 14px;
    width: 92%;
    margin: 0 auto;
}


/* 不要なネイティブラベルを隠す */

.dialogue-next-btn {
    display: inline-block;
    background: #333;
    color: #fff;
    padding: 12px 40px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    border: 1px solid #555;
    transition: background 0.2s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}
.dialogue-next-btn:hover {
    background: #555;
}
.maker-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 15px;
    width: 96%;
    margin: 15px auto 0 auto;
    box-sizing: border-box;
}
.maker-grid-inner {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding-top: 8px;
}
@media (max-width: 768px) {
    .maker-grid { grid-template-columns: repeat(2, 1fr); }
    .maker-grid-inner { grid-template-columns: repeat(2, 1fr); }
}

.maker-tab, .maker-tab-toggle {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}
.maker-logo {
    flex: 0 0 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}
.maker-name {
    font-size: 13px;
    font-weight: bold;
    color: #333;
    line-height: 1.2;
}
.maker-tab:hover, .maker-tab-toggle:hover {
    transform: translateY(-2px);
    border-color: #d1121c;
    box-shadow: 0 4px 8px rgba(209,18,28,0.15);
}
.maker-name {
    font-size: 14px;
    font-weight: 600;
}
.bike-list-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 16px 0 0; /* スクロールバー用の余裕 */
    width: 96%;
    margin: 0 auto;
    box-sizing: border-box;
    list-style: none;
    max-height: 400px;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #555 #1d1d1d;
}
/* スクロールバーの黒系リッチ化 */
.bike-list-grid::-webkit-scrollbar {
    width: 8px;
}
.bike-list-grid::-webkit-scrollbar-track {
    background: #1d1d1d;
    border-radius: 4px;
}
.bike-list-grid::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}
.bike-list-grid::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* 排気量リストをメーカー選択のような2列ボタン風にする */
#dialogue-displacement-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
#dialogue-displacement-list.single-column {
    grid-template-columns: 1fr;
}
#dialogue-displacement-list.single-column .bike-item {
    padding: 8px 5px;
}
#dialogue-displacement-list .bike-item {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    padding: 11px 12px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 5px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.bike-item {
    background: #fff;
    border: 1px solid #eee;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.bike-item:hover {
    background: #eee;
}

/* 車種索引UI */
.bike-index-container {
    display: flex;
    flex-wrap: wrap; /* PCでの操作性向上のため折り返し */
    justify-content: flex-start;
    gap: 8px;
    padding: 10px 10px;
    background: #1d1d1d;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.5);
    margin-bottom: 6px;
    box-sizing: border-box;
}
.bike-index-container::-webkit-scrollbar {
    display: none; /* Hide scrollbar for clean look */
}
.bike-index-btn, .bike-index-btn:link, .bike-index-btn:visited {
    flex: 0 0 auto;
    display: inline-block;
    padding: 5px 12px 0px 12px;
    background: #333;
    border: 1px solid #555;
    border-radius: 20px;
    color: #ddd;
    font-size: 14px;
    font-weight: bold;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.2s;
}
.bike-index-btn:hover, .bike-index-btn:active {
    background: #d1121c;
    color: #fff;
    border-color: #d1121c;
}
.bike-index-header {
    width: 100%;
    padding: 5px 5px 5px 10px;
    margin-top: 15px;
    margin-bottom: 0px;
    font-size: 18px;
    font-weight: bold;
    color: #ccc;
    border-bottom: 1px solid #444;
    border-left: 4px solid #444;
    text-align: left;
    cursor: default;
    background: none;
}
.bike-index-header:hover {
    background: none;
    border-color: #444;
    color: #ccc;
}

/* ローディングアニメーション */
.dialogue-loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #d1121c;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 非表示用 */
.hidden-permanent {
    display: none !important;
}

#dialogue-custom-ui .dialogue-step > div[style*="text-align: left"] {
    display: none !important;
}
.AE-input.step-content {
    width: 96%;
    margin: 0 auto !important;
    box-sizing: border-box;
}
