/* ... existing code（.code-preview-area など） ... */

/* ==========================================================================
   11. UTMツール用の追加スタイル（インラインスタイルの除去）
   ========================================================================== */
.modal-title {
    margin: 0 0 10px;
    font-size: 18px;
    color: var(--color-primary);
    font-weight: bold;
}

.modal-desc {
    font-size: 13px;
    color: #666;
    margin-bottom: 15px;
}

.modal-content img {
    width: 180px;
    height: 180px;
    border: 1px solid #eee;
    margin: 15px auto;
    padding: 5px;
    display: block;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
    margin-bottom: 15px;
}

.modal-actions button {
    flex: 1;
}

.btn-close-modal {
    width: 100%;
}

.step-title-no-border {
    margin: 0 !important;
    border: none !important;
    padding-bottom: 0 !important;
}

.copy-feedback {
    color: #27ae60;
    font-size: 14px;
    font-weight: bold;
    display: none;
    margin-bottom: 4px;
}

/* プライマリボタン（深緑色）のグループに .btn-copy-qr を追加 */
.icon-copy-btn,
.form-flex button,
.map-extract-btn,
.btn-copy-qr {
    background: var(--color-primary);
    color: #fff;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.icon-copy-btn:hover,
.form-flex button:hover,
.map-extract-btn:hover,
.btn-copy-qr:hover {
    background: #123e44;
}

/* ==========================================================================
   12. レスポンシブ (スマホ向け) 共通・各ツール
   ========================================================================== */
:root {
    --color-primary: #1A535C;
    --color-accent: #f7b538;
    --color-bg: #F4F7F5;
    --color-border: #dce4e2;
    --border-radius: 6px;
    --font-size-base: 16px;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    background-color: var(--color-bg);
    color: #333;
    line-height: 1.6;
    margin: 0;
    font-size: var(--font-size-base) !important;
}

/* ヘッダー */
.global-header {
    background-color: #fff;
    padding: 10px 25px !important;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.header-logo img {
    height: 26px;
}

/* 全体レイアウト */
.app-wrapper {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 15px;
    gap: 25px;
    align-items: stretch;
    min-height: calc(100vh - 150px);
}

/* サイドバー */
.sidebar {
    width: 220px;
    flex-shrink: 0;
    position: sticky;
    top: 80px;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    background: var(--color-primary);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    height: 100%;
}

.sidebar-menu li a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    display: block;
    padding: 12px 15px;
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: 0.2s;
}

.sidebar-menu li a:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #fff;
}

.sidebar-menu li.active a {
    background: rgba(0, 0, 0, 0.2);
    color: #fff;
    font-weight: bold;
    border-left: 4px solid var(--color-accent);
    padding-left: 11px;
}

/* メインエリア */
.main-content {
    flex: 1;
    min-width: 0;
}

/* ページタイトル・パンくず */
.page-header-box {
    background-color: var(--color-primary);
    color: #fff;
    padding: 10px 20px !important;
    border-radius: var(--border-radius);
    margin-bottom: 15px !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.page-header-box h1 {
    font-size: 18px !important;
    margin: 0;
    font-weight: bold;
}

.breadcrumb {
    font-size: 13px;
    margin-bottom: 10px;
    color: #7f8c8d;
}

.breadcrumb a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: bold;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* ツールボックス共通枠（メインの白いカード） */
.tool-box,
.schema-card {
    background: #fff;
    padding: 25px 30px !important;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    margin-bottom: 25px !important;
}

/* ==========================================================================
   2. フォーム共通要素
   ========================================================================== */
.step-title {
    font-size: 18px;
    color: var(--color-primary);
    font-weight: bold;
    border-bottom: 2px solid #f0f4f3;
    padding-bottom: 8px;
    margin-bottom: 20px;
    margin-top: 40px;
}

.step-title:first-child {
    margin-top: 0;
}

.form-group {
    margin-bottom: 20px !important;
}

label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 14px;
    color: #444;
}

/* グループ枠 */
.dynamic-field-group {
    background: #fafafa;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
}

/* 入力欄（クリーンなデザインに統合） */
input[type="text"],
input[type="time"],
select,
.textarea-styled {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: var(--border-radius);
    font-size: 15px;
    box-sizing: border-box;
    background: #fafafa;
    color: #333;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

input[type="text"]:focus,
input[type="time"]:focus,
select:focus,
.textarea-styled:focus {
    border-color: var(--color-primary);
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 83, 92, 0.1);
}

.req-badge {
    background-color: #ff7043;
    color: #fff;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
    font-weight: bold;
    letter-spacing: 0.05em;
    box-shadow: 0 1px 2px rgba(255, 112, 67, 0.3);
}

.initial-message {
    margin-top: 25px;
    padding: 25px;
    background: #fff8f0;
    border: 2px dashed #ffb07c;
    border-radius: 8px;
    text-align: center;
    color: #d35400;
    font-weight: bold;
    font-size: 15px;
}

.initial-message svg {
    vertical-align: middle;
    margin-right: 8px;
    margin-bottom: 2px;
}

/* ==========================================================================
   3. ★コンポーネント設計：ボタン (OOCSS / BEMアプローチ)
   ========================================================================== */

/* ベーススタイル（すべてのボタンの土台） */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: var(--border-radius);
    padding: 10px 20px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-sizing: border-box;
    text-decoration: none;
}

/* プライマリボタン（深緑色：情報の取得、コピーなど） */
.btn-primary {
    background-color: var(--color-primary);
    color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.btn-primary:hover {
    background-color: #123e44;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
}
.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* アクセントボタン（オレンジ色：DL、QR作成など） */
.btn-accent {
    background-color: var(--color-accent);
    color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.btn-accent:hover {
    background-color: #e0a02c;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
}
.btn-accent:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* アウトラインボタン（白背景＋枠線：追加、キャンセル、モーダル開閉など） */
.btn-outline {
    background-color: #fff;
    color: var(--color-primary);
    border-color: var(--color-primary);
}
.btn-outline:hover {
    background-color: #f0f7f6;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.btn-outline:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

/* グレーボタン（URL横の小さなコピーボタンなど） */
.btn-outline-gray {
    background-color: #e0e6e4;
    color: var(--color-primary);
    border-color: transparent;
}
.btn-outline-gray:hover {
    background-color: var(--color-primary);
    color: #fff;
}

/* テキストボタン（削除など、控えめな操作） */
.btn-text {
    background-color: transparent;
    color: #888;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: normal;
    text-decoration: underline;
    margin-top: 5px;
    margin-left: auto;
    display: block;
}
.btn-text:hover {
    color: #d63031;
}

/* ボタン用 ユーティリティクラス */
.btn-full {
    width: 100%;
}
.btn-dashed {
    border-style: dashed;
}
.btn-icon-sm {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 4px;
    position: absolute;
    right: 5px;
}

/* カレンダーや時間などのアドオンボタンは高さを入力欄に合わせる */
.input-addon-flex .btn {
    height: 100%;
    padding: 0 15px;
}

/* ==========================================================================
   4. コードプレビュー＆アコーディオン
   ========================================================================== */
.code-preview-area {
    width: 100% !important;
    max-width: 100% !important;
    background-color: #fafafa !important;
    color: #333 !important;
    font-family: 'Roboto Mono', monospace;
    font-size: 14px;
    line-height: 1.6;
    padding: 15px !important;
    border: 1px solid #ccc !important;
    border-radius: var(--border-radius) !important;
    resize: vertical;
    box-sizing: border-box !important;
    transition: 0.2s;
    white-space: pre !important;
    overflow-x: auto !important;
}

.code-preview-area:focus {
    outline: none !important;
    border-color: var(--color-primary) !important;
    background-color: #fff !important;
    box-shadow: 0 0 0 3px rgba(26, 83, 92, 0.1) !important;
}

/* ★消えてしまっていたSTEP3用のレイアウトクラスを復元 */
.result-box-vertical {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.result-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 5px;
}

.result-title-label {
    font-size: 14px;
    font-weight: bold;
    color: var(--color-primary);
}

.advanced-settings-wrap {
    margin-top: 25px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.advanced-settings-summary,
.advanced-settings-details summary {
    padding: 15px 20px;
    font-weight: bold;
    color: var(--color-primary);
    background: #f8f9fa;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    transition: 0.2s;
    user-select: none;
    outline: none;
}

.advanced-settings-summary:hover,
.advanced-settings-details summary:hover {
    background: #f0f4f3;
}

.advanced-settings-summary::-webkit-details-marker,
.advanced-settings-details summary::-webkit-details-marker {
    display: none;
}

.advanced-settings-summary::before {
    content: "＋";
    display: inline-block;
    margin-right: 10px;
    font-size: 16px;
    font-weight: bold;
    transition: transform 0.2s;
}

.advanced-settings-wrap[open] .advanced-settings-summary {
    border-bottom: 1px solid var(--color-border);
}

.advanced-settings-wrap[open] .advanced-settings-summary::before {
    transform: rotate(45deg);
}

.advanced-settings-content {
    padding: 20px;
    background: #fff;
}

/* ==========================================================================
   5. SEO・解説コンテンツ用（共通ブロック）
   ========================================================================== */
.seo-content {
    padding: 30px 35px !important;
    color: #333;
}

.seo-content h2 {
    font-size: 1.5rem;
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 10px;
    margin: 40px 0 20px;
    color: var(--color-primary);
    font-weight: bold;
}

.seo-content h2:first-child {
    margin-top: 0;
}

.seo-content h3 {
    font-size: 1.2rem;
    margin: 30px 0 15px;
    font-weight: bold;
    color: #222;
    border-left: 5px solid var(--color-accent);
    padding-left: 12px;
}

.seo-content p,
.seo-content ul {
    font-size: 15px;
}
.seo-content p {
    margin-bottom: 15px;
    line-height: 1.8;
}
.seo-content ul {
    padding-left: 25px;
    margin-bottom: 20px;
}
.seo-content li {
    margin-bottom: 8px;
    line-height: 1.7;
}

/* 信頼できる情報の参照先 */
.official-links {
    background: #f8f9fa;
    padding: 20px 25px;
    border-radius: var(--border-radius);
    margin-top: 30px;
    font-size: 14px;
}

.official-links p {
    margin-top: 0;
    margin-bottom: 12px;
    font-weight: bold;
    color: #333;
    font-size: 15px;
}

.official-links a {
    color: #1a73e8;
    text-decoration: underline;
    font-weight: bold;
}

.official-links a:hover {
    color: #1557b0;
}

/* ==========================================================================
   6. テーブル＆横スクロール対応
   ========================================================================== */
.seo-table-responsive,
.ga4-table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border-radius: var(--border-radius);
    background-color: #fff;
    padding-bottom: 5px; 
}

/* スクロールバーの共通スタイル */
.seo-table-responsive::-webkit-scrollbar,
.ga4-table-responsive::-webkit-scrollbar,
.code-preview-area::-webkit-scrollbar {
    height: 8px;
}
.seo-table-responsive::-webkit-scrollbar-thumb,
.ga4-table-responsive::-webkit-scrollbar-thumb,
.code-preview-area::-webkit-scrollbar-thumb {
    background-color: #bdc3c7;
    border-radius: 4px;
}
.seo-table-responsive::-webkit-scrollbar-track,
.ga4-table-responsive::-webkit-scrollbar-track,
.code-preview-area::-webkit-scrollbar-track {
    background-color: #f1f1f1;
    border-radius: 4px;
}

/* テーブルの共通ベーススタイル */
.seo-table,
.ga4-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 650px;
    background: #fff;
    margin-bottom: 0;
}
.seo-table th, .seo-table td,
.ga4-table th, .ga4-table td {
    padding: 12px 15px;
    line-height: 1.6;
}

/* SEO記事テーブルの個別スタイル */
.seo-table th,
.seo-table td {
    border: 1px solid #e0e6e4;
    font-size: 14px;
}
.seo-table th {
    background-color: #f0f7f6;
    color: var(--color-primary);
    font-weight: bold;
    text-align: left;
    white-space: nowrap;
}

/* GA4プレビューテーブルの個別スタイル */
.ga4-table th,
.ga4-table td {
    text-align: right;
    font-size: 13px;
    color: #5f6368;
    border-bottom: 1px solid #dadce0;
}
.ga4-table th {
    font-weight: normal;
}
.ga4-table th:first-child,
.ga4-table td:first-child {
    text-align: left;
}

/* ==========================================================================
   7. その他のツール専用スタイル補完（UTM結果表示など）
   ========================================================================== */
.input-preset-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 20px;
}

.input-col-url {
    flex: 1 1 350px;
    max-width: 100%;
}

.input-col-preset {
    flex: 1 1 300px;
    max-width: 100%;
}

.preset-flex {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.param-grid,
.advanced-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.result-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f0f6f5;
    border: 2px solid var(--color-primary);
    border-radius: var(--border-radius);
    padding: 8px;
    margin-top: 10px;
    width: 100%;
    box-sizing: border-box;
}

.result-url-wrap {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.result-url-wrap input {
    width: 100%;
    border: none !important;
    background: transparent !important;
    padding: 8px 45px 8px 10px !important;
    font-family: 'Roboto Mono', monospace;
    font-size: 15px;
    color: var(--color-primary);
    font-weight: bold;
    box-shadow: none !important;
}

.ga4-preview-wrapper {
    margin-top: 25px;
    border-radius: var(--border-radius);
    border: 1px solid #dadce0;
    background: #fff;
    overflow: hidden;
    max-width: 100%;
    box-shadow: 0 1px 3px rgba(60,64,67,0.1);
}

.ga4-preview-title {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: bold;
    color: #202124;
    background: #f8f9fa;
    border-bottom: 1px solid #dadce0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ga4-preview-badge {
    background: #e8f0fe;
    color: #1967d2;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: bold;
    white-space: nowrap;
    border: 1px solid #d2e3fc;
}

.ga4-primary-cell {
    color: #1a73e8 !important;
    cursor: pointer;
}

.ga4-row-highlight {
    background-color: #e8f0fe !important;
}

.ga4-row-highlight td {
    color: #1967d2 !important;
    font-weight: bold;
}

.ga4-highlight-label {
    display: inline-block;
    background: #1a73e8;
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 10px;
    vertical-align: middle;
}

.ga4-dimension-select {
    border: 1px solid #dadce0;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    color: #3c4043;
    cursor: pointer;
    width: auto;
    background: #fff;
}
.ga4-dimension-select:focus {
    border-color: #1a73e8;
}

/* ==========================================================================
   8. 動的生成UI（スキーマカード等）
   ========================================================================== */

.schema-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 10px;
    margin-bottom: 20px;
    cursor: pointer;
    list-style: none;
    outline: none;
}

.schema-card-header::-webkit-details-marker {
    display: none;
}

.schema-card-title-wrap {
    display: flex;
    align-items: center;
}

.schema-card-chevron {
    color: var(--color-primary);
    margin-right: 10px;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
}

.schema-card[open] .schema-card-chevron {
    transform: rotate(180deg);
}

.schema-card-title {
    margin: 0;
    font-size: 18px;
    color: var(--color-primary);
    font-weight: bold;
}

/* 入力アドオン */
.input-addon-flex {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.input-hidden-picker-wrap {
    position: relative;
    display: flex;
}

.input-hidden-picker {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
}

.map-extract-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}
.map-extract-input {
    font-size: 13px !important;
}
.coords-row {
    display: flex;
    gap: 10px;
}

/* ==========================================================================
   9. モーダル
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: #fff;
    padding: 30px 25px;
    border-radius: 12px;
    text-align: center;
    max-width: 90%;
    width: 340px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-content img {
    border: 1px solid #eee;
    margin: 15px auto;
    padding: 5px;
    display: block;
}

/* ==========================================================================
   10. フッター
   ========================================================================== */
.global-footer {
    background-color: var(--color-primary);
    color: #ffffff;
    text-align: center;
    padding: 30px 20px;
    font-size: 14px;
    margin-top: auto;
}

.footer-links {
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-weight: normal;
    transition: 0.2s;
}

.footer-links a:hover {
    text-decoration: underline;
    color: #fff;
}

.copyright {
    margin: 0;
    color: rgba(255,255,255,0.5);
    font-size: 12px;
}

/* ==========================================================================
   11. レスポンシブ (スマホ向け) 共通・各ツール
   ========================================================================== */
/* ★PC・タブレット・スマホ環境共通：.form-flexを強制的に横並び（右にボタン）に固定 */
.form-flex {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    gap: 10px !important;
}

.form-flex input {
    flex: 1 !important;
    min-width: 0 !important;
}

@media (max-width: 820px) {
    .app-wrapper {
        flex-direction: column;
        padding: 15px 10px;
        gap: 20px;
    }

    .sidebar {
        width: 100%;
        position: static;
    }

    .sidebar-menu {
        display: flex;
        flex-wrap: wrap;
    }

    .sidebar-menu li {
        flex: 1 1 auto;
    }

    .sidebar-menu li a {
        border-bottom: none;
        border-right: 1px solid rgba(255, 255, 255, 0.1);
        text-align: center;
        padding: 10px;
    }

    .sidebar-menu li.active a {
        border-left: none;
        border-bottom: 4px solid var(--color-accent);
        padding-left: 10px;
    }

    .tool-box,
    .schema-card,
    .seo-content,
    #validation-box {
        padding: 20px !important;
    }

    /* フォーム要素等のスマホ対応 */
    .input-preset-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .input-col-url,
    .input-col-preset {
        flex: 1 1 100%;
        max-width: 100%;
        width: 100%;
    }

    /* スマホ時は1カラム（縦並び）に */
    .preset-flex {
        grid-template-columns: 1fr;
        width: 100%;
        gap: 15px;
    }

    .preset-flex select {
        width: 100%;
        font-size: 14px;
        padding: 10px;
    }

    .param-grid,
    .advanced-settings-grid {
        grid-template-columns: 1fr;
    }

    .result-container {
        flex-direction: column;
        align-items: stretch;
    }

    #validation-box > div:nth-of-type(1) {
        display: flex !important;
        flex-direction: row !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    #validate-url {
        flex: 1 !important;
        min-width: 0 !important;
    }

    /* STEP3のヘッダーがスマホで崩れないように調整 */
    .result-header-flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}