*, *::before, *::after {
    box-sizing: border-box;
}

/* 基本設定とリセット */
body {
    font-family: 'Noto Sans JP', 'Segoe UI', 'Roboto', sans-serif;
    line-height: 1.6;
    margin: 0;
    /* スライドショーページとは異なり、こちらは白を基調とした背景 */
    background-color: #F5F4F0; /* 淡い背景色 */
    color: #2C3E50; /* テキストの色 */
    min-height: 100vh; /* 少なくともビューポートの高さ */
    box-sizing: border-box;
}
body.is-top-page {
    padding-top: 63px; 
}

body.is-sub-page {
    padding-top: 90px; 
}

.container {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    padding: 0 20px 40px; /* ← 左右のpaddingを少し狭く */
    width: 100%; /* ← 90%から100%に変更 */
    text-align: center;
    box-sizing: border-box;
    margin : 0 auto ;
}

header {
    position: relative;      /* 通常配置 */
    z-index: 100;            /* 他の要素より手前に */
    background-color: #FBE25F; /* ヘッダーの背景色 */
    color: #555555;              /* ヘッダー内のテキスト色 */
}

.app-info {
    text-align: left; 
}


.app-title {
    /* font-size: 2.8em; */
    line-height: 1;
    color: #555555; 
    margin-bottom: 0;
    /* font-weight: 700;
    letter-spacing: 1px; */
}

.logo-link {
    display: inline-flex;
    transition: opacity 0.2s;
    text-decoration: none; /* リンクの下線を消す */
}

.logo-link:hover {
    opacity: 0.8;
}

.header-logo {
    height: 45px; /* ここを大きくしたり小さくしたりして調整！ */
    width: auto;  /* 高さに合わせて横幅を自動で決める */
    display: block;
}

/* ちなみに、スマホでロゴがデカすぎる場合のレスポンシブ */
@media (max-width: 768px) {
    .header-logo {
        height: 35px; /* スマホでは少しだけ小さくする */
    }
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 auto; 
    padding: 15px 20px;
    box-sizing: border-box; 
}


.tagline {
    font-size: 1.2em;
    color: #555;
    margin-bottom: 0;
}


/* Google Sign-In ボタン */
.g_id_signin {
    margin: 20px auto;
    display: block;
    width: fit-content;
}

/* ボタン全般 */
.btn {
    font-weight: 600;
}

.btn:hover {
    transform: translateY(-2px);
}

.mobile-warning-banner {
    display: none;
    background-color: #fff3cd;
    color: #856404;
    padding: 10px 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    font-size: 0.9rem;
    border-left: 5px solid #ffeeba;
}

/* 画面幅がスマホサイズ（768px以下）の時だけ表示する */
@media (max-width: 768px) {
    .mobile-warning-banner {
        display: block;
    }
}


.btn-success {
    background-color: #2C2C2C; /* スライドショー開始ボタンの色 */
    color: white;
    border: none;
}

.btn-success:hover {
    background-color: #2C2C2C;
}

.btn .icon {
    width: 24px;
    height: 24px;
    margin-right: 10px;
}

/* ステータスメッセージ */
@media (min-width: 768px) {
    .tagline {
        white-space: nowrap;
    }
}

/* フッター */
footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    color: #777;
    font-size: 0.9em;
    text-align: center; 
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .container {
        padding: 25px;
        width: 95%;
    }

    .app-title {
        font-size: 2.2em;
    }

    .tagline {
        font-size: 1em;
    }

    .how-to-use h2 {
        font-size: 1.6em;
    }

    .step h3 {
        font-size: 1.4em;
    }

    .step p {
        font-size: 0.9em;
    }

    .btn {
        font-size: 1em;
        padding: 10px 20px;
    }

    .hero-subtitle {
        font-size: 0.9em;  
    }

    body main .hero-content .hero-title {
        font-size: 1.6em ; /* ※1.4em〜1.8emなど、納得するまで変更してみてください */
        line-height: 1.4 ;
        white-space: normal ; /* もし nowrap が効いたままなら解除します */
    }
    
    body.is-top-page {
        padding-top: 53px; 
    }

    body.is-sub-page {
        padding-top: 70px; 
    }

    .hero-title{
        font-size: 1.4em !important;
        line-height: 1.4;
        word-break: normal;
        overflow-wrap: break-word;
    }

    .hero-content {
        width: 100%;
        max-width: 100%;
        padding: 20px;
        overflow: hidden;
    }

    .hero-subtitle {
        font-size: 1em;
        line-height: 1.6;
    }

    .hero-section {
        min-height: 500px;
        padding: 40px 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    .step-number {
        width: 35px;
        height: 35px;
        font-size: 1.2em;
        top: -10px;
    }
    .step h3, .step p {
        padding-left: 15px;
    }
}

/* --- ダッシュボード用スタイル --- */
.btn-full-width {
    display: block; /* ボタンをブロック要素にする */
    width: 100%;     /* 幅を100%にする */
    margin-bottom: 15px;
    box-sizing: border-box; /* paddingを含めて幅を計算 */
    text-align: center;
}

/* ローダーを画面全体に表示するための半透明の背景 */
#loader-overlay {
    position: fixed; /* 画面に固定 */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8); /* 少し透明な白 */
    display: flex; /* Flexboxで中央揃え */
    justify-content: center;
    align-items: center;
    flex-direction: column; /* アイコンとテキストを縦に並べる */
    z-index: 9999; /* 他のどの要素よりも手前に表示 */
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* ローダーを非表示にするためのクラス */
#loader-overlay.loader-hidden {
    opacity: 0;
    pointer-events: none; /* 非表示中はクリックなどを無効化 */
}

/* スピナー（くるくる回るアイコン）本体 */
.loader-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(106, 5, 113, 0.2); /* スピナーの薄い部分の色 */
    border-top-color: #6a0571; /* スピナーの濃い部分の色 (アプリのメインカラー) */
    border-radius: 50%; /* 円形にする */
    animation: spin 1s linear infinite; /* 'spin'という名前のアニメーションを1秒で無限に繰り返す */
}

/* ローディング中のテキスト */
.loader-text {
    margin-top: 20px;
    font-size: 1.2em;
    font-weight: 500;
    color: #333;
}

/* 'spin' アニメーションの定義 */
@keyframes spin {
    to {
        transform: rotate(360deg); /* 360度回転させる */
    }
}

.user-info {
    /* PCでは横並びにする */
    display: flex;
    align-items: center;
    gap: 15px;
    
}

.user-info span {
    font-weight: 500;
    color: #555;
}

@media (max-width: 768px) {
    .header-container {
        /* 要素を縦に並べる */
        flex-direction: column;
        /* 左揃えにする */
        align-items: flex-start;
        gap: 15px; /* 上下の要素の間に隙間を空ける */
    }

    .app-info .tagline {
        /* スマホではタグラインを非表示にしてスペースを確保 */
        display: none;
    }
    
    .user-info {
        /* 横幅いっぱいを使う */
        width: 100%;
        /* 中の要素（テキストとボタン）を縦に並べる */
        flex-direction: column;
        /* 右揃えにする */
        align-items: flex-end;
        gap: 10px;
    }
}

.btn-logout-header {
    padding: 8px 15px;
    background-color: #6c757d;
    color: white;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.3s ease;
    font-size: 0.9em;
    border: none;
}

.btn-logout-header:hover {
    background-color: #5a6268;
    border: none;
}

.thumbnail-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    background-color: #f0f0f0;
    border-radius: 5px;
}

.thumbnail-wrapper .loader-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px; 
    height: 30px;
    border-width: 3px;
    animation: thumbnail-spin 1s linear infinite;
}

@keyframes thumbnail-spin {
    from{
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to{
        transform: translate(-50%, -50%) rotate(360deg)
    }
}

.preview-thumbnail {
    opacity: 0; /* 最初は非表示 */
    transition: opacity 0.4s ease; /* フェードイン効果 */
}

.btn-danger { 
    background-color: #dc3545; 
    color: white; 
    text-decoration: none; 
    padding: 8px 12px; 
    border-radius: 5px; 
    border: none; 
    cursor: pointer; }
.btn-danger:hover { 
    background-color: #c82333; 
    border: none;
}

.hero-section {
    position: relative;
    width: 100%;
    /* height: 60vh; */
    min-height: 60vh;
    background-image: url('/static/placeholder.jpg'); /* 背景画像を指定 */
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
}

/* 背景画像の上に重ねる半透明の黒いフィルター */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.2);
    z-index: 1;
}

/* テキストやボタンなどのコンテンツ */
.hero-content {
    position: relative;
    z-index: 2;
    padding: 20px;
}

.hero-title {
    font-size: 3em;
    font-weight: 700;
    margin-bottom: 0.5em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hero-subtitle {
    font-size: 1.2em;
    max-width: 600px;
    margin-bottom: 1.5em;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.hero-buttons .hero-btn {
    padding: 15px 30px;
    font-size: 1.2em;
    margin: 0 10px;
    border: none;
}f

.btn-primary {
    background-color: #FBE25F; /* メインカラー */
    color: #2C2C2C;
    border: none;
}

.btn-primary:hover {
    background-color: #e6d94f; /* 少し暗めの色 */
    color: #2C2C2C;
    border: none;
}

/* --- features-wrapper: コンテンツ全体の幅と余白 --- */
.features-wrapper {
    padding: 40px 0;
    text-align: center;
    margin-top: 40px;
}

.section-header {
    margin-bottom: 50px;
}

.section-header h3 {
    font-size: 2.2em;
    color: #333;
    margin-bottom: 10px;
}

.section-subtitle {
    font-size: 1.1em;
    color: #666;
    line-height: 1.6;
}

/* --- features-grid: グリッドレイアウトの調整 --- */
.features-grid {
    display: grid;
    /* 画面幅に合わせて自動で列数を調整（最小幅300px） */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    text-align: left; /* カード内のテキストは左寄せ */
}

/* --- feature-item: 各カードのデザイン --- */
.feature-item {
    background-color: #fff;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #eee;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03); /* ほんのり影をつける */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

/* ホバー時に少し浮き上がるエフェクト */
.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

.feature-icon {
    font-size: 3em;
    margin-bottom: 20px;
    line-height: 1;
}

.feature-item h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.4em;
    color: #2C2C2C; 
    font-weight: 700;
}

.feature-item p {
    color: #555;
    font-size: 1em;
    line-height: 1.7;
    margin-bottom: 20px;
    flex-grow: 1; /* 内容の量に関わらず下部を揃える */
}

/* --- 対応サービスのリストスタイル --- */
.supported-services {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    font-size: 0.9em;
}

.supported-services span {
    font-weight: 700;
    display: block;
    margin-bottom: 5px;
    color: #444;
}

.supported-services ul {
    margin: 0;
    padding-left: 20px;
    color: #666;
}

.supported-services li {
    margin-bottom: 3px;
}

/* --- 既存スタイルの調整 --- */
/* base.htmlのcontainerがヒーローセクションの下に来るように調整 */
body > .container {
    margin-top: 40px;
}

/* ナビゲーションリンク {使い方}用 */
.main-nav {
    margin-left: auto; /* 右寄せ */
    margin-right: 20px;
    display: flex;
    gap: 20px;
}

.nav-link {
    color: #555;
    text-decoration: none;
    font-weight: 600;
    font-size: 1em;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background-color 0.2s;
}

.nav-link:hover {
    background-color: #f0f0f0;
    color: #2C3E50;
}

.footer-links {
    margin-bottom: 10px;
}
.footer-links a {
    color: #666;
    text-decoration: none;
    margin: 0 10px;
}
.footer-links a:hover {
    text-decoration: underline;
}

.guide-footer {
    margin-top: 50px;
    text-align: center;
}

/* プランバッジ */
.plan-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: bold;
    color: #ffffff !important;
    vertical-align: middle;
    margin-left: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    letter-spacing: 0.5px;
    text-shadow: 0 1px 3px rgba(0,0,0, 0.4);
    box-shadow: 0 4px 6px rgba(0,0,0, 0.15);
}

.plan-link, .plan-link:hover, .plan-link:active {
    color: inherit !important;
    text-decoration: none;
}

/* Plan 0: Free (シンプルに) */
.plan-free {
    background-color: #7f8c8d; /* グレー */
}

/* Plan 1: Standard (信頼感のある青) */
.plan-standard {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%); /* 青のグラデーション */
}

/* Plan 2: Premium (高級感のあるゴールドグラデーション) */
.plan-premium {
    background: linear-gradient(135deg, #d4af37 0%, #a67c00 100%);
        
        /* 枠線をうっすら入れて引き締める */
    border: 1px solid rgba(255, 255, 255, 0.3);
}
.truncate-text {
    display: inline-block;     /* 幅を指定できるようにする */
    max-width: 150px;          /* 省略を開始する最大幅（スマホに合わせて調整してください） */
    white-space: nowrap;       /* 絶対に改行させない */
    overflow: hidden;          /* はみ出た部分は隠す */
    text-overflow: ellipsis;   /* 隠れた部分を「...」にする */
    vertical-align: middle;    /* ボタンなどと高さを合わせる */
}

@media (min-width: 768px) {
    .truncate-text {
        max-width: 250px;
    }
}
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        align-items: center; /* ← flex-start から center に変更（全体を真ん中寄せに） */
        gap: 15px;
        text-align: center; /* タイトルも真ん中寄せ */
    }

    .app-info .tagline {
        display: none;
    }
    
    .user-info {
        width: 100%;
        flex-direction: column;
        align-items: center; /* ← flex-end から center に変更（ボタン類を真ん中寄せに） */
        gap: 10px;
    }
}

.user-greeting {
    display: flex;
    align-items: center; /* 縦のズレを防ぐ */
    max-width: 100%;     /* 親の幅を超えないようにする */
}
.greeting-prefix,
.greeting-suffix {
    white-space: nowrap;
    flex-shrink: 0; 
}

.truncate-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;   
    flex-shrink: 1;            
    margin: 0 4px;
}