/* メインスタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* ヘッダー */
.header {
    background: var(--brand-grad);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: bold;
    margin-right: auto;
}

.logo a {
    display: inline-flex;
    align-items: center;
    line-height: 0;
}

.logo-img {
    height: 32px;
    width: auto;
    display: block;
}

.logo-suffix {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.logo i {
    margin-right: 0.5rem;
    font-size: 1.8rem;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

/* ハンバーガーボタン（デスクトップ非表示） */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 22px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1101;
}

.hamburger span {
    display: block;
    height: 3px;
    width: 100%;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger.is-open span:nth-child(1) {
    transform: translateY(9.5px) rotate(45deg);
}
.hamburger.is-open span:nth-child(2) {
    opacity: 0;
}
.hamburger.is-open span:nth-child(3) {
    transform: translateY(-9.5px) rotate(-45deg);
}

.nav-overlay {
    display: none;
}

/* 左のメニュー(パソコン)のための部品。スマホでは使わない */
:root {
    --sidebar-w: 220px;
    /* 画面上端から本文までの余白。スクロールしても付いてくる要素の位置に使う(スマホは上のバーの分) */
    --page-top: 80px;
}
.logo-mark { display: none; }
/* メニューのAsk Doyle(画面を切り替えずに右側に開くボタン) */
.nav-lock { font-size: 10px; margin-left: 6px; opacity: .75; }
.nav-locked { opacity: .8; }
.nav-ask-doyle { background: transparent; border: none; font: inherit; cursor: pointer; text-align: left; }
.nav-ask-doyle-icon { width: 1.25rem; display: inline-flex; justify-content: center; flex-shrink: 0; }
.nav-ai-credits { font-size: 0.7rem; background: rgba(255,255,255,0.18); border-radius: 6px; padding: 0 6px; margin-left: 4px; font-weight: 600; }
.sidebar-toggle { display: none; }
.nav-main, .nav-bottom { display: flex; gap: 2rem; }

@media (min-width: 769px) {
    body.has-sidebar { --page-top: 24px; }
    html.sidebar-collapsed { --sidebar-w: 68px; }

    body.has-sidebar .header {
        right: auto;
        bottom: 0;
        width: var(--sidebar-w);
        padding: 1rem 0;
        background: var(--brand-grad-v);
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        overflow-x: hidden;
        overflow-y: auto;
        transition: width 0.2s ease;
    }
    body.has-sidebar .header-container {
        max-width: none;
        height: 100%;
        padding: 0 0.75rem;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-rows: auto minmax(0, 1fr);
        align-items: center;
        gap: 1.25rem 0.25rem;
    }
    body.has-sidebar .logo { margin-right: 0; padding-left: 0.5rem; }
    body.has-sidebar .sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 30px;
        height: 30px;
        border: none;
        border-radius: 8px;
        background: transparent;
        color: rgba(255,255,255,0.8);
        cursor: pointer;
    }
    body.has-sidebar .sidebar-toggle:hover { background: rgba(255,255,255,0.15); color: #fff; }
    body.has-sidebar .sidebar-toggle:focus-visible, body.has-sidebar .nav-link:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
    body.has-sidebar .nav {
        grid-column: 1 / -1;
        align-self: stretch;
        flex-direction: column;
        justify-content: space-between;
        gap: 1rem;
    }
    body.has-sidebar .nav-main, body.has-sidebar .nav-bottom { flex-direction: column; gap: 4px; }
    body.has-sidebar .nav-link { padding: 0.6rem 0.75rem; white-space: nowrap; }
    body.has-sidebar .nav-link:hover, body.has-sidebar .nav-link.active { transform: none; }
    body.has-sidebar .nav-link i { width: 1.25rem; text-align: center; flex-shrink: 0; }

    body.has-sidebar .main-content {
        margin-top: 0;
        padding-top: 1.5rem;
        margin-left: calc(var(--sidebar-w) + 1.5rem);
        margin-right: 1.5rem;
        transition: margin-left 0.2s ease;
    }

    /* 折りたたんだとき: アイコンだけ(名前はマウスを乗せると出る) */
    html.sidebar-collapsed body.has-sidebar .header-container { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); justify-items: center; gap: 0.75rem; padding: 0 0.5rem; }
    html.sidebar-collapsed body.has-sidebar .logo { padding-left: 0; }
    html.sidebar-collapsed body.has-sidebar .logo-full,
    html.sidebar-collapsed body.has-sidebar .nav-label { display: none; }
    html.sidebar-collapsed body.has-sidebar .logo-mark { display: block; }
    html.sidebar-collapsed body.has-sidebar .sidebar-toggle i { transform: rotate(180deg); }
    html.sidebar-collapsed body.has-sidebar .nav { width: 100%; }
    html.sidebar-collapsed body.has-sidebar .nav-link { justify-content: center; padding: 0.6rem 0; }
}

/* メインコンテンツ */
.main-content {
    margin-top: 80px;
    padding: 2rem;
    max-width: none;
    margin-left: 2rem;
    margin-right: 2rem;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* ボタン共通スタイル */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.filter-btn {
    background: var(--brand-grad);
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.export-btn {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 0.5rem;
}

.save-btn {
    background: var(--brand-grad);
    color: white;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

/* フォーム */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ページヘッダーフィルターバー */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.dashboard-header h2 {
    font-size: 1.5rem;
    color: #333;
    font-weight: 700;
    margin: 0;
}

.filter-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-bar select,
.filter-bar input[type="text"] {
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    background: white;
    cursor: pointer;
}

.filter-bar select:focus,
.filter-bar input[type="text"]:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.15);
}

.filter-bar .filter-select {
    min-width: 160px;
}

.filter-bar .daterange-input {
    width: 210px;
}

.filter-bar label {
    font-size: 13px;
    color: #555;
    font-weight: 500;
}

/* 日付フィルター */
.date-filter {
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-input {
    padding: 0.5rem;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 0.9rem;
}

/* 媒体タグ */
.media-tag {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    display: inline-block;
}

/* 媒体ごとの色は components/ad-platform-styles.blade.php で config/ad_platforms.php から生成 */

/* ステータス */
.status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status.active {
    background-color: #e8f5e8;
    color: #2e7d32;
}

.status.paused {
    background-color: #fff3e0;
    color: #f57c00;
}

/* テーブル */
.table-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: var(--brand-grad);
    color: white;
    padding: 0.5rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
}

.data-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.data-table th.sortable:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4296 100%);
}

.data-table th.sortable .sort-icon {
    margin-left: 4px;
    font-size: 0.7rem;
    opacity: 0.5;
}

.data-table th.sortable.asc .sort-icon,
.data-table th.sortable.desc .sort-icon {
    opacity: 1;
}

.data-table td {
    padding: 0.5rem;
    border-bottom: 1px solid #e1e5e9;
    font-size: 0.9rem;
    text-align: center;
}

.data-table tr:hover {
    background-color: #f8f9fa;
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .header-container {
        flex-direction: row;
        align-items: center;
        gap: 1rem;
        padding: 0 1rem;
        justify-content: flex-start;
    }

    .hamburger {
        display: flex;
        order: 1;
    }

    .logo {
        order: 2;
        font-size: 1.25rem;
    }

    .logo-img {
        height: auto;
        max-width: 4rem;
    }

    .nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 260px;
        max-width: 80vw;
        height: 100vh;
        background: var(--brand-grad-v);
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0.5rem;
        padding: 4.5rem 1rem 1rem;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 2px 0 10px rgba(0,0,0,0.2);
        z-index: 1100;
        overflow-y: auto;
    }

    .nav.is-open {
        transform: translateX(0);
    }

    .nav-link {
        width: 100%;
    }
    .nav-main, .nav-bottom { flex-direction: column; gap: 0.5rem; }
    .nav-bottom { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,0.2); }

    .nav-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.4);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
        z-index: 1099;
    }

    .nav-overlay.is-open {
        opacity: 1;
        pointer-events: auto;
    }

    body.nav-open {
        overflow: hidden;
    }

    .main-content {
        padding: 1rem;
        margin-top: 80px;
        margin-left: 0;
        margin-right: 0;
    }
    
    .date-filter {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .data-table {
        min-width: 800px;
    }
}

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

.content-section.active {
    animation: fadeIn 0.5s ease-out;
}

/* カード共通スタイル */
.card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

/* AIアシスタント フローティングボタン */
.ai-assistant-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--brand-grad);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    z-index: 1100;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ai-assistant-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(102, 126, 234, 0.55);
}

.ai-assistant-fab.hidden {
    display: none;
}

/* AIアシスタント パネル */
.ai-assistant-panel {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    height: 100dvh;
    width: 380px;
    min-width: 280px;
    max-width: 700px;
    background: #fff;
    box-shadow: -4px 0 24px rgba(0,0,0,0.12);
    z-index: 1200;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-assistant-panel.open {
    transform: translateX(0);
}

/* リサイズハンドル */
.ai-assistant-resize {
    position: absolute;
    top: 0;
    left: -4px;
    width: 8px;
    height: 100%;
    cursor: col-resize;
    z-index: 1210;
    background: transparent;
}

.ai-assistant-resize:hover,
.ai-assistant-resize.active {
    background: var(--brand-grad);
    opacity: 0.5;
}

/* AIアシスタント ヘッダー */
.ai-assistant-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--brand-grad);
    color: white;
    flex-shrink: 0;
}

.ai-assistant-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1rem;
}

.ai-assistant-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ai-assistant-close,
.ai-assistant-new-btn,
.ai-assistant-history-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.ai-assistant-new-btn,
.ai-assistant-history-btn {
    font-size: 0.95rem;
}

.ai-assistant-close:hover,
.ai-assistant-new-btn:hover,
.ai-assistant-history-btn:hover {
    background: rgba(255,255,255,0.2);
}

/* AIアシスタント 会話履歴パネル */
.ai-assistant-history-panel {
    flex-shrink: 0;
    max-height: 0;
    overflow: hidden;
    border-bottom: 1px solid transparent;
    transition: max-height 0.2s ease;
}

.ai-assistant-history-panel.open {
    max-height: 240px;
    overflow-y: auto;
    border-bottom-color: #e5e7eb;
}

.ai-assistant-history-list {
    display: flex;
    flex-direction: column;
}

.ai-history-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 16px;
    background: none;
    border: none;
    border-bottom: 1px solid #f0f2f5;
    font-size: 0.85rem;
    color: #333;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ai-history-item:hover {
    background: #f5f6fa;
}

.ai-history-item.active {
    background: #eef0ff;
    color: #4c4faf;
    font-weight: 600;
}

.ai-history-empty,
.ai-history-loading {
    padding: 16px;
    text-align: center;
    font-size: 0.8rem;
    color: #999;
}

/* AIアシスタント メッセージエリア */
.ai-assistant-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    /* 長い表などで横にはみ出してパネルごとずれないようにする */
    overflow-x: hidden;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-message {
    max-width: 90%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
    word-break: break-word;
}

.ai-message.assistant {
    align-self: flex-start;
    background: #f0f2f5;
    color: #333;
    border-bottom-left-radius: 4px;
}

.ai-message.user {
    align-self: flex-end;
    background: var(--brand-grad);
    color: white;
    border-bottom-right-radius: 4px;
}

.ai-message.assistant.pending {
    min-width: 40px;
    min-height: 14px;
}

.ai-message.assistant.pending::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-left: 2px;
    border-radius: 50%;
    background: #999;
    animation: ai-pending-blink 1.2s infinite ease-in-out;
    box-shadow: 10px 0 #999, 20px 0 #999;
}

@keyframes ai-pending-blink {
    0%, 80%, 100% { opacity: 0.2; }
    40% { opacity: 1; }
}

/* AI応答内のMarkdown要素（見出し/リスト/表/コード） */
.ai-message.assistant p {
    margin: 0 0 8px;
}
.ai-message.assistant p:last-child {
    margin-bottom: 0;
}
.ai-message.assistant ul,
.ai-message.assistant ol {
    margin: 0 0 8px;
    padding-left: 1.4em;
}
.ai-message.assistant li {
    margin-bottom: 2px;
}
.ai-message.assistant h1,
.ai-message.assistant h2,
.ai-message.assistant h3 {
    margin: 8px 0 6px;
    font-size: 1em;
    font-weight: 700;
}
.ai-message.assistant code {
    background: rgba(0, 0, 0, 0.06);
    padding: 1px 4px;
    border-radius: 4px;
    font-size: 0.85em;
}
.ai-message.assistant pre {
    background: rgba(0, 0, 0, 0.06);
    padding: 8px 10px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 0 0 8px;
}
.ai-message.assistant pre code {
    background: none;
    padding: 0;
}
.ai-message.assistant table {
    border-collapse: collapse;
    width: 100%;
    margin: 0 0 8px;
    font-size: 0.85em;
    /* 列が多い表は吹き出しの中で横スクロールさせる */
    display: block;
    max-width: 100%;
    overflow-x: auto;
}
.ai-message.assistant th,
.ai-message.assistant td {
    border: 1px solid rgba(0, 0, 0, 0.12);
    padding: 4px 8px;
    text-align: left;
    /* 表は横スクロールで見せるため、セル内で1文字ずつ折り返さない */
    white-space: nowrap;
}
.ai-message.assistant a {
    color: var(--blue);
}

/* AIアシスタント 対象プロジェクトの選択 */
.ai-assistant-project {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-bottom: 1px solid #e1e5e9;
    background: #F6F8FC;
    flex-shrink: 0;
}
.ai-assistant-project label {
    color: #6b7280;
    font-size: 13px;
}
.ai-assistant-project select {
    flex: 1;
    min-width: 0;
    height: 32px;
    border: 1px solid #DDE3EC;
    border-radius: 6px;
    padding: 0 8px;
    background: #fff;
    font-size: 13px;
}

/* AIアシスタント 今月のクレジット残り */
.ai-assistant-credits {
    padding: 6px 16px 0;
    font-size: 12px;
    color: #6b7280;
    text-align: right;
    background: #fff;
    flex-shrink: 0;
}
.ai-assistant-credits[hidden] {
    display: none;
}

/* AIアシスタント 入力エリア */
.ai-assistant-input-area {
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid #e1e5e9;
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-shrink: 0;
    background: #fff;
}

.ai-assistant-input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 0.9rem;
    resize: none;
    min-height: 42px;
    max-height: 120px;
    font-family: inherit;
    line-height: 1.4;
    transition: border-color 0.2s ease;
}

.ai-assistant-input:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.ai-assistant-send {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: none;
    background: var(--brand-grad);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ai-assistant-send:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

/* オーバーレイ（モバイル用） */
.ai-assistant-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    z-index: 1150;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.ai-assistant-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .ai-assistant-panel {
        width: 100% !important;
        max-width: 100%;
        min-width: 100%;
    }

    .ai-assistant-resize {
        display: none;
    }

    /* iPhoneは16px未満の入力欄をタップすると画面を自動拡大し、
       パネルの左右と閉じるボタンが画面外に出てしまうため16pxにする */
    .ai-assistant-input,
    .ai-assistant-project select {
        font-size: 16px;
    }
}
/* ベータ版ラベル(components/beta-badge.blade.php) */
.beta-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1.5;
    vertical-align: middle;
}
.beta-badge--dark {
    background: var(--cta);
    color: var(--navy);
}
.beta-badge--light {
    background: #E9EEFB;
    color: var(--navy);
}

/* プランの上限の案内(過去データの期間・広告アカウント数) */
.plan-history-note {
    margin: 0 0 12px;
    font-size: 12.5px;
    color: #6b7280;
}

/* レポートのデータ最終更新日時(媒体ごと) */
.data-freshness {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 14px;
    margin: 0 0 12px;
    font-size: 12.5px;
    color: #6b7280;
}
.data-freshness-title { font-weight: 600; }
.data-freshness-item { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.data-freshness-item strong { color: #374151; font-weight: 600; }
.data-freshness-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.data-freshness-warn { color: #b91c1c; font-weight: 600; }

/* レポートの目標KPIの進み具合 */
.goal-progress { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 12px 14px; margin: 0 0 12px; }
.goal-progress-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin-bottom: 8px; font-size: 13px; }
.goal-progress-head span { color: #6b7280; font-size: 12px; }
.goal-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.goal-card { border: 1px solid #eef0f4; border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.goal-card-label { font-size: 12px; color: #6b7280; }
.goal-card-value { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.goal-card-sub { font-size: 11.5px; color: #6b7280; }
.goal-status { display: inline-block; font-size: 11.5px; border-radius: 6px; padding: 1px 8px; align-self: flex-start; }
.goal-status-ok { background: #e7f6ec; color: #166534; }
.goal-status-warn { background: #fef3c7; color: #92400e; }
.goal-status-bad { background: #fde8e8; color: #b91c1c; }
.goal-status-pending, .goal-status-no_revenue, .goal-status-no_revenue_by_media { background: #f3f4f6; color: #6b7280; }
.goal-media { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.goal-media-row { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.goal-media-name { display: inline-flex; gap: 5px; align-items: center; font-weight: 600; min-width: 120px; }
.goal-media-metric small { color: #9ca3af; }

/* Ask Doyle の履歴: すべてのプロジェクト表示のときのプロジェクト名 */
.ai-history-project {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    color: #8A93A6;
}
