:root {
    --primary: #FF5B9E;
    --primary-light: #FFD0E5;
    --secondary: #6C63FF;
    --accent: #00D9C5;
    --dark: #2D3748;
    --light: #F8F9FA;
    --gradient: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    background-color: var(--light);
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 100%;
    padding: 0;
}

header {
    background: var(--gradient);
    padding: 30px 20px 100px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

header::after {
    content: '';
    position: absolute;
    bottom: -50px;
    left: 0;
    width: 100%;
    height: 100px;
    background-color: var(--light);
    border-radius: 50% 50% 0 0;
}

.logo {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    margin-bottom: 10px;
    letter-spacing: 1px;
    cursor: pointer; /* カーソルポインター追加 */
    z-index: 2; /* 泡より上に表示 */
    position: relative; /* z-indexを有効にするため */
}

.tagline {
    font-size: 1.2rem;
    color: white;
    margin-bottom: 30px;
    font-weight: 300;
}

.main-content {
    margin-top: -50px;
    position: relative;
    z-index: 10;
    padding: 0 20px;
}

.app-preview {
    background-color: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    /* padding: 30px; */
    margin-bottom: 40px;
    text-align: center;
    overflow: hidden;
    position: relative;
}

.app-preview img {
    max-width: 100%;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.feature {
    background-color: white;
    border-radius: 15px;
    padding: 25px 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    display: inline-block;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.feature h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--primary);
}

.feature p {
    font-size: 0.9rem;
    color: #666;
}

.cta-section {
    text-align: center;
    margin-bottom: 50px;
}

.cta-text {
    font-size: 1.3rem;
    margin-bottom: 20px;
    font-weight: 500;
}

.cta-button {
    display: inline-block;
    padding: 15px 40px;
    background: var(--gradient);
    color: white;
    text-decoration: none;
    font-size: 1.2rem;
    border-radius: 30px;
    font-weight: 500;
    box-shadow: 0 5px 15px rgba(255, 91, 158, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    z-index: -1;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 91, 158, 0.6);
}

.cta-button:hover::before {
    opacity: 1;
}

.how-it-works {
    margin-bottom: 50px;
    text-align: center;
}

.how-it-works h2 {
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: var(--primary);
    position: relative;
    display: inline-block;
}

.how-it-works h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: var(--gradient);
    border-radius: 3px;
}

.steps {
    display: flex;
    flex-direction: column;
    gap: 30px;
    max-width: 600px;
    margin: 0 auto;
}

.step {
    display: flex;
    align-items: center;
    background-color: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

.step:hover {
    transform: translateX(5px);
}

.step-number {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    margin-right: 20px;
}

.step-content {
    text-align: left;
}

.step-content h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: var(--secondary);
}

.step-content p {
    font-size: 0.9rem;
    color: #666;
}

footer {
    background-color: var(--dark);
    color: white;
    text-align: center;
    padding: 30px 20px;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.footer-text {
    font-size: 0.9rem;
    opacity: 0.7;
    max-width: 500px;
    margin: 0 auto 20px;
}

.privacy-features {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.privacy-feature {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
}

.privacy-feature span {
    margin-right: 5px;
}

.copyright {
    font-size: 1.1rem;
    opacity: 0.5;
}

.floating-bubbles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.bubble {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 8s infinite ease-in-out;
}

.bubble:nth-child(1) {
    width: 80px;
    height: 80px;
    left: 10%;
    top: 40%;
    animation-delay: 0s;
}

.bubble:nth-child(2) {
    width: 40px;
    height: 40px;
    left: 20%;
    top: 20%;
    animation-delay: 1s;
}

.bubble:nth-child(3) {
    width: 60px;
    height: 60px;
    left: 70%;
    top: 30%;
    animation-delay: 2s;
}

.bubble:nth-child(4) {
    width: 50px;
    height: 50px;
    left: 40%;
    top: 60%;
    animation-delay: 3s;
}

.bubble:nth-child(5) {
    width: 70px;
    height: 70px;
    left: 80%;
    top: 10%;
    animation-delay: 4s;
}

@keyframes float {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 0.4;
    }
    100% {
        transform: translateY(0) rotate(360deg);
        opacity: 0.8;
    }
}

@media (max-width: 768px) {
    .features {
        grid-template-columns: 1fr;
    }
    
    .step {
        flex-direction: column;
        text-align: center;
    }
    
    .step-number {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .step-content {
        text-align: center;
    }
}

/* アニメーション */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animated {
    animation: fadeIn 0.6s ease-out forwards;
}

.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }
.delay-4 { animation-delay: 0.8s; }

/* モーダル関連のスタイル */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.input-modal, .loading-modal {
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 500px;
    animation: slideUp 0.4s ease;
    overflow: hidden;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #FF5B9E;
    font-weight: 500;
}

.close-button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.close-button:hover {
    color: #FF5B9E;
}

.modal-body {
    padding: 20px;
}

.modal-body p {
    margin-top: 0;
    color: #666;
}

.user-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
    margin-top: 20px;
}

.user-input:focus {
    outline: none;
    border-color: #6C63FF;
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.2);
}

.user-input.error {
    border-color: #ff3860;
    animation: shake 0.5s;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.cancel-button, .submit-button {
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.cancel-button {
    background-color: #f5f5f5;
    color: #666;
    border: none;
}

.cancel-button:hover {
    background-color: #e0e0e0;
}

.submit-button {
    background: linear-gradient(135deg, #FF5B9E 0%, #6C63FF 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 10px rgba(255, 91, 158, 0.3);
}

.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 91, 158, 0.4);
}

.submit-button:active {
    transform: translateY(0);
}

/* ローディングモーダルのスタイル */
.loading-modal {
    text-align: center;
    padding: 30px;
}

.loading-spinner {
    margin-bottom: 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 91, 158, 0.2);
    border-top-color: #FF5B9E;
    border-radius: 50%;
    margin: 0 auto;
    animation: spin 1s linear infinite;
}

.loading-content h3 {
    margin: 0 0 15px;
    color: #333;
}

.user-query {
    font-style: italic;
    color: #6C63FF;
    margin-bottom: 20px;
    font-weight: 500;
}

.loading-message {
    color: #FF5B9E;
    font-weight: 500;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.5s ease;
}

/* アニメーション */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* 全体コンテナ */
.experts-selection-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    font-family: 'Noto Sans JP', 'Helvetica Neue', sans-serif;
  }
  
  .experts-header h2 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  
  .experts-header .subtitle {
    font-size: 0.9rem;
    color: #666;
  }
  
  /* 専門家グリッド */
  .experts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2.5rem;
  }
  
  /* 専門家カード */
  .expert-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    animation: cardAppear 0.6s forwards;
    opacity: 0;
    transform: translateY(30px);
    height: 100%;
  }
  
  .expert-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.08);
  }
  
  @keyframes cardAppear {
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  /* カード内部 */
  .expert-card-inner {
    padding: 1.8rem;
    display: flex;
    flex-direction: column;
    height: 100%;
  }
  
  /* 専門家ヘッダー */
  .expert-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    position: relative;
  }
  
  .expert-name-title {
    flex-grow: 1;
  }
  
  .expert-name-title h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    color: #333;
  }
  
  .expert-title {
    font-size: 0.95rem;
    color: #666;
  }
  
  .expert-status {
    position: absolute;
  width: 18px;  /* 23pxから18pxに縮小 */
  height: 18px; /* 23pxから18pxに縮小 */
  border: 2px solid white;
  top: 35px;    /* 50pxから35pxに調整 */
  right: calc(50% - 25px); /* 40pxから25pxに調整 */
  transform: translate(20%, 20%);
  border-radius: 50%;
  }
  
  .expert-status.online {
    background: #4ade80;
    animation: pulse 1.5s infinite;
  }
  
  @keyframes pulse {
    0% {
      box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
    }
    70% {
      box-shadow: 0 0 0 6px rgba(74, 222, 128, 0);
    }
    100% {
      box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
    }
  }
  
  /* 実績セクション */
  .expert-achievements {
    margin-bottom: 1rem;
  }
  
  .expert-achievements h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
  }
  
  .expert-achievements h4::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 16px;
    background: #4361ee;
    margin-right: 0.5rem;
    border-radius: 2px;
  }
  
  .expert-achievements p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #555;
  }
  
  .quote-icon {
    position: absolute;
    top: -10px;
    left: 10px;
    width: 24px;
    height: 24px;
    fill: #4361ee;
    opacity: 0.2;
  }
  
  /* 選択ボタン */
  .select-expert-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: auto;
  }
  
  .select-expert-button svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
  }
  
  /* レスポンシブ対応 */
  @media (max-width: 768px) {
    .experts-grid {
      grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
      gap: 1.5rem;
    }
    
    .experts-header h2 {
      font-size: 1.8rem;
    }
    
    .expert-card-inner {
      padding: 1.2rem;
    }
  }

  /* スワイプカード関連のスタイル */
.experts-swipe-container {
    max-width: 100%;
    font-family: 'Noto Sans JP', 'Helvetica Neue', sans-serif;
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100vh;
    overflow: hidden;
  }
  
  .experts-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #9b6bff, #00cfc8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  
  .swipe-cards-wrapper {
    position: relative;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  
  .swipe-cards {
    flex-grow: 1;
    position: relative;
    overflow: hidden;
    width: 100%;
    margin: 0 auto;
    max-width: 500px;
  }
  
  .expert-swipe-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% - 80px);
    background: white;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    opacity: 0;
    transform: translateX(100%);
    transition: transform 0.4s ease, opacity 0.3s ease;
    z-index: 1;
    -webkit-overflow-scrolling: touch;
  }
  
  .expert-swipe-card.active {
    opacity: 1;
    transform: translateX(0);
    z-index: 2;
  }
  
  .expert-main-info {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
  }
  
  .expert-title {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 0.5rem;
  }
  
  .expert-achievements h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #444;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
  }
  
  .expert-achievements h4::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 16px;
    background: #4361ee;
    margin-right: 0.5rem;
    border-radius: 2px;
  }
  
  .expert-achievements p {
    font-size: 1rem;
    line-height: 1.6;
    color: #555;
  }
  
  .quote-icon {
    position: absolute;
    top: -12px;
    left: 12px;
    width: 28px;
    height: 28px;
    fill: #4361ee;
    opacity: 0.2;
  }
  
  .select-expert-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    background: linear-gradient(to right, #ff6bb3, #9b6bff);
    color: white;
    border: none;
    border-radius: 14px;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(155, 107, 255, 0.3);
  }
  
  .select-expert-button:hover,
  .select-expert-button:active {
    background: linear-gradient(to right, #9b6bff, #ff6bb3);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(255, 107, 179, 0.4);
  }
  
  .swipe-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1.5rem;
    padding: 1rem 0;
    height: 80px;
  }
  
  .nav-button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: white;
    border: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
  }
  
  .nav-button svg {
    width: 24px;
    height: 24px;
    fill: #4361ee;
  }
  
  .nav-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
  
  .nav-button:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
  }
  
  .swipe-indicators {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 1rem;
  }
  
  .swipe-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d4d4d8;
    margin: 0 4px;
    cursor: pointer;
    transition: all 0.3s ease;
  }
  
  .swipe-indicator.active {
    width: 24px;
    border-radius: 12px;
    background: #4361ee;
  }
  
  @media (min-width: 768px) {
    .app-preview img {
      max-width: 50%;
    }

    .experts-header .subtitle {
      display: none;
    }

    .experts-header h2 {
      margin-top: 1rem;
    }

    .experts-swipe-container {
      padding: 2rem;
    }
    
    .expert-swipe-card {
      max-width: 500px;
      margin: 0 auto;
      left: 50%;
      transform: translateX(-50%) translateX(100%);
    }
    
    .expert-swipe-card.active {
      transform: translateX(-50%);
    }
  }

  /* モーダル化するための修正 */
.experts-swipe-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9999;
  }
  
  /* カードが見えるようにする */
  .expert-swipe-card {
    background-color: white;
    max-height: 80vh;
  }
  
  /* 閉じるボタン */
  .modal-close-button {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    z-index: 10000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* モーダルコンテナ */
.experts-swipe-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    padding: 2rem 1rem 1rem;
  }
  
  /* ヘッダー部分 */
  .experts-header {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
  }
  
  .experts-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: white;
  }
  
  /* 戻るボタン */
  .back-button {
    position: absolute;
    left: 0;
    top: 0.3rem;
    background: none;
    border: none;
    color: #4361ee;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    cursor: pointer;
  }
  
  .back-button svg {
    width: 20px;
    height: 20px;
    margin-right: 4px;
    fill: #4361ee;
  }
  
  /* カードエリア */
  .swipe-cards-wrapper {
    position: relative;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: calc(100% - 80px);
    overflow: visible;
  }
  
  /* カードコンテナ */
  .swipe-cards {
    flex-grow: 1;
    position: relative;
    overflow: visible;
    height: 100%;
    width: 92%;
    margin: 0 auto;
  }
  
  /* カード最適化 */
  .expert-swipe-card {
    position: absolute;
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 18px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    gap: 1rem;
    /* ここを変更: デフォルトは非表示ではなく透明度を下げる */
    opacity: 0.3; 
    z-index: 1;
    overflow: hidden; /* スクロール防止 */
    
    /* カード位置調整 */
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  }
  
  /* アクティブカード */
  .expert-swipe-card.active {
    opacity: 1;
    transform: translateX(-50%) scale(1);
    z-index: 10;
  }
  
  /* 次のカードをわずかに表示（スワイプヒント） */
  .expert-swipe-card.next {
    opacity: 0.7;
    transform: translateX(30%) scale(0.9);
    z-index: 4;
  }
  
  /* 前のカードをわずかに表示 */
  .expert-swipe-card.prev {
    opacity: 0.7;
    transform: translateX(-130%) scale(0.9);
    z-index: 4;
  }
  
  /* プロフィール部分最適化 */
  .expert-main-info {
    display: flex;
    align-items: center;
    text-align: left;
    gap: 1rem;
    margin-bottom: 0;
  }
  
  .expert-title {
    font-size: 0.9rem;
  }
  
  .expert-achievements h4 {
    font-size: 1rem;
    margin-bottom: 0.4rem;
  }
  
  .expert-achievements p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
  }
  
  .expert-message {
    position: relative;
    flex-grow: 1;
    padding: 1rem 1rem; /* 上下左右均等にパディングを少し削減 */
    margin-bottom: 1rem; /* 2remから1remに減少 */
    background: #f8faff;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
  }
  
  .expert-message p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #444;
    font-style: italic;
    margin: 0;
  }
  
  /* インジケーター最適化 */
  .swipe-navigation {
    height: 50px;
    padding: 0;
    margin-top: 1rem;
  }
  
  .swipe-indicators {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
  }
  
  .swipe-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
  }
  
  .swipe-indicator.active {
    width: 24px;
    background: white;
  }
  
  /* スワイプヒントアニメーション */
  .swipe-hint {
    position: absolute;
    top: 50%;
    width: 40px;
    height: 40px;
    color: white;
    opacity: 0.6;
    animation: swipeHint 1.5s infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
  }
  
  .swipe-hint.left {
    left: 5px;
    transform: translateY(-50%);
  }
  
  .swipe-hint.right {
    right: 5px;
    transform: translateY(-50%);
  }
  
  .swipe-hint svg {
    width: 24px;
    height: 24px;
    fill: white;
  }
  
  @keyframes swipeHint {
    0%, 100% { opacity: 0.4; transform: translateY(-50%); }
    50% { opacity: 0.8; transform: translateY(-50%) scale(1.1); }
  }

  /* プロフィール部分を縦並びに変更 */
.expert-main-info {
    display: flex;
    flex-direction: column; /* 横並びから縦並びに変更 */
    align-items: center;    /* 中央揃え */
    text-align: center;
    margin-bottom: 0.6rem;
    position: relative;
  }
  
  /* アバターを大きく中央に配置 */
  .expert-avatar {
position: relative;
  width: 50px;  /* 80pxから50pxに縮小 */
  height: 50px; /* 80pxから50pxに縮小 */
  font-size: 1.5rem; /* フォントサイズも調整 */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  min-width: auto;
  margin: 0 auto 0.5rem; /* 下余白も0.8remから0.5remに削減 */
  font-weight: 700;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); /* 影も少し縮小 */
  }
  
  /* 名前とタイトルのスタイル調整 */
  .expert-main-info h3 {
    font-size: 1.3rem;
    margin-bottom: 0.3rem;
    font-weight: 700;
    color: #333;
  }
  
  .expert-title {
    font-size: 1rem;
    color: #666;
    margin-bottom: 0.3rem;
  }
  
  /* カード自体の調整 */
  .expert-swipe-card {
    display: grid;
    grid-template-rows: auto auto 1fr auto; /* 縦の比率はそのまま */
    gap: 0.8rem; /* 1.2remから0.8remに縮小 */
    padding: 1.2rem 1.5rem; /* 上下パディングを1.8remから1.2remに縮小 */
  }

  .exp-chat-card-selected {
    animation: expChatSelectedPulse 0.8s forwards;
  }
  
  @keyframes expChatSelectedPulse {
    0% {
      transform: translateX(-50%) scale(1);
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    }
    50% {
      transform: translateX(-50%) scale(1.05);
      box-shadow: 0 20px 40px rgba(67, 97, 238, 0.2);
    }
    100% {
      transform: translateX(-50%) scale(0);
      opacity: 0;
    }
  }

/* チャットUIのスタイル - 既存のCSSと競合しないようにプレフィックスを使用 */
.exp-chat-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #f5f7fa;
  display: flex;
  flex-direction: column;
  z-index: 9999;
}

.exp-chat-header {
  display: flex;
  align-items: center;
  padding: 1rem;
  background: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  position: relative;
}

.exp-chat-back-button {
  background: none;
  border: none;
  display: flex;
  align-items: center;
  font-size: 0.9rem;
  color: #4361ee;
  cursor: pointer;
  margin-right: 1rem;
}

.exp-chat-back-button svg {
  width: 20px;
  height: 20px;
  fill: #4361ee;
  margin-right: 4px;
}

.exp-chat-expert-info {
  display: flex;
  align-items: center;
}

.exp-chat-expert-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.3rem;
  margin-right: 0.8rem;
  position: relative;
}

.exp-chat-expert-details {
  display: flex;
  flex-direction: column;
}

.exp-chat-expert-name {
  font-weight: 600;
  font-size: 1.1rem;
}

.exp-chat-expert-title {
  font-size: 0.8rem;
  color: #666;
}

.exp-chat-messages {
  flex-grow: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.exp-chat-user-message, .exp-chat-expert-message, .exp-chat-system-message {
  max-width: 85%;
  padding: 0.8rem 1rem;
  border-radius: 18px;
  position: relative;
}

.exp-chat-user-message {
  background: #4361ee;
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.exp-chat-expert-message {
  background: white;
  color: #333;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.exp-chat-system-message {
  background: rgba(0, 0, 0, 0.05);
  color: #666;
  align-self: center;
  font-size: 0.9rem;
  border-radius: 10px;
  max-width: 90%;
  text-align: center;
}

.exp-chat-system-message.exp-chat-error {
  background: rgba(255, 0, 0, 0.1);
  color: #d32f2f;
}

.exp-chat-expert-message.exp-chat-typing p {
  display: flex;
  align-items: center;
}

.exp-chat-expert-message.exp-chat-typing p::after {
  content: "";
  width: 3em;
  height: 1em;
  margin-left: 0.5rem;
  background: url("data:image/svg+xml,%3Csvg width='120' height='30' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E%3Ccircle cx='15' cy='15' r='4'%3E%3Canimate attributeName='opacity' from='1' to='0' dur='1s' begin='0s' repeatCount='indefinite'/%3E%3C/circle%3E%3Ccircle cx='60' cy='15' r='4'%3E%3Canimate attributeName='opacity' from='1' to='0' dur='1s' begin='0.3s' repeatCount='indefinite'/%3E%3C/circle%3E%3Ccircle cx='105' cy='15' r='4'%3E%3Canimate attributeName='opacity' from='1' to='0' dur='1s' begin='0.6s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E") center / contain no-repeat;
}

.exp-chat-input-area {
  display: flex;
  padding: 1rem;
  background: white;
  border-top: 1px solid rgba(0,0,0,0.05);
}

.exp-chat-input {
  flex-grow: 1;
  border: 1px solid #ddd;
  border-radius: 24px;
  padding: 0.8rem 1rem;
  resize: none;
  font-family: inherit;
  font-size: 1rem;
  max-height: 120px;
  overflow-y: auto;
}

.exp-chat-input:focus {
  outline: none;
  border-color: #4361ee;
}

.exp-chat-send-button {
  width: 48px;
  height: 48px;
  background: #4361ee;
  color: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.exp-chat-send-button:hover {
  background: #3a56d4;
}

.exp-chat-send-button svg {
  width: 24px;
  height: 24px;
  fill: white;
}

/* チャットメッセージ内のマークダウンスタイル */
.exp-chat-expert-message h1,
.exp-chat-expert-message h2,
.exp-chat-expert-message h3 {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

.exp-chat-expert-message p {
  margin-bottom: 0.5em;
}

.exp-chat-expert-message ul,
.exp-chat-expert-message ol {
  padding-left: 1.5em;
  margin-bottom: 0.5em;
}

.exp-chat-expert-message pre {
  background-color: #f5f5f5;
  padding: 0.5em;
  border-radius: 4px;
  overflow-x: auto;
}

.expert-connecting-modal .expert-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white;
  margin: 0 auto 20px;
}

.connecting-animation {
  display: flex;
  justify-content: center;
  margin: 15px 0;
}

.chat-bubble {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #3a86ff;
  margin: 0 6px;
  animation: bubble-bounce 1.2s infinite ease-in-out;
}

.chat-bubble:nth-child(2) {
  animation-delay: 0.2s;
}

.chat-bubble:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes bubble-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* デスクトップ用ナビゲーションボタン */
.desktop-nav-buttons {
  display: flex;
  justify-content: space-around;
  width: 100%;
  margin: 0 auto 20px;
  padding: 0 15px;
}

.prev-button, .next-button {
  background-color: #f7f7f7;
  color: #333;
  border: none;
  padding: 10px 20px;
  cursor: pointer;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.next-button {
  background-color: #4361ee;
  color: white;
}

.prev-button:hover:not(.disabled), 
.next-button:hover:not(.disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.prev-button:active:not(.disabled), 
.next-button:active:not(.disabled) {
  transform: translateY(1px);
}

.prev-button.disabled,
.next-button.disabled {
  opacity: 0.5;
}

/* モバイル向け表示設定 */
@media (max-width: 768px) {
  .desktop-nav-buttons {
    display: none; /* モバイルでは非表示 */
  }
}

/* アプリ全体のテキスト選択を無効化 */
body, .container, .experts-swipe-container, .exp-chat-container {
  -webkit-user-select: none;  /* Safari向け */
  -ms-user-select: none;      /* IE 10/11向け */
  user-select: none;          /* 標準構文 */
}

/* チャットメッセージ部分のみテキスト選択を有効化 */
.exp-chat-user-message p,
.exp-chat-expert-message p,
.exp-chat-expert-message li,
.exp-chat-expert-message code,
.exp-chat-expert-message pre {
  -webkit-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

.no-select-image {
  vertical-align: bottom;
  user-select: none;
  pointer-events: none;
  -webkit-user-drag: none;
}

/* Modal styles - 余白重視版 */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  backdrop-filter: blur(12px);
}

.modal-content {
  background: linear-gradient(135deg, #6366F1, #EC4899);
  margin: 8% auto;
  padding: 35px 30px; /* パディングを増やして余白重視 */
  border-radius: 20px;
  width: 90%;
  max-width: 380px; /* 最大幅を少し広げて余裕を持たせる */
  box-shadow: 
    0 20px 40px rgba(99, 102, 241, 0.3),
    0 0 30px rgba(236, 72, 153, 0.2);
  text-align: center;
  color: white;
  font-weight: 600;
  position: relative;
  
  /* フレックスボックスで縦並び */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.modal-content h2 {
  margin: 0 0 25px 0; /* 下マージンを適度に */
  font-size: 1.3rem; /* フォントサイズを少し控えめに */
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  order: 1;
}

.modal-content img {
  width: 200px; /* QRコードサイズを控えめに */
  height: 200px;
  margin: 0 0 25px 0; /* 適度な下マージン */
  border-radius: 15px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
  order: 2;
}

.close-btn {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
  padding: 12px 30px; /* 適度なパディング */
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  order: 3;
  margin: 0;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.close-btn:active {
  transform: translateY(0);
}

/* デスクトップ向け調整 */
@media (min-width: 768px) {
  .modal-content {
    margin: 5% auto;
    width: 420px; /* 幅を適度に */
    padding: 45px 35px; /* 余白をたっぷりと */
  }
  
  .modal-content h2 {
    font-size: 1.5rem; /* 適度なサイズ */
    margin-bottom: 30px;
  }
  
  .modal-content img {
    width: 240px; /* 適度なQRコードサイズ */
    height: 240px;
    margin-bottom: 30px;
  }
  
  .close-btn {
    padding: 15px 35px; /* ボタンを適度に大きく */
    font-size: 1.1rem;
  }
}

/* スマートフォン向け調整 */
@media (max-width: 480px) {
  .modal-content {
    margin: 12% auto;
    padding: 30px 25px; /* 適度な余白 */
    width: 92%;
  }
  
  .modal-content h2 {
    font-size: 1.2rem;
    margin-bottom: 20px;
  }
  
  .modal-content img {
    width: 180px; /* スマホでも適度なサイズ */
    height: 180px;
    margin-bottom: 20px;
  }
  
  .close-btn {
    padding: 10px 25px;
    font-size: 0.95rem;
  }
}

/* 極小画面対応 */
@media (max-width: 375px) {
  .modal-content {
    padding: 25px 20px;
    margin: 10% auto;
  }
  
  .modal-content img {
    width: 160px;
    height: 160px;
    margin-bottom: 18px;
  }
  
  .close-btn {
    padding: 8px 20px;
    font-size: 0.9rem;
  }
}

/* 縦長画面での調整 */
@media (max-height: 700px) and (max-width: 480px) {
  .modal-content {
    margin: 8% auto;
    padding: 20px 18px;
  }
  
  .modal-content img {
    width: 150px;
    height: 150px;
    margin-bottom: 15px;
  }
  
  .modal-content h2 {
    margin-bottom: 15px;
    font-size: 1.1rem;
  }
}

/* 横向き画面対応 */
@media (max-height: 500px) and (orientation: landscape) {
  .modal-content {
    margin: 3% auto;
    padding: 15px 20px;
    max-height: 90vh;
  }
  
  .modal-content img {
    width: 120px;
    height: 120px;
    margin-bottom: 10px;
  }
  
  .modal-content h2 {
    margin-bottom: 10px;
    font-size: 1rem;
  }
}

/* 小画面対応（既存のCSSには影響しない追加コード） */
@media screen and (max-height: 810px) {
  .expert-swipe-card {
    overflow-y: auto;      /* 内容が長い場合はスクロール可能に */
  }
}

@media screen and (min-width: 375px) and (max-width: 428px) {
  .expert-avatar {
    width: 45px;  /* さらに小さく */
    height: 45px;
  }
  
  .expert-swipe-card {
    gap: 0.6rem;  /* さらに狭く */
    padding: 1rem 1.2rem;
  }
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */
