/*
スタイリング層

このファイルは、アプリケーション全体のビジュアルデザインを担当します。
- フォント設定とレイアウトの基本スタイル
- Tabulatorテーブルのカスタマイズ
- Table summary bar styles
- ドラッグ&ドロップUIのスタイル
- ソートボタン、フィルターボタンのスタイル
- AIチャット、モーダル、ローディングのスタイル
- データソース連携モーダルのスタイル
- データ結合（横結合・縦結合）画面のスタイル（カード型カラム表示）
- AI自動カラム配置ボタンのスタイル
- データ更新ボタンのアニメーション
- 認証画面（ログイン・新規登録）のスタイル
- アニメーション定義
- Undo/Redoボタンのスタイル
*/

/* Custom Tooltip Styles */
:root {
    --z-tooltip: 3600;
    --z-loading-overlay: 3400;
    --z-modal-base: 3000;
    --z-modal-child: 3100;
    --z-modal-confirm: 3200;
    --z-modal-overlay: 3300;
    --z-toast: 3500;
    --modal-backdrop: rgba(17, 24, 39, 0.45);
    --modal-panel-bg: #ffffff;
    --modal-panel-radius: 14px;
    --modal-panel-shadow:
        0 4px 24px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(15, 23, 42, 0.04);
    --modal-brand: #2563eb;
    --modal-brand-dark: #0c356a;
}

.custom-tooltip {
    position: fixed;
    z-index: var(--z-tooltip);
    background-color: #ffffff;
    color: #374151;
    font-size: 12px;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.1s ease;
    white-space: nowrap;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-tooltip.visible {
    opacity: 1;
}

body {
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.modal-open {
    overflow: hidden;
}

.app-modal {
    padding: 24px;
    background: var(--modal-backdrop);
}

.app-modal-panel {
    background: var(--modal-panel-bg);
    border-radius: var(--modal-panel-radius);
    box-shadow: var(--modal-panel-shadow);
}

.app-modal-panel:focus-visible {
    outline: 2px solid rgba(37, 99, 235, 0.28);
    outline-offset: 2px;
}

.app-modal-panel--confirm {
    width: min(480px, 100%);
    max-width: 480px;
}

.confirm-modal-panel {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 28px 32px 14px;
}

.confirm-modal-content {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.confirm-modal-copy {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #4b5563;
    font-size: 14px;
    line-height: 1.6;
}

.confirm-modal-message-line {
    margin: 0;
}

.confirm-modal-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
    color: #1a1a1f;
}

.confirm-modal-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.confirm-modal-section-label {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #4d4d4d;
}

.confirm-modal-list {
    margin: 0;
    padding-left: 1.1em;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #404040;
    font-size: 13px;
    line-height: 1.55;
}

.confirm-modal-list--muted {
    color: #595959;
}

.confirm-modal-warning {
    margin: 0;
    color: #bf3333;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
}

.confirm-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.confirm-modal-secondary,
.confirm-modal-danger,
.admin-message-ok-btn,
.datasource-apply-btn {
    min-width: 100px;
    height: 38px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.confirm-modal-secondary {
    background: #ffffff;
    border-color: #d9d9d9;
    color: #4d4d4d;
}

.confirm-modal-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.confirm-modal-danger {
    background: #db2626;
    color: #ffffff;
}

.confirm-modal-danger:hover {
    background: #c41f1f;
}

.confirm-modal-primary {
    background: var(--modal-brand);
    color: #ffffff;
}

.confirm-modal-primary:hover {
    background: #1d4ed8;
}

/* Tabulator Table Styles */
.tabulator {
    background-color: transparent;
    border: none;
}

.tabulator .tabulator-header,
.tabulator .tabulator-footer {
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 2px solid #e1e4e8;
    overflow: visible !important;
}

.tabulator .tabulator-header .tabulator-col {
    background: transparent;
    border-right: 1px solid #f0f1f3;
    overflow: visible !important;
}

.tabulator .tabulator-header .tabulator-col:last-child {
    border-right: none;
}

.tabulator .tabulator-col-content {
    overflow: visible !important;
    padding: 12px 16px;
}

.tabulator .tabulator-col-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #24292f;
    letter-spacing: -0.01em;
}

.tabulator .tabulator-row {
    border-bottom: 1px solid #f0f1f3;
    background-color: rgba(255, 255, 255, 0.96);
    transition: background-color 0.15s ease;
}

.tabulator .tabulator-row:hover {
    background-color: #f6f8fa;
}

.tabulator .tabulator-row.tabulator-row-even {
    background-color: #fafbfc;
}

.tabulator .tabulator-row.tabulator-row-even:hover {
    background-color: #f6f8fa;
}

.tabulator .tabulator-cell {
    padding: 10px 16px;
    border-right: 1px solid #f6f8fa;
    font-size: 0.8125rem;
    color: #24292f;
}

.tabulator .tabulator-cell:last-child {
    border-right: none;
}

/* 軸固定時の境界 shadow / 境界線を消して不自然な縦線を出さない */
.tabulator .tabulator-frozen-left,
.tabulator .tabulator-frozen-right {
    box-shadow: none !important;
}

.tabulator .tabulator-col.tabulator-frozen,
.tabulator .tabulator-cell.tabulator-frozen {
    border-right-color: transparent !important;
}

.tabulator .tabulator-col .tabulator-col-content .tabulator-col-sorter {
    display: none !important;
}

/* Drag and Drop Styles */
.column-item.dragging,
.sortable-ghost {
    opacity: 0.5;
    background: #e0f2fe;
    border-style: dashed;
}

.sortable-drag {
    opacity: 1 !important;
}

.drop-zone {
    min-height: 60px;
}

.analysis-panel-section.sql-panel-locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.analysis-panel-section.sql-panel-locked .drop-zone {
    background-color: #eff6ff;
    border-color: #1465a3;
    pointer-events: none;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Main Grid Transition */
#main-grid {
    position: relative;
    min-width: 0;
    transition: grid-template-columns 300ms ease-in-out;
}

/* Panel Resizer Styles */
.panel-resizer {
    width: 6px;
    cursor: col-resize;
    background: transparent;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
    user-select: none;
}

/* Panel sizing for resize functionality */
/* ホーム左サイドバー: design-system.md の panel shell に合わせる */
#left-sidebar {
    width: 350px;
    min-width: 200px;
    max-width: 500px;
    flex-shrink: 0;
    border-right: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 0;
    background: rgba(244, 246, 248, 0.86);
}

.home-sidebar-shell {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 100%;
    padding: 0 14px 0 18px;
}

.analysis-view-mode-card {
    padding: 12px;
}

.analysis-view-mode-toggle {
    position: relative;
    display: flex;
    padding: 4px;
    background: #edf2f6;
    border: 1px solid #dde6ee;
    border-radius: 999px;
}

.analysis-view-mode-toggle__indicator {
    position: absolute;
    top: 4px;
    left: 4px;
    bottom: 4px;
    width: calc(50% - 4px);
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 4px 14px rgba(12, 53, 106, 0.10);
    transform: translateX(0);
    transition: transform 220ms cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.analysis-view-mode-toggle[data-view-mode="display"] .analysis-view-mode-toggle__indicator {
    transform: translateX(100%);
}

.analysis-view-mode-toggle__button {
    position: relative;
    z-index: 1;
    flex: 1;
    padding: 8px 0;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: #7c8b99;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    transition: color 0.15s;
    cursor: pointer;
}

.analysis-view-mode-toggle__button:hover:not(.is-active) {
    color: #374151;
}

.analysis-view-mode-toggle__button.is-active {
    color: var(--modal-brand);
}

.analysis-panel-mode-stack {
    display: flex;
    flex-direction: column;
}

.analysis-panel-axis-shell {
    display: block;
    min-height: 0;
    max-height: 960px;
    overflow: hidden;
    opacity: 1;
    will-change: max-height, opacity;
    transition:
        max-height 220ms cubic-bezier(0.4, 0, 0.2, 1),
        opacity 220ms ease;
}

.analysis-panel-axis-shell > .home-sidebar-card {
    min-height: 0;
    overflow: hidden;
    margin-bottom: 14px;
    will-change: margin-bottom, transform, opacity;
    transition:
        margin-bottom 220ms cubic-bezier(0.4, 0, 0.2, 1),
        transform 220ms ease,
        opacity 220ms ease;
}

#left-sidebar[data-view-mode="display"] .analysis-panel-axis-shell {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
}

#left-sidebar[data-view-mode="display"] .analysis-panel-axis-shell > .home-sidebar-card {
    margin-bottom: 0;
    transform: translateY(-4px);
    opacity: 0;
}

.home-sidebar-card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 16px;
}

.home-sidebar-card--columns {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 220px;
}

.home-sidebar-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.home-sidebar-card-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    color: #0c356a;
}

.home-sidebar-pivot-button {
    padding: 8px 14px;
    border: none;
    border-radius: 8px;
    background: #1465a3;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    transition: background 150ms ease;
    cursor: pointer;
}

.home-sidebar-pivot-button:hover {
    background: #0c356a;
}

.home-sidebar-pivot-button:disabled {
    background: rgba(20, 101, 163, 0.42);
    cursor: not-allowed;
}

#left-sidebar[data-view-mode="display"] .home-sidebar-pivot-button {
    display: none;
}

.home-sidebar-drop-zone {
    min-height: 60px;
    padding: 10px 12px;
    border: 1px dashed #c4d3df;
    border-radius: 12px;
    background: #f8fbfd;
}

.home-sidebar-drop-zone-placeholder {
    margin: 0;
    color: #7b8b9b;
    font-size: 12px;
}

.home-sidebar-helper-text {
    margin: 0 0 10px;
    color: #6f8294;
    font-size: 12px;
}

.home-sidebar-search-container {
    margin-bottom: 14px;
}

.home-sidebar-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #6f8294;
    transition: color 150ms ease, opacity 150ms ease, box-shadow 150ms ease;
}

.home-sidebar-icon-button:hover {
    color: #1465a3;
    background: transparent;
}

.home-sidebar-icon-button svg {
    width: 20px;
    height: 20px;
}

.home-sidebar-icon-button:focus-visible,
.home-sidebar-pivot-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(20, 101, 163, 0.10);
}

.home-sidebar-column-list {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    gap: 8px;
    min-height: 0;
}

/* ホーム左サイドバー: design-system.md §3.14（目立たないスクロールバー） */
.left-sidebar-scroll {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

.left-sidebar-scroll.is-scrollbar-hovered,
.left-sidebar-scroll.is-scrolling {
    scrollbar-color: #c8d2dc transparent;
}

.left-sidebar-scroll::-webkit-scrollbar {
    width: 6px;
}

.left-sidebar-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.left-sidebar-scroll::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 999px;
}

.left-sidebar-scroll.is-scrollbar-hovered::-webkit-scrollbar-thumb,
.left-sidebar-scroll.is-scrolling::-webkit-scrollbar-thumb {
    background: #c8d2dc;
}

.left-sidebar-scroll.is-scrollbar-hovered::-webkit-scrollbar-thumb:hover,
.left-sidebar-scroll.is-scrolling::-webkit-scrollbar-thumb:hover {
    background: #aebdcb;
}

/* ホーム Tabulator（#data-table）: 縦横スクロールとも design-system.md §3.14 */
#data-table .tabulator-tableholder {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

#data-table .tabulator-tableholder.is-scrollbar-hovered,
#data-table .tabulator-tableholder.is-scrolling {
    scrollbar-color: #c8d2dc transparent;
}

#data-table .tabulator-tableholder::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

#data-table .tabulator-tableholder::-webkit-scrollbar-track {
    background: transparent;
}

#data-table .tabulator-tableholder::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 999px;
}

#data-table .tabulator-tableholder.is-scrollbar-hovered::-webkit-scrollbar-thumb,
#data-table .tabulator-tableholder.is-scrolling::-webkit-scrollbar-thumb {
    background: #c8d2dc;
}

#data-table .tabulator-tableholder.is-scrollbar-hovered::-webkit-scrollbar-thumb:hover,
#data-table .tabulator-tableholder.is-scrolling::-webkit-scrollbar-thumb:hover {
    background: #aebdcb;
}

/* 背景は左サイドバー・結合カードと同じ --bg-card */
#center-panel {
    flex: 1;
    min-width: 300px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
}

#chat-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 400px;
    min-width: 400px;
    max-width: 400px;
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(12,53,106,0.10), 0 4px 12px rgba(12,53,106,0.06);
    z-index: 1001;
    will-change: transform, opacity;
    transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1), opacity 220ms ease;
}

#chat-panel.chat-panel--open {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

#chat-panel.chat-panel--closed {
    opacity: 0;
    transform: translateX(calc(100% + 18px));
    pointer-events: none;
}

/* Modal Styles */
#pivot-modal.hidden {
    display: none;
}

/* Sort Button Styles */
.sort-button {
    cursor: pointer;
    user-select: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 24px;
    margin-left: 4px;
    position: relative;
    padding: 0 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    transition: all 150ms ease;
    gap: 2px;
}

.sort-button.inactive {
    color: #9ca3af;
    background-color: transparent;
}

.sort-button.inactive:hover {
    background-color: #f3f4f6;
    color: #6b7280;
}

.sort-button.active {
    color: #2563eb;
    background-color: #dbeafe;
}

.sort-button.active:hover {
    background-color: #bfdbfe;
}

.sort-priority-badge {
    font-size: 10px;
    font-weight: 700;
    color: inherit;
}

.filter-button {
    cursor: pointer;
    user-select: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    transition: all 150ms ease;
    border: none;
    background: transparent;
    padding: 0;
}

.filter-button svg {
    width: 13px;
    height: 13px;
}

.filter-button.inactive {
    color: #9ca3af;
}

.filter-button.inactive:hover {
    color: #6b7280;
    background-color: #f3f4f6;
}

.filter-button.active {
    color: #2563eb;
    background-color: #dbeafe;
}

.filter-button.active:hover {
    background-color: #bfdbfe;
}

.filter-dropdown-panel {
    position: fixed;
    z-index: 1200;
    width: 280px;
    max-width: calc(100vw - 24px);
    background: #ffffff;
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    box-shadow: 0 18px 42px rgba(12, 53, 106, 0.12);
    padding: 10px;
}

.filter-dropdown-summary {
    margin-bottom: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #eff6ff;
    color: #0c356a;
    font-size: 12px;
    line-height: 1.45;
}

.filter-dropdown-values {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 2px;
}

.filter-dropdown-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    color: #334155;
    font-size: 13px;
    cursor: pointer;
}

.filter-dropdown-option:hover {
    background: #f8fafc;
}

.filter-dropdown-option input {
    accent-color: #2563eb;
}

.filter-dropdown-empty,
.filter-dropdown-loading {
    padding: 20px 10px;
    text-align: center;
    color: #94a3b8;
    font-size: 12px;
}

.filter-dropdown-actions {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
}

.filter-dropdown-actions button {
    min-width: 88px;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
}

.filter-dropdown-actions button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.filter-dropdown-clear {
    background: #f8fafc;
    color: #475569;
    border-color: #e2e8f0;
}

.filter-dropdown-apply {
    background: #2563eb;
    color: #ffffff;
}

.filter-dropdown-apply:disabled {
    background: #93c5fd;
    color: #eff6ff;
}

.format-button-disabled {
    opacity: 0.45;
    pointer-events: none;
    filter: grayscale(0.2);
}

/* Loading Overlay Styles */
#loading-overlay {
    z-index: var(--z-loading-overlay);
    pointer-events: all;
}

#loading-overlay.hidden {
    display: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner {
    animation: spin 1s linear infinite;
}

/* AI Chat Styles (Premium Redesign) */

/* Panel Container */
#chat-panel {
    background-color: #f8fafc; /* Cool gray background for depth */
}

/* Header */
#chat-panel > div:nth-child(2) {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
}

.ai-panel-title {
    background: linear-gradient(135deg, #1e293b 0%, #475569 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 15px;
}

/* Chat History */
#chat-history {
    background-color: #f8fafc;
    background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
    background-size: 24px 24px;
    padding: 70px 20px 100px 20px; /* Top padding for header, bottom for input */
}

.chat-message {
    display: flex;
    flex-direction: column;
    gap: 6px;
    animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 88%;
    margin-bottom: 16px;
}

.chat-message.ai {
    align-self: flex-start;
}

.chat-message.user {
    align-self: flex-end;
    align-items: flex-end;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Removed avatars */
.chat-avatar {
    display: none;
}

.chat-bubble {
    padding: 14px 18px;
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
    letter-spacing: 0.01em;
}

.chat-bubble.ai {
    background-color: #ffffff;
    border: 1px solid #f1f5f9;
    color: #334155;
    border-radius: 12px 12px 12px 4px;
    box-shadow: 0 2px 4px rgba(148, 163, 184, 0.05), 0 4px 6px rgba(148, 163, 184, 0.05);
}

.chat-bubble.user {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    border: none;
    border-radius: 12px 12px 4px 12px;
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.2), 0 2px 4px rgba(79, 70, 229, 0.1);
    font-weight: 500;
}

/* Input Area */
#chat-panel > div:last-child {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, #f8fafc 80%, rgba(248, 250, 252, 0));
    padding: 20px;
    z-index: 10;
}

.prompt-suggestions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.prompt-suggestions.hidden {
    display: none;
}

.prompt-suggestion-card {
    width: 100%;
    text-align: left;
    border: 1px solid rgba(20, 101, 163, 0.18);
    border-radius: 16px;
    padding: 14px 16px;
    background:
        linear-gradient(180deg, rgba(20, 101, 163, 0.08) 0%, rgba(20, 101, 163, 0.03) 100%),
        #ffffff;
    box-shadow: 0 10px 24px rgba(12, 53, 106, 0.08);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.prompt-suggestion-card.is-loading {
    cursor: default;
    border-color: rgba(20, 101, 163, 0.22);
    box-shadow: 0 10px 24px rgba(12, 53, 106, 0.05);
    animation: promptSuggestionPulse 1.3s ease-in-out infinite;
}

.prompt-suggestion-card:hover {
    transform: translateY(-1px);
    border-color: rgba(20, 101, 163, 0.34);
    box-shadow: 0 14px 28px rgba(12, 53, 106, 0.12);
}

.prompt-suggestion-card.is-loading:hover,
.prompt-suggestion-card.is-loading:active {
    transform: none;
    box-shadow: 0 10px 24px rgba(12, 53, 106, 0.05);
}

.prompt-suggestion-card:active {
    transform: translateY(0);
}

.prompt-suggestion-title {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    color: #0c356a;
    margin-bottom: 4px;
}

.prompt-suggestion-body {
    font-size: 12px;
    line-height: 1.6;
    color: #35526c;
}

@keyframes promptSuggestionPulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.prompt-suggestion-hide-row {
    display: flex;
    justify-content: flex-end;
    margin-bottom: -4px;
}

.prompt-suggestion-hide-btn {
    font-size: 11px;
    color: #9ca3af;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.4;
    transition: color 0.15s ease;
    user-select: none;
}

.prompt-suggestion-hide-btn:hover {
    color: #6b7280;
}

/* --- AIサジェスチョントグルスイッチ --- */
.chat-inline-suggestion-row {
    display: flex;
    justify-content: flex-start;
    margin-top: -2px;
}

.chat-inline-suggestion-btn {
    border: none;
    background: transparent;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    line-height: 1.4;
    color: rgba(12, 53, 106, 0.56);
    cursor: pointer;
    text-align: left;
    transition: color 0.15s ease;
}

.chat-inline-suggestion-icon {
    font-size: 11px;
    color: rgba(12, 53, 106, 0.42);
    transform: translateY(-1px);
}

.chat-inline-suggestion-text {
    display: inline-block;
}

.chat-inline-suggestion-btn:hover {
    color: rgba(20, 101, 163, 0.92);
}

.chat-inline-suggestion-btn:hover .chat-inline-suggestion-icon {
    color: rgba(20, 101, 163, 0.72);
}

.chat-inline-suggestion-btn.is-consumed,
.chat-inline-suggestion-btn:disabled {
    color: rgba(100, 116, 139, 0.62);
    cursor: default;
}

.chat-inline-suggestion-btn.is-consumed .chat-inline-suggestion-icon,
.chat-inline-suggestion-btn:disabled .chat-inline-suggestion-icon {
    color: rgba(100, 116, 139, 0.48);
}

.profile-toggle-switch {
    position: relative;
    width: 36px;
    height: 20px;
    border-radius: 10px;
    background: #d1d5db;
    cursor: pointer;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.profile-toggle-switch.active {
    background: #1465a3;
}

.profile-toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

.profile-toggle-switch.active .profile-toggle-knob {
    transform: translateX(16px);
}

.chat-input-container {
    position: relative;
    display: flex;
    align-items: center;
    background: #ffffff;
    border-radius: 20px;
    padding: 6px 8px 6px 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-input-container:focus-within {
    border-color: #818cf8;
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.1), 0 4px 6px -2px rgba(99, 102, 241, 0.05);
    transform: translateY(-2px);
}

.chat-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 8px 4px;
    font-size: 14px;
    color: #1e293b;
    min-height: 24px;
    max-height: 120px;
    resize: none;
    line-height: 1.5;
}

.chat-input::placeholder {
    color: #94a3b8;
}

.chat-input:focus {
    outline: none;
    box-shadow: none;
}

.chat-send-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    background-color: #4f46e5;
    color: white;
    transform: scale(1.05);
}

.chat-send-btn:active {
    transform: scale(0.95);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f1f5f9;
}

/* データ未連携時のチャットパネルオーバーレイ */
.chat-no-datasource-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
}

.chat-no-datasource-overlay.hidden {
    display: none;
}

.chat-panel-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 0;
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    transition: color 0.18s ease;
}

.chat-panel-toggle-btn:hover {
    color: #6b7280;
}

.chat-panel-toggle-btn:focus-visible {
    outline: 2px solid rgba(20, 101, 163, 0.28);
    outline-offset: 4px;
    border-radius: 8px;
}

.chat-panel-toggle-btn.is-active {
    color: #1465a3;
}

.chat-panel-toggle-btn__icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.chat-no-datasource-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
    padding: 24px;
}

.chat-no-datasource-icon {
    width: 48px;
    height: 48px;
    color: #1465a3;
    opacity: 0.7;
}

.chat-no-datasource-title {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.chat-no-datasource-desc {
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
    margin: 0;
}

.chat-no-datasource-btn {
    margin-top: 4px;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    background: #1465a3;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.chat-no-datasource-btn:hover {
    background: #0c356a;
    transform: translateY(-1px);
}

.chat-no-datasource-btn:active {
    transform: translateY(0);
}

/* AI Loading (Minimal Premium) */
.ai-loading-message {
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    margin-bottom: 8px;
    animation: fadeIn 0.3s ease-out;
}

.ai-loading-dots {
    display: flex;
    gap: 5px;
}

.ai-loading-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #818cf8;
    animation: loadingDotPremium 1.4s ease-in-out infinite both;
}

.ai-loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.ai-loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes loadingDotPremium {
    0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}


/* Gradient Button Styles */
/* .modal-header-gradient は Phase 6a で廃止 — 全モーダルが白ベースヘッダーに移行済み */

.ai-generate-button {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background:
        radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 34%),
        linear-gradient(135deg, #8f62cb 0%, #5d81dc 52%, #48c2c4 100%);
    box-shadow:
        0 7px 16px rgba(93, 129, 220, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.ai-generate-button::before {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
    opacity: 0.8;
    pointer-events: none;
}

.ai-generate-button > * {
    position: relative;
    z-index: 1;
}

.ai-generate-button:hover {
    background:
        radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.24) 0%, rgba(255, 255, 255, 0) 36%),
        linear-gradient(135deg, #986ad3 0%, #678ae2 52%, #54cacb 100%);
    box-shadow:
        0 8px 18px rgba(103, 138, 226, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
    transform: translateY(-1px);
}

.ai-generate-button:active {
    transform: translateY(0);
    box-shadow:
        0 5px 12px rgba(103, 138, 226, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.ai-generate-button:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 3px rgba(255, 255, 255, 0.7),
        0 0 0 6px rgba(103, 138, 226, 0.2),
        0 8px 18px rgba(103, 138, 226, 0.16);
}

.create-column-button {
    --create-column-gradient: linear-gradient(90deg, #9453C7 0%, #4B85CC 50%, #46C7BE 100%);
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 28px;
    max-width: 100%;
    padding: 2px 10px;
    border: 2px solid transparent;
    border-radius: 6px;
    background:
        linear-gradient(#ffffff, #ffffff) padding-box,
        var(--create-column-gradient) border-box;
    box-shadow: none;
    transition: transform 0.2s ease, filter 0.2s ease;
    flex-shrink: 0;
}

.create-column-button:hover {
    transform: translateY(-1px);
    filter: saturate(1.1) brightness(1.05);
}

.create-column-button:active {
    transform: translateY(0);
}

.create-column-button:disabled {
    opacity: 0.42;
    cursor: not-allowed;
    pointer-events: none;
    filter: grayscale(0.3);
}

.create-column-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(103, 138, 226, 0.4);
}

.create-column-button__label-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.create-column-button__icon {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.ai-text {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
}

.create-column-button__sparkles-absolute {
    position: absolute;
    top: -3px;
    left: 12px;
    width: 9px;
    height: 9px;
    pointer-events: none;
}

.create-column-button__label {
    background: var(--create-column-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .create-column-button {
        min-height: 26px;
        padding: 2px 8px;
        gap: 2px;
    }
    
    .create-column-button__label {
        font-size: 11px;
    }
}

@media (max-width: 640px) {
    .create-column-button__label {
        font-size: 11px;
    }
}

.blue-gradient {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.blue-gradient:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.green-gradient {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.green-gradient:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

/* AI Loading Message Styles */
.ai-loading-message {
    display: flex;
    gap: 8px;
    animation: fadeInUp 0.3s ease-out;
}

.ai-loading-bubble {
    flex: 1;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    max-width: 100%;
    word-wrap: break-word;
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border: 1px solid #667eea30;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-loading-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}

.ai-loading-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    animation: loadingDot 1.4s ease-in-out infinite;
}

.ai-loading-dots span:nth-child(1) {
    animation-delay: 0s;
}

.ai-loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.ai-loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes loadingDot {
    0%, 80%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    40% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Column Name Scrollable Styles */
.column-name-span {
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}

.column-name-span::-webkit-scrollbar {
    height: 4px;
}

.column-name-span::-webkit-scrollbar-track {
    background: transparent;
}

.column-name-span::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}

.column-name-span::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Column Add Buttons Styles */
.column-add-buttons {
    display: flex;
    gap: 4px;
    margin-left: 8px;
}

.add-to-axis-btn,
.add-to-indicator-btn,
.add-to-display-btn {
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 4px;
    border: 1px solid #d1d5db;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    line-height: 1.2;
    background-color: #f9fafb;
    color: #6b7280;
}

.add-to-axis-btn:hover,
.add-to-indicator-btn:hover,
.add-to-display-btn:hover {
    background-color: #e5e7eb;
    color: #374151;
    border-color: #9ca3af;
}

/* AI Response Overlay Styles */
#ai-response-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 900;
    pointer-events: none;
    display: none;
}

#ai-response-overlay.active {
    display: block;
}

/* オーバーレイの背景部分（テーブル以外） */
#ai-response-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(1px);
    pointer-events: auto;
}

/* チャットパネルとテーブル領域をオーバーレイから除外 */

#data-table {
    position: relative;
    z-index: 901;
    pointer-events: auto;
    padding-bottom: 4px;
}

.table-summary {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 12px;
    border-top: 1px solid #e5e7eb;
    background-color: rgba(255, 255, 255, 0.96);
    font-size: 12px;
}

.table-summary-item {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.table-summary-label {
    color: #6b7280;
    font-weight: 500;
}

.table-summary-value {
    color: #374151;
    font-weight: 600;
}

.table-summary-datasource {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-summary-separator {
    width: 1px;
    height: 14px;
    background-color: #e5e7eb;
    flex-shrink: 0;
}

@media (max-width: 1024px) {
    .table-summary {
        gap: 12px;
    }

    .table-summary-datasource {
        max-width: 180px;
    }
}

/* Disable interactions on sort and filter buttons during AI response */
.sort-button.disabled,
.filter-button.disabled {
    position: relative;
    pointer-events: none !important;
    cursor: not-allowed !important;
}

.sort-button.disabled::before,
.filter-button.disabled::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 4px;
    z-index: 1000;
    pointer-events: auto;
}

/* Reset Button Styles (通常: 灰色、ホバー: 赤) */
.reset-button {
    cursor: pointer;
    user-select: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    transition: all 150ms ease;
    color: #9ca3af;
    background-color: transparent;
    border: none;
}

.reset-button:hover {
    background-color: #fef2f2;
    color: #ef4444;
}

.reset-button svg {
    width: 14px;
    height: 14px;
}

/* Download Button Styles (通常: 灰色、ホバー: 緑) */
.download-button-header {
    cursor: pointer;
    user-select: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    transition: all 150ms ease;
    color: #9ca3af;
    background-color: transparent;
    border: none;
}

.download-button-header:hover {
    background-color: #d1fae5;
    color: #10b981;
}

.download-button-header svg {
    width: 14px;
    height: 14px;
}

/* Column List Sidebar Styles */
#column-list-sidebar {
    scrollbar-width: thin;
    scrollbar-color: #d1d5db #f9fafb;
}

#column-list-sidebar::-webkit-scrollbar {
    width: 6px;
}

#column-list-sidebar::-webkit-scrollbar-track {
    background: #f9fafb;
}

#column-list-sidebar::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

#column-list-sidebar::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* 共通カラムアイテムホバーエフェクト */
.column-hover-effect {
    transition: all 0.2s ease;
}

.column-hover-effect:hover {
    background: linear-gradient(135deg, #f3f4f6 0%, #fafbfc 100%) !important;
    border-color: #d1d5db !important;
    transform: translateX(2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* ドラッグ中はホバーエフェクトを無効化 */
.column-hover-effect.dragging:hover,
.column-hover-effect.sortable-ghost:hover {
    transform: none;
    box-shadow: none;
}

/* ============================================================
   カスタム指標 iマーク（説明ボタン）
   ============================================================ */
.metric-info-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid #1465a3;
    background: transparent;
    color: #1465a3;
    font-size: 11px;
    font-weight: 700;
    font-style: italic;
    font-family: 'Georgia', serif;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.2s ease, background-color 0.2s ease;
    flex-shrink: 0;
    margin-left: 6px;
    padding: 0;
    line-height: 1;
}

.metric-info-mark:hover {
    opacity: 0.7;
}

.metric-info-mark--active {
    opacity: 1;
    background-color: rgba(20, 101, 163, 0.06);
}

.metric-info-mark--active:hover {
    background-color: rgba(20, 101, 163, 0.12);
}

.metric-info-mark--loading {
    opacity: 0.6;
    animation: metric-info-pulse 1s ease-in-out infinite;
    pointer-events: none;
}

@keyframes metric-info-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

/* ============================================================
   カスタム指標 説明ポップオーバー
   ============================================================ */
.metric-explanation-popover {
    position: fixed;
    z-index: 99999;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1),
                0 4px 10px -5px rgba(0, 0, 0, 0.04);
    padding: 16px;
    width: 300px;
    max-width: calc(100vw - 20px);
    font-size: 13px;
    line-height: 1.5;
    color: #374151;
}

.metric-explanation-popover__header {
    font-size: 14px;
    font-weight: 600;
    color: #0c356a;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.metric-explanation-popover__row {
    margin-bottom: 8px;
}

.metric-explanation-popover__row:last-child {
    margin-bottom: 0;
}

.metric-explanation-popover__label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.metric-explanation-popover__value {
    display: block;
    color: #1f2937;
}

/* 縦結合チップ専用ホバーエフェクト（上方向移動） */
.chip-hover-effect {
    transition: all 0.15s ease;
}

.chip-hover-effect:hover {
    background: linear-gradient(135deg, #f3f4f6 0%, #fafbfc 100%) !important;
    border-color: #d1d5db !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.column-sidebar-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.column-sidebar-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================================
   カラム型チップ（サイドバー内）
   ============================================================ */
.column-type-chip {
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    background: #eef3f7;
    color: #6c7b8a;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ============================================================
   AIカラム作成モーダル（統合版 — Figma 274:330/387/442 準拠）
   ============================================================ */
.ai-column-panel {
    display: flex;
    width: 920px;
    height: 600px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 24px 48px -12px rgba(12,53,106,0.12), 0 0 1px 1px rgba(0,0,0,0.03);
    overflow: hidden;
}

/* --- 左サイドバー --- */
.ai-column-sidebar {
    width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    overflow: hidden;
}

.ai-column-sidebar-header {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ai-column-sidebar-title {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.ai-column-sidebar-search {
    width: 100%;
    padding: 7px 10px;
    font-size: 13px;
    color: #111827;
    background: #fafbfc;
    border: 1px solid #e2e5ea;
    border-radius: 8px;
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease;
    box-sizing: border-box;
}

.ai-column-sidebar-search:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.ai-column-sidebar-search::placeholder {
    color: #9ca3af;
}

.ai-column-sidebar-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* --- 右メインエリア --- */
.ai-column-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fafbfc;
    min-width: 0;
    overflow: hidden;
}

/* ヘッダー */
.ai-column-header {
    padding: 14px 16px 12px 24px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
}

.ai-column-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-column-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-column-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2563eb;
    flex-shrink: 0;
}

.ai-column-title {
    font-size: 17px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.ai-column-close-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ai-column-close-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.ai-column-rename-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    background: transparent;
    border: 1px solid #e2e5ea;
    cursor: pointer;
    transition: all 150ms ease;
}

.ai-column-rename-btn:hover {
    color: #2563eb;
    border-color: #2563eb;
    background: rgba(37,99,235,0.04);
}

/* ステッパー */
.ai-column-stepper {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- ステップコンテンツ --- */
.ai-column-step {
    display: none;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.ai-column-step.active {
    display: flex;
}

/* Step 1 & 3: フォームコンテンツ */
.ai-column-step-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 60px 48px 40px;
    overflow-y: auto;
}

.ai-column-step-indicator {
    font-size: 12px;
    font-weight: 500;
    color: #2563eb;
    margin-bottom: 12px;
}

.ai-column-step-title {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 12px;
}

.ai-column-step-desc {
    font-size: 14px;
    color: #4b5563;
    line-height: 22px;
    margin: 0;
}

.ai-column-step1-spacer { height: 8px; flex-shrink: 0; }
.ai-column-step1-grow { flex: 1; min-height: 16px; }

.ai-column-field-label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.ai-column-name-input {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    color: #111827;
    background: #ffffff;
    border: 1px solid #e2e5ea;
    border-radius: 10px;
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease;
    box-sizing: border-box;
}

.ai-column-name-input:focus {
    border-color: #2563eb;
    border-width: 2px;
    box-shadow: 0 0 4px 2px rgba(37,99,235,0.1);
}

.ai-column-name-error {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #dc2626;
    line-height: 1.55;
}

.ai-column-name-error .column-name-suggestions {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.ai-column-name-error .column-name-suggestion {
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: #f8fbfd;
    border: 1px solid #e2e5ea;
    color: #2563eb;
    cursor: pointer;
    transition: all 150ms ease;
}

.ai-column-name-error .column-name-suggestion:hover {
    background: rgba(37,99,235,0.04);
    border-color: #2563eb;
}

.ai-column-name-hint {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 8px;
}

.ai-column-step1-actions {
    display: flex;
    justify-content: flex-end;
}

.ai-column-next-btn {
    padding: 10px 24px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 150ms ease;
}

.ai-column-next-btn:hover {
    background: #1d4ed8;
}

/* Step 2: チャット */
.ai-column-chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
}

.ai-column-chat-input-area {
    padding: 16px;
    background: #ffffff;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
}

/* Step 3: レビューカード */
.ai-column-review-card {
    padding: 16px;
    background: #ffffff;
    border: 1px solid #e2e5ea;
    border-radius: 10px;
}

.ai-column-review-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 0;
}

.ai-column-review-row + .ai-column-review-row {
    border-top: 1px solid #f0f3f6;
}

.ai-column-review-label {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
}

.ai-column-review-value {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.ai-column-review-formula {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    color: #374151;
    word-break: break-all;
}

.ai-column-review-type {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: #edf2ff;
    color: #2563eb;
    width: fit-content;
}

.ai-column-review-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
}

.ai-column-btn-primary {
    margin-left: auto;
    padding: 10px 24px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 150ms ease;
}

.ai-column-btn-primary:hover {
    background: #1d4ed8;
}

.ai-column-btn-secondary {
    padding: 8px 14px;
    background: #ffffff;
    color: #4b5563;
    border: 1px solid #e2e5ea;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 150ms ease;
}

.ai-column-btn-secondary:hover {
    color: #2563eb;
    border-color: #2563eb;
    background: rgba(37,99,235,0.04);
}

.ai-column-review-note {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 12px;
}

/* ============================================================
   ステッパー（Figma 準拠: #2563eb active, #0c356a completed）
   ============================================================ */
.stepper-step {
    display: flex;
    align-items: center;
    gap: 6px;
}

.stepper-number {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    background: #ffffff;
    color: #9ca3af;
    border: 1.5px solid #e2e5ea;
    transition: all 220ms cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.stepper-step.active .stepper-number {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.stepper-step.completed .stepper-number {
    background: #0c356a;
    color: #fff;
    border-color: #0c356a;
}

.stepper-label {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 400;
    white-space: nowrap;
}

.stepper-step.active .stepper-label {
    color: #111827;
    font-weight: 500;
}

.stepper-step.completed .stepper-label {
    color: #111827;
    font-weight: 500;
}

.stepper-connector {
    width: 32px;
    height: 1px;
    background: #e2e5ea;
    flex-shrink: 0;
}

/* 旧レビューパネル CSS 削除済み — .ai-column-review-* に移行 */

/* ============================================================
   テンプレートチップ（#2563eb 統一）
   ============================================================ */
.column-chat-templates {
    padding: 4px 0 8px;
}

.column-chat-template-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.column-chat-template-chip {
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    background: #ffffff;
    border: 1px solid #e2e5ea;
    cursor: pointer;
    transition: all 150ms ease;
}

.column-chat-template-chip:hover {
    color: #2563eb;
    border-color: #2563eb;
    background: rgba(37,99,235,0.04);
}

/* ============================================================
   成功後ハイライトアニメーション
   ============================================================ */
.column-highlight {
    animation: column-pulse 1.5s ease;
}

@keyframes column-pulse {
    0%, 100% { box-shadow: none; }
    25% { box-shadow: 0 0 0 3px rgba(37,99,235,0.25); }
    75% { box-shadow: 0 0 0 3px rgba(37,99,235,0.10); }
}

/* Indicator Columns z-index: ドロップダウンが検索バーより手前に表示されるように */
#indicator-columns {
    position: relative;
    z-index: 10;
}

#indicator-columns .column-item {
    position: relative;
}

#indicator-columns .column-item.indicator-dropdown-open {
    z-index: 30;
}

/* Column Search Bar Styles */
.column-search-container {
    position: relative;
    z-index: 1;
}

.column-search-input {
    padding: 7px 10px 7px 32px;
    background: #ffffff;
    border: 1px solid #d7e0e7;
    border-radius: 9px;
    color: #24364a;
    font-size: 12px;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.column-search-input:focus {
    outline: none;
    border-color: var(--modal-brand);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

.column-search-input::placeholder {
    color: #7b8b9b;
}

.column-search-icon {
    color: #7b8b9b;
    pointer-events: none;
}

@media (max-width: 640px) {
    .ai-column-panel {
        flex-direction: column;
        height: auto;
        max-height: calc(100vh - 32px);
    }
    .ai-column-sidebar {
        width: 100%;
        max-height: 200px;
        flex-shrink: 1;
    }
}

/* Data Source Modal Styles */
.datasource-modal-scroll {
    scrollbar-width: thin;
    scrollbar-color: #c8d2dc transparent;
}
.datasource-modal-scroll::-webkit-scrollbar {
    width: 6px;
}
.datasource-modal-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.datasource-modal-scroll::-webkit-scrollbar-thumb {
    background: #c8d2dc;
    border-radius: 999px;
}
.datasource-modal-scroll::-webkit-scrollbar-thumb:hover {
    background: #aebdcb;
}

/* Datasource Error Banner */
.ds-error-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid rgba(220, 38, 38, 0.18);
    border-radius: 10px;
    background:
        linear-gradient(180deg, rgba(254, 242, 242, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
    box-shadow: 0 4px 12px rgba(153, 27, 27, 0.06);
    color: #b91c1c;
    animation: ds-error-banner-in 0.2s ease-out;
}

.ds-error-banner-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 9999px;
    background: rgba(220, 38, 38, 0.10);
    color: #dc2626;
    flex-shrink: 0;
    margin-top: 1px;
}

.ds-error-banner-icon svg {
    width: 16px;
    height: 16px;
}

.ds-error-banner-content {
    flex: 1;
    min-width: 0;
}

.ds-error-banner-message {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
    font-weight: 600;
    white-space: pre-line;
}

.ds-error-banner-recovery {
    margin: 4px 0 0;
    font-size: 11px;
    line-height: 1.4;
    font-weight: 400;
    color: #991b1b;
    opacity: 0.85;
}

.ds-error-banner-close {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #b91c1c;
    cursor: pointer;
    border-radius: 6px;
    font-size: 16px;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.15s, background-color 0.15s;
    padding: 0;
}

.ds-error-banner-close:hover {
    opacity: 1;
    background: rgba(220, 38, 38, 0.08);
}

@keyframes ds-error-banner-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- OAuth認証ステータスバナー --- */

.ds-auth-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 4px 12px rgba(12, 53, 106, 0.06);
    color: #0c356a;
    animation: ds-auth-status-in 0.2s ease-out;
}

.ds-auth-status-spinner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.ds-auth-status-spinner svg {
    width: 20px;
    height: 20px;
    color: var(--modal-brand);
    animation: ds-auth-status-spin 1s linear infinite;
}

.ds-auth-status-message {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
    font-weight: 600;
}

@keyframes ds-auth-status-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes ds-auth-status-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* --- ステップインジケーター --- */

#datasource-modal-step-indicator {
    position: sticky;
    top: 0;
    z-index: 10;
}

.ds-step-indicator {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 8px 14px;
    border: 1px solid rgba(37, 99, 235, 0.15);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
    box-shadow: 0 2px 8px rgba(12, 53, 106, 0.04);
    animation: ds-step-indicator-in 0.2s ease-out;
}

.ds-step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    white-space: nowrap;
}

.ds-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}

.ds-step-label {
    font-size: 11px;
    line-height: 1;
    font-weight: 500;
}

/* 完了ステップ */
.ds-step-item[data-state="completed"] .ds-step-number {
    background: #0c356a;
    color: #fff;
}

.ds-step-item[data-state="completed"] .ds-step-label {
    color: #0c356a;
    font-weight: 600;
}

/* 現在ステップ */
.ds-step-item[data-state="current"] .ds-step-number {
    background: var(--modal-brand);
    color: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.ds-step-item[data-state="current"] .ds-step-label {
    color: var(--modal-brand);
    font-weight: 700;
}

/* 未到達ステップ */
.ds-step-item[data-state="upcoming"] .ds-step-number {
    background: #e5e7eb;
    color: #9ca3af;
}

.ds-step-item[data-state="upcoming"] .ds-step-label {
    color: #9ca3af;
}

/* ステップ間の矢印 */
.ds-step-arrow {
    margin: 0 8px;
    color: #d1d5db;
    font-size: 11px;
    flex-shrink: 0;
}

@keyframes ds-step-indicator-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.datasource-item {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 64px;
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    cursor: pointer;
    background: #ffffff;
}

.datasource-item:hover {
    border-color: #cfd8e3;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.datasource-item.selected {
    padding: 9px 13px;
    border-width: 2px;
    border-color: #2663eb;
    box-shadow: 0 0 0 1px rgba(38, 99, 235, 0.08);
}

.datasource-item-control {
    flex-shrink: 0;
}

.datasource-checkbox {
    appearance: none;
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    border: 2px solid #c7c7c7;
    border-radius: 999px;
    background: #ffffff;
    position: relative;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.datasource-checkbox:checked {
    border-color: #2663eb;
}

.datasource-checkbox:checked::after {
    content: '';
    position: absolute;
    inset: 50% auto auto 50%;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #2663eb;
    transform: translate(-50%, -50%);
}

.datasource-checkbox:focus-visible {
    outline: 2px solid rgba(38, 99, 235, 0.28);
    outline-offset: 2px;
}

.datasource-item-body {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.datasource-item-main {
    min-width: 0;
}

.datasource-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.datasource-info {
    flex: 1;
    min-width: 0;
}

.datasource-name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: #1a1a1f;
}

.datasource-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.datasource-type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
}

.datasource-type-badge.excel {
    background: #e0f0e0;
    color: #268c26;
}

.datasource-type-badge.csv {
    background: #e0f0e0;
    color: #268c26;
}

.datasource-type-badge.sheets {
    background: #e0f0e0;
    color: #268c26;
}

.datasource-type-badge.google_ads,
.datasource-type-badge.yahoo_ads,
.datasource-type-badge.meta_ads,
.datasource-type-badge.x_ads,
.datasource-type-badge.ga4 {
    background: #edf2ff;
    color: #2663eb;
}

.datasource-delete-btn {
    padding: 0;
    border: none;
    font-size: 13px;
    font-weight: 500;
    color: #d93333;
    background: transparent;
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.datasource-delete-btn:hover {
    color: #bf3333;
}

.datasource-status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.datasource-status-badge--current {
    background: #edf2ff;
    color: #2663eb;
}

.datasource-status-badge--connected {
    background: #fff7ed;
    color: #b2731a;
}

.datasource-last-updated {
    font-size: 11px;
    color: #808080;
    white-space: nowrap;
}

.datasource-workspace-panel {
    width: min(900px, 100%);
    max-height: min(800px, calc(100vh - 48px));
}

.datasource-modal-header {
    border-bottom: 1px solid #ebebeb;
    background: #ffffff;
}

.datasource-modal-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #999999;
    font-size: 22px;
    line-height: 1;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.datasource-modal-close-btn:hover {
    background: #f3f4f6;
    color: #4b5563;
}

.datasource-workspace-footer {
    background: #ffffff;
}

.datasource-apply-btn {
    min-width: 180px;
    padding: 0 20px;
    background: #2663eb;
    color: #ffffff;
}

.datasource-apply-btn:hover {
    background: #1f55ca;
}

.datasource-apply-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Refresh Button Animation */
#refresh-data-btn svg {
    transition: transform 0.3s ease;
}

#refresh-data-btn:hover svg {
    transform: rotate(90deg);
}

#refresh-data-btn.refreshing svg {
    animation: spin 1s linear infinite;
}

/* ============================================================
   認証画面専用スタイル（ログイン・新規登録）
   ============================================================ */

/* 認証ページのボディスタイル */
body.auth-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* 認証コンテナ */
.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 認証ヘッダー */
.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.auth-header p {
    font-size: 0.875rem;
    color: #6b7280;
}

/* フォーム入力フィールドの追加スタイル */
.auth-form input:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ログイン・登録ボタンのホバーエフェクト */
.auth-submit-button {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.auth-submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.3);
}

.auth-submit-button:active {
    transform: translateY(0);
}

/* 利用規約モーダル */
.terms-consent-label {
    font-size: 12px;
    line-height: 1.6;
    color: #64748b;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.terms-consent-link {
    color: #475569;
    font-weight: 600;
    text-decoration-line: underline;
    text-decoration-color: rgba(100, 116, 139, 0.36);
    text-underline-offset: 3px;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.terms-consent-link:hover {
    color: var(--modal-brand);
    text-decoration-color: rgba(37, 99, 235, 0.42);
}

.terms-modal-container {
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.terms-modal-body {
    scrollbar-width: thin;
    scrollbar-color: #c8d2dc transparent;
}
.terms-modal-body::-webkit-scrollbar {
    width: 6px;
}
.terms-modal-body::-webkit-scrollbar-track {
    background: transparent;
}
.terms-modal-body::-webkit-scrollbar-thumb {
    background: #c8d2dc;
    border-radius: 999px;
}
.terms-modal-body::-webkit-scrollbar-thumb:hover {
    background: #aebdcb;
}

/* ============================================================
   データ結合（横結合）画面専用スタイル
   ============================================================ */

.integration-join-screen {
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 26%),
        linear-gradient(180deg, #f4f6f8 0%, #eef2f5 100%);
}

.integration-join-layout {
    gap: 0;
}

/* リサイズハンドル */
.resize-handle {
    width: 4px;
    background: rgba(148, 163, 184, 0.42);
    cursor: col-resize;
    transition: background-color 0.15s ease;
    flex-shrink: 0;
}

.resize-handle:hover {
    background: var(--modal-brand);
}

.resize-handle:active {
    background: #0c356a;
}

/* 横結合設定画面の設定パネル */
#integration-settings-panel {
    width: 380px;
    min-width: 320px;
    max-width: 500px;
}

.integration-settings-shell {
    padding: 18px 14px 18px 18px;
    background: rgba(244, 246, 248, 0.86);
    border-right: 1px solid rgba(148, 163, 184, 0.18);
}

.integration-settings-header {
    padding: 10px 12px 18px;
}

.integration-settings-scroll {
    padding: 0 8px 12px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.integration-settings-scroll::-webkit-scrollbar {
    display: none;
}

.vertical-union-settings-scroll {
    padding-right: 6px;
    scrollbar-width: thin;
    scrollbar-color: #c8d2dc transparent;
}

.vertical-union-settings-scroll::-webkit-scrollbar {
    display: block;
    width: 6px;
}

.vertical-union-settings-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.vertical-union-settings-scroll::-webkit-scrollbar-thumb {
    background: #c8d2dc;
    border-radius: 999px;
}

.vertical-union-settings-scroll::-webkit-scrollbar-thumb:hover {
    background: #aebdcb;
}

.integration-settings-card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(212, 220, 228, 0.95);
    border-radius: 8px;
    padding: 16px;
    margin: 0 4px 14px 0;
}

.integration-settings-card--active {
    border-color: rgba(212, 220, 228, 0.95);
}

.integration-settings-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.integration-settings-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #0c356a;
    line-height: 1.2;
    margin: 0;
}

.integration-settings-card-body {
    min-width: 0;
}

.integration-settings-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 12px 8px;
    margin-right: 8px;
    border-top: 1px solid rgba(212, 220, 228, 0.95);
}

.integration-settings-footer .integration-modal-btn-primary,
.integration-settings-footer .integration-modal-btn-secondary {
    padding: 10px 16px;
}

/* 結合キーペア行 */
.join-key-pair-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
    border: none;
    border-radius: 14px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.join-key-pair-row:hover {
    box-shadow: none;
}

.join-key-side {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.join-key-side--left {
    padding-left: 0;
}

.join-key-side--right {
    padding-left: 0;
}

.join-key-pair-row select {
    width: 100%;
    padding: 7px 28px 7px 10px;
    font-size: 12px;
    line-height: 1.4;
    color: #24364a;
    background-color: #fff;
    border: 1px solid #d7e0e7;
    border-radius: 9px;
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23999'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    transition: border-color 0.15s ease;
}

.join-key-pair-row select[data-role="column"] {
    border-color: transparent;
}

.join-key-side--left select[data-role="column"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236366f1'/%3E%3C/svg%3E");
}

.join-key-side--right select[data-role="column"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23ec4899'/%3E%3C/svg%3E");
}

.join-key-pair-row select[data-role="column"]:focus {
    border-color: transparent;
    box-shadow: none;
}

.join-key-pair-row select:focus {
    border-color: var(--modal-brand);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

.join-key-pair-row select.cast-select {
    padding: 5px 24px 5px 8px;
    font-size: 11px;
    color: #5b6b7d;
    background-color: #f3f6f9;
    border-color: #edf1f5;
}

.join-key-pair-row select.cast-select:focus {
    border-color: var(--modal-brand);
    background-color: #fff;
}

.join-key-equals {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #7b8b9b;
}

.join-key-remove-btn {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: #9aa7b4;
    font-size: 14px;
    cursor: pointer;
    border-radius: 999px;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.join-key-remove-btn:hover {
    color: #e04848;
    background-color: rgba(224, 72, 72, 0.08);
}

.join-key-add-btn {
    width: 100%;
    padding: 10px 12px;
    margin-top: 8px;
    border: 1px solid #c4d3df;
    border-radius: 12px;
    background: #f8fbfd;
    color: #6f8294;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.join-key-add-btn:hover {
    color: var(--modal-brand);
    border-color: var(--modal-brand);
    background: rgba(37, 99, 235, 0.04);
}

.join-key-empty {
    padding: 16px 12px;
    text-align: center;
    font-size: 12px;
    color: #6f8294;
    border: 1px solid #d5dfe7;
    border-radius: 12px;
    background: #f8fbfd;
}

.integration-output-columns-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* カラムチェックボックスリスト（左サイドバー） */
.integration-column-group {
    background: #f7fafc;
    border: 1px solid #e1e8ef;
    border-radius: 14px;
    overflow: hidden;
}

.integration-column-group-header {
    padding: 10px 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
    border-bottom: 1px solid #e8eef4;
    font-size: 12px;
    font-weight: 600;
    color: #24364a;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.integration-column-group-header .header-text {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.integration-column-group-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--group-color, #2563eb);
    flex-shrink: 0;
}

.integration-column-list {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 280px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #c8d2dc transparent;
    -ms-overflow-style: auto;
}

.integration-column-list::-webkit-scrollbar {
    width: 6px;
}

.integration-column-list::-webkit-scrollbar-track {
    background: transparent;
}

.integration-column-list::-webkit-scrollbar-thumb {
    background: #c8d2dc;
    border-radius: 999px;
}

.integration-column-list::-webkit-scrollbar-thumb:hover {
    background: #aebdcb;
}

/* 左サイドバーのカラムカード（チェックボックス付き） */
.integration-column-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #e6edf3;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.integration-column-card:hover {
    background: rgba(244, 246, 248, 0.86);
    border-color: var(--modal-brand);
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(12, 53, 106, 0.08);
}

.integration-column-card .column-card-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--group-color, #2563eb);
    flex-shrink: 0;
}

.integration-column-card .column-card-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.integration-column-card-type {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    max-width: 122px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #eef3f7;
    color: #6c7b8a;
    font-size: 11px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* データソース選択モーダルのアイテム */
.integration-ds-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(212, 220, 228, 0.95);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.integration-ds-item:hover {
    border-color: var(--modal-brand);
    background: rgba(37, 99, 235, 0.04);
}

.integration-ds-item.selected {
    border-color: var(--modal-brand);
    background: linear-gradient(135deg, rgba(37,99,235,0.08) 0%, rgba(37,99,235,0.12) 100%);
}

.integration-ds-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--modal-brand);
}

.integration-ds-item .ds-info {
    flex-grow: 1;
}

.integration-ds-item .ds-name {
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
}

.integration-ds-item .ds-meta {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

#integration-preview-table .tabulator {
    border: none;
}

#integration-preview-table .tabulator-header {
    background: rgba(255, 255, 255, 0.96);
}

#integration-preview-table .tabulator-header .tabulator-col {
    background: rgba(255, 255, 255, 0.96);
}

.integration-join-screen *::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.integration-join-screen *::-webkit-scrollbar-track {
    background: transparent;
}

.integration-join-screen *::-webkit-scrollbar-thumb {
    background: #c8d2dc;
    border-radius: 999px;
}

.integration-join-screen *::-webkit-scrollbar-thumb:hover {
    background: #aebdcb;
}

/* ─── データ連携モーダル共通パターン（design-system.md 準拠） ─── */

.integration-modal-panel {
    border-radius: var(--modal-panel-radius);
    overflow: hidden;
    background: #ffffff;
    box-shadow: var(--modal-panel-shadow);
}

.integration-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #ebebeb;
}

.integration-modal-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.integration-modal-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: none;
    color: #9ca3af;
    font-size: 20px;
    font-weight: 300;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.integration-modal-close-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.integration-modal-body {
    padding: 24px;
}

.integration-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-top: 1px solid #ebebeb;
}

.integration-modal-footer--end {
    justify-content: flex-end;
}

.integration-modal-btn-primary {
    padding: 8px 16px;
    background: var(--modal-brand);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.integration-modal-btn-primary:hover {
    background: #1d4ed8;
}

.integration-modal-btn-primary:disabled {
    background: rgba(37, 99, 235, 0.42);
    cursor: not-allowed;
    box-shadow: none;
}

.integration-modal-btn-secondary {
    padding: 8px 16px;
    background: #ffffff;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.integration-modal-btn-secondary:hover {
    background: #f9fafb;
}

.integration-modal-input {
    width: 100%;
    padding: 8px 12px;
    font-size: 12px;
    line-height: 1.4;
    color: #24364a;
    background: #ffffff;
    border: 1px solid #d7e0e7;
    border-radius: 9px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.integration-modal-input:focus {
    border-color: var(--modal-brand);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

.integration-modal-input::placeholder {
    color: #6f8294;
}

/* ─── ゴーストボタン（design-system.md 3.5 Ghost準拠） ─── */

.integration-ghost-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    background: #f8fbfd;
    border: 1px solid #c4d3df;
    color: #6f8294;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.integration-ghost-btn:hover {
    color: var(--modal-brand);
    border-color: var(--modal-brand);
    background: rgba(37, 99, 235, 0.04);
}

/* ─── テキストカラーユーティリティ（design-system.md 2.1準拠） ─── */

.integration-text-brand-dark {
    color: #0c356a;
}

.integration-text-brand {
    color: var(--modal-brand);
}

.integration-text-body {
    color: #24364a;
}

.integration-text-secondary {
    color: #5b6b7d;
}

/* ─── タイポグラフィ階層（design-system.md 2.2準拠） ─── */
/* Tier 1: セクション見出し → .integration-settings-card-title (15px/700/1.2/#0c356a) */

/* Tier 2: フィールドラベル */
.integration-label {
    font-size: 13px;
    font-weight: 600;
    color: #0c356a;
}

/* Tier 3: 本文テキスト */
.integration-body-text {
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    color: #24364a;
}

/* Tier 4: 補助テキスト */
.integration-helper-text {
    font-size: 11px;
    font-weight: 400;
    line-height: 1.4;
    color: #5b6b7d;
}

/* 結合タイプバッジ（データソース一覧用） */
.datasource-type-badge.joined {
    background: #fef3c7;
    color: #92400e;
}

/* フォーム区切り線 */
.auth-divider {
    border-top: 1px solid #e5e7eb;
    margin: 1.5rem 0;
}

/* ページ遷移リンク */
.auth-link {
    color: #2563eb;
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-link:hover {
    color: #1d4ed8;
}

/* メッセージアニメーション */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#error-message:not(.hidden),
#success-message:not(.hidden) {
    animation: slideInDown 0.3s ease-out;
}

/* ============================================================
   縦結合（UNION ALL）画面専用スタイル
   ============================================================ */

#vertical-union-settings-panel {
    width: 420px;
    min-width: 360px;
    max-width: 500px;
}

.vertical-union-datasource-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.vertical-union-datasource-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #f8fbfd;
    border: 1px solid #d7e0e7;
    font-size: 12px;
    font-weight: 600;
    color: #24364a;
}

.vertical-union-datasource-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    flex-shrink: 0;
}

.vertical-union-output-columns {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vertical-union-output-empty {
    padding: 18px 14px;
    border: 1px dashed #d7e0e7;
    border-radius: 12px;
    background: var(--bg-empty-state, linear-gradient(180deg, #ffffff, #fbfdff));
    color: #7b8b9b;
    font-size: 12px;
    text-align: center;
}

.vertical-union-output-card {
    border: 1px solid #e1e8ef;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff, #fbfcfe);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vertical-union-output-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 112px auto auto;
    gap: 10px;
    align-items: center;
}

.vertical-union-col-name-input {
    width: 100%;
    padding: 7px 10px;
    font-size: 12px;
    line-height: 1.4;
    color: #24364a;
    background: #fff;
    border: 1px solid #d7e0e7;
    border-radius: 9px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.vertical-union-col-name-input:focus,
.vertical-union-col-type-select:focus,
.vertical-union-source-select:focus,
.vertical-union-search-input:focus {
    border-color: var(--modal-brand);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

.vertical-union-col-type-select,
.vertical-union-source-select,
.vertical-union-search-input {
    width: 100%;
    padding: 7px 28px 7px 10px;
    font-size: 12px;
    line-height: 1.4;
    color: #24364a;
    background-color: #fff;
    border: 1px solid #d7e0e7;
    border-radius: 9px;
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23999'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

.vertical-union-search-input {
    cursor: text;
    background-image: none;
    padding-right: 10px;
}

.vertical-union-coverage-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 54px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    color: #5b6b7d;
    background: #eef3f7;
}

.vertical-union-coverage-spacer {
    width: 54px;
    min-width: 54px;
    height: 1px;
}

.vertical-union-coverage-badge.warning {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
}

.vertical-union-delete-btn {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: none;
    background: none;
    color: #9aa7b4;
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.vertical-union-delete-btn:hover {
    color: #e04848;
    background: rgba(224, 72, 72, 0.08);
    border-color: rgba(224, 72, 72, 0.28);
}

.vertical-union-source-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.vertical-union-source-row {
    display: grid;
    grid-template-columns: minmax(0, 112px) minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

.vertical-union-source-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-size: 12px;
    font-weight: 600;
    color: #24364a;
}

.vertical-union-source-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vertical-union-unmapped-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.vertical-union-limit-note {
    margin: 0;
    font-size: 11px;
    color: #7b8b9b;
}

.vertical-union-unmapped-columns {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vertical-union-unmapped-group {
    border: 1px solid #e1e8ef;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.98));
    padding: 12px;
}

.vertical-union-unmapped-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 700;
    color: #0c356a;
}

.vertical-union-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.vertical-union-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--chip-color, #d7e0e7);
    color: #24364a;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.vertical-union-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(12, 53, 106, 0.08);
}

.vertical-union-chip-type {
    font-size: 10px;
    color: #6f8294;
}

.vertical-union-unmapped-empty {
    font-size: 12px;
    color: #9ca3af;
    padding: 4px 2px;
}

.vertical-union-suggestion-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.vertical-union-suggestion-summary:not(:empty) {
    margin-top: 12px;
    font-size: 12px;
    line-height: 1.5;
    color: #5b6b7d;
}


.vertical-union-preview-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 14px 18px 0;
    flex-shrink: 0;
}

.vertical-union-summary-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef3f7;
    color: #24364a;
    font-size: 12px;
    font-weight: 600;
}

.vertical-union-summary-chip.warning {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
}

.vertical-union-preview-banner-body {
    min-width: 0;
}

.vertical-union-preview-warning-list {
    margin: 6px 0 0;
    padding-left: 16px;
    font-size: 12px;
    line-height: 1.55;
    color: #b45309;
}

.vertical-union-preview-warning-list:empty {
    display: none;
}

.vertical-union-preview-warning .integration-preview-error-icon {
    background: rgba(245, 158, 11, 0.14);
    color: #d97706;
}

.vertical-union-preview-warning {
    border-color: rgba(245, 158, 11, 0.22);
    background: rgba(255, 251, 235, 0.98);
    box-shadow: 0 10px 24px rgba(180, 83, 9, 0.08);
}

.vertical-union-preview-warning .integration-preview-error-text {
    color: #92400e;
}

/* 結合タイプバッジ（データソース一覧用） - 縦結合 */
.datasource-type-badge.vertical_union {
    background: #eef3f7;
    color: #6c7b8a;
}

/* 結合種別ピルタブ */
.join-type-tabs {
    position: relative;
    display: flex;
    background: #edf2f6;
    padding: 4px;
    border-radius: 999px;
    border: 1px solid #dde6ee;
}

.join-type-indicator {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    background: #fff;
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(12, 53, 106, 0.10);
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    will-change: transform;
}

.join-type-tab {
    position: relative;
    z-index: 1;
    flex: 1;
    padding: 8px 0;
    font-size: 12px;
    font-weight: 600;
    color: #7c8b99;
    background: transparent;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: color 0.15s;
}

.join-type-tab.active {
    color: var(--modal-brand);
    font-weight: 600;
}

.join-type-tab:hover:not(.active) {
    color: #374151;
}

/* 結合種別 インフォメーションマーク */
.join-type-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid var(--modal-brand);
    color: var(--modal-brand);
    font-size: 11px;
    font-weight: 700;
    font-style: italic;
    font-family: Georgia, serif;
    cursor: pointer;
    background: none;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
    transition: background-color 0.15s;
}

.join-type-info-btn:hover {
    background-color: rgba(37, 99, 235, 0.08);
}

/* 結合種別 説明ポップオーバー */
.join-type-popover {
    position: fixed;
    z-index: 99999;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(12, 53, 106, 0.14), 0 2px 8px rgba(0, 0, 0, 0.06);
    width: 288px;
    max-height: 440px;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.5;
    scrollbar-width: thin;
    scrollbar-color: #d9e1e8 transparent;
}

.join-type-popover::-webkit-scrollbar {
    width: 6px;
}

.join-type-popover::-webkit-scrollbar-track {
    background: transparent;
}

.join-type-popover::-webkit-scrollbar-thumb {
    background: #d9e1e8;
    border-radius: 999px;
}

.join-type-popover::-webkit-scrollbar-thumb:hover {
    background: #c6d2dc;
}

.join-type-popover__title {
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 14px 16px 10px;
    border-bottom: 1px solid #edf1f5;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}

.join-type-popover__item {
    padding: 13px 16px;
    border-bottom: 1px solid #f3f4f6;
}

.join-type-popover__item:last-child {
    border-bottom: none;
}

.join-type-popover__name-row {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 6px;
}

.join-type-popover__name {
    font-size: 13px;
    font-weight: 700;
    color: #0c356a;
}

.join-type-popover__desc {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.65;
    margin: 0;
}

.join-type-popover__highlight {
    color: var(--modal-brand);
    font-weight: 600;
}

/* プレビューヘッダー */
.integration-canvas {
    padding: 18px 20px 18px 16px;
    background: transparent;
}

.integration-preview-shell {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(212, 220, 228, 0.95);
    border-radius: 22px;
    box-shadow: 0 16px 40px rgba(12, 53, 106, 0.06);
    overflow: hidden;
}

.integration-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px 14px;
    border-bottom: 1px solid #edf1f5;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.95) 0%, rgba(255, 255, 255, 0.9) 100%);
    flex-shrink: 0;
}

.integration-preview-limit {
    font-size: 13px;
    color: #9ca3af;
    font-weight: 500;
}

.integration-preview-error-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 14px 18px 0;
    padding: 12px 14px;
    border: 1px solid rgba(220, 38, 38, 0.18);
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(254, 242, 242, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
    box-shadow: 0 10px 24px rgba(153, 27, 27, 0.08);
    color: #b91c1c;
    flex-shrink: 0;
}

.integration-preview-error-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 9999px;
    background: rgba(220, 38, 38, 0.12);
    color: #dc2626;
    flex-shrink: 0;
}

.integration-preview-error-icon svg {
    width: 18px;
    height: 18px;
}

.integration-preview-error-text {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
    font-weight: 600;
}

.integration-preview-placeholder {
    padding: 32px;
    background:
        radial-gradient(circle at center, rgba(37, 99, 235, 0.03), transparent 28%),
        linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.integration-preview-table {
    min-height: 0;
    background: #ffffff;
}

#integration-confirm-btn:disabled {
    background: rgba(37, 99, 235, 0.42);
    cursor: not-allowed;
    box-shadow: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === カラム表示名インライン編集 === */
.column-name-input {
    flex-grow: 1;
    padding: 2px 6px;
    font-size: 0.875rem;
    border: 1px solid #3b82f6;
    border-radius: 4px;
    outline: none;
    background: white;
    min-width: 60px;
    max-width: 150px;
}

.column-name-input:focus {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

/* 変更済みカラム名のスタイル（ツールチップはtitle属性で表示、スタイルは通常と同じ） */

/* === カラム表示/非表示トグルスイッチ === */
.column-toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.column-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d1d5db;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.column-toggle-switch input:checked + .toggle-slider {
    background-color: var(--modal-brand);
}

.column-toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.column-toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* カスタムカラム識別タグ（カラム一覧 & 表示/非表示モーダル共用） */
.custom-column-tag {
    font-size: 10px;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 4px;
    background-color: #e0e7ff;
    color: #6366f1;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

/* カラム設定モーダルのアイテム */
.column-visibility-item {
    transition: all 0.15s ease;
}

.column-visibility-item:hover {
    background-color: #e5e7eb;
}

/* モーダル内のインライン編集入力フィールド */
.column-visibility-name-input {
    width: 100%;
    padding: 2px 6px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid #6366f1;
    border-radius: 4px;
    outline: none;
    background: white;
}

.column-visibility-name-input:focus {
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}

/* Datasource Instruction Bubble */
/* Datasource Instruction Bubble */
.datasource-instruction-bubble {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 16px;
    background: #ffffff;
    color: var(--modal-brand);
    border: 2px solid var(--modal-brand);
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    z-index: 50; /* Local stacking context is fine now that header is high */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    pointer-events: none;
    animation: floatingBubble 2s ease-in-out infinite;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.datasource-instruction-bubble.visible {
    opacity: 1;
    visibility: visible;
}

.datasource-instruction-bubble::before {
    content: '';
    position: absolute;
    top: -8px; /* Adjusted for border */
    right: 24px;
    width: 12px;
    height: 12px;
    background: #ffffff;
    border-left: 2px solid var(--modal-brand);
    border-top: 2px solid var(--modal-brand);
    transform: rotate(45deg);
}

@keyframes floatingBubble {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

/* === 運営メッセージ（お知らせ）機能スタイル === */


/* ========================================
   プロフィール / 設定系モーダル リファインドスタイル
   ======================================== */

/* --- ハンバーガーボタン --- */

.hamburger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
    position: relative;
}

.hamburger-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

/* --- プロフィールサイドバー --- */

.profile-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: calc(var(--z-modal-base) - 2);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.profile-sidebar-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.profile-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 320px;
    height: 100%;
    background: #ffffff;
    z-index: calc(var(--z-modal-base) - 1);
    transform: translateX(-320px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 32px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.profile-sidebar.is-open {
    transform: translateX(0);
}

.profile-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 16px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.profile-sidebar-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    letter-spacing: -0.01em;
}

.profile-sidebar-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.profile-sidebar-close-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.profile-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 20px 32px;
}

.profile-section-category {
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0 4px;
    margin-bottom: 4px;
}

.profile-user-section {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.profile-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e8f0fe 0%, #d4e4f7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.profile-avatar-icon {
    width: 30px;
    height: 30px;
    color: var(--modal-brand);
    margin-top: 4px;
}

.profile-user-email {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 4px;
}

.profile-section-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.profile-menu-divider {
    height: 1px;
    background: #f0f0f0;
    margin-bottom: 12px;
}

.profile-menu-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #374151;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.profile-menu-item:hover {
    background: #f5f7fa;
}

.profile-menu-item--danger {
    color: #dc2626;
}

.profile-menu-item--danger:hover {
    background: #fef2f2;
}

.profile-menu-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #f3f4f6;
    color: #6b7280;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.profile-menu-item:hover .profile-menu-icon {
    background: #e9ecf1;
    color: #374151;
}

.profile-menu-icon--danger {
    background: #fef2f2;
    color: #dc2626;
}

.profile-menu-item--danger:hover .profile-menu-icon--danger {
    background: #fee2e2;
    color: #b91c1c;
}

.profile-menu-label {
    flex: 1;
    font-weight: 450;
}

.profile-menu-chevron {
    width: 16px;
    height: 16px;
    color: #d1d5db;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

.profile-menu-item:hover .profile-menu-chevron {
    color: #9ca3af;
    transform: translateX(2px);
}


/* --- 設定系モーダル共通（パスワード変更・フィードバック） --- */

.settings-modal-panel {
    background: #ffffff;
    border-radius: 14px;
    width: 420px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.04),
        0 24px 48px -12px rgba(0, 0, 0, 0.18);
    animation: modalSlideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.settings-modal-panel--wide {
    width: 480px;
}

.settings-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #f0f0f0;
}

.settings-modal-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    letter-spacing: -0.01em;
}

.settings-modal-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.settings-modal-close-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.settings-modal-body {
    padding: 24px;
    overflow-y: auto;
}

.settings-description {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 20px;
    line-height: 1.5;
}

.settings-form-group {
    margin-bottom: 20px;
}

.settings-form-group:last-of-type {
    margin-bottom: 24px;
}

.settings-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.settings-label-optional {
    font-weight: 400;
    color: #9ca3af;
    font-size: 12px;
    margin-left: 2px;
}

.settings-label-required {
    color: #ef4444;
    font-weight: 500;
}

.settings-input {
    width: 100%;
    height: 40px;
    border: 1px solid #e2e5ea;
    border-radius: 8px;
    padding: 0 12px;
    font-size: 14px;
    color: #111827;
    background: #ffffff;
    outline: none;
    transition: all 0.15s ease;
    box-sizing: border-box;
}

.settings-input::placeholder {
    color: #c0c5cc;
}

.settings-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.settings-textarea {
    width: 100%;
    border: 1px solid #e2e5ea;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    color: #111827;
    background: #ffffff;
    outline: none;
    resize: none;
    transition: all 0.15s ease;
    font-family: inherit;
    line-height: 1.6;
    box-sizing: border-box;
}

.settings-textarea::placeholder {
    color: #c0c5cc;
}

.settings-textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.settings-select {
    width: 100%;
    height: 40px;
    border: 1px solid #e2e5ea;
    border-radius: 8px;
    padding: 0 12px;
    font-size: 14px;
    color: #111827;
    background: #ffffff;
    outline: none;
    transition: all 0.15s ease;
    box-sizing: border-box;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%239ca3af' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.settings-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.settings-hint {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 6px;
}

.settings-char-count {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 6px;
    text-align: right;
}

.settings-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 4px;
}

.settings-btn-secondary {
    height: 38px;
    padding: 0 16px;
    border-radius: 8px;
    border: 1px solid #e2e5ea;
    background: #ffffff;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.settings-btn-secondary:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.settings-btn-primary {
    height: 38px;
    padding: 0 20px;
    border-radius: 8px;
    border: none;
    background: #2563eb;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.settings-btn-primary:hover {
    background: #1d4ed8;
}

.settings-btn-danger {
    background: #dc2626;
}

.settings-btn-danger:hover {
    background: #b91c1c;
}

.settings-btn-danger:disabled {
    background: #dc2626;
}

.settings-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.settings-btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}


/* --- インラインメッセージ（パスワード変更 success/error） --- */

.settings-inline-message {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 450;
    line-height: 1.5;
    margin-bottom: 20px;
    animation: messageSlideIn 0.2s ease-out;
}

.settings-inline-message.hidden {
    display: none;
}

.settings-inline-message--success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
}

.settings-inline-message--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}


/* --- 通知設定モーダル --- */

.settings-modal-panel--notification {
    width: min(1200px, calc(100vw - 32px));
    height: min(700px, calc(100vh - 32px));
}

.settings-modal-panel--notification .settings-modal-body {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 20px 24px 24px;
}

.notif-shell {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    gap: 16px;
}

.notif-summary-bar {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 10px 16px;
    border-radius: 8px;
    background: #f5f7ff;
    flex-wrap: wrap;
}

.notif-summary-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #405999;
    white-space: nowrap;
}

.notif-summary-item[data-tone="warn"]::before {
    content: "●";
    color: #f59e0b;
    font-size: 8px;
    margin-right: 2px;
}

.notif-summary-item[data-tone="success"] {
    color: #405999;
}

.notif-summary-item[data-tone="warn"] {
    color: #405999;
}

.notif-summary-item[data-tone="error"] {
    color: #dc2626;
}

.notif-summary-item[data-tone="muted"] {
    color: #405999;
}

.notif-section-panel {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.notif-workspace-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.notif-workspace-header--editor {
    padding-bottom: 12px;
    border-bottom: 1px solid #eef2f7;
}

.notif-pane-title {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}

.notif-pane-description {
    margin: 4px 0 0;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.5;
}

/* 2ペインレイアウト */
.notif-layout {
    display: flex;
    gap: 20px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.notif-rule-list-pane {
    width: 280px;
    flex-shrink: 0;
    background: #fafafc;
    border-radius: 8px;
    padding: 12px;
    overflow-y: auto;
    min-height: 0;
}

.notif-rule-editor-pane {
    flex: 1;
    padding-left: 4px;
    overflow-y: auto;
    min-height: 0;
}

.notif-destinations-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    min-height: 0;
}

.notif-dest-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notif-shell-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.notif-footer-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.notif-footer-status {
    font-size: 12px;
    font-weight: 500;
    color: #2563eb;
}

.notif-footer-status[data-tone="warn"] {
    color: #2563eb;
}

.notif-footer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.notif-footer-actions .settings-btn-secondary,
.notif-footer-actions .settings-btn-primary {
    white-space: nowrap;
    font-size: 13px;
    border-radius: 8px;
    padding: 8px 16px;
}

.notif-footer-actions .settings-btn-secondary {
    border-color: #d9d9d9;
    color: #4d4d4d;
    font-weight: 500;
}

.notif-footer-actions .settings-btn-primary {
    background: #2563eb;
    font-weight: 600;
}

.notif-shell-footer .notif-test-msg {
    min-height: 18px;
}

@media (max-width: 960px) {
    .settings-modal-panel--notification {
        width: calc(100vw - 24px);
        height: calc(100vh - 24px);
    }

    .notif-layout {
        flex-direction: column;
    }

    .notif-rule-list-pane {
        width: 100%;
        border-radius: 8px;
        padding: 12px;
    }

    .notif-rule-editor-pane {
        padding-left: 0;
    }

    .notif-shell-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .notif-footer-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 640px) {
    .notif-section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .notif-footer-actions {
        flex-direction: column;
    }

    .notif-footer-actions .settings-btn-secondary,
    .notif-footer-actions .settings-btn-primary {
        width: 100%;
    }
}

/* フッター（通知先管理ボタン） */
.notif-dest-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 14px;
    margin-top: 14px;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.notif-open-dest-btn {
    color: var(--modal-brand);
    font-size: 13px;
    font-weight: 500;
    background: none;
    border: 1px solid var(--modal-brand);
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
}

.notif-open-dest-btn:hover {
    background: #f0f7ff;
}

.notif-dest-footer-count {
    font-size: 13px;
    color: #6b7280;
}

/* 通知先管理サブモーダル */
.notif-submodal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal-child);
}

.notif-submodal-panel {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    width: 480px;
    max-width: calc(100vw - 32px);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.notif-submodal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    flex-shrink: 0;
}

.notif-submodal-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
}

.notif-submodal-close-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #6b7280;
    cursor: pointer;
    line-height: 1;
}

.notif-submodal-close-btn:hover {
    color: #111827;
}

/* Per-rule notify time (in rule form) */

.notif-rule-notify-time-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.notif-rule-notify-time-input {
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.3px;
    padding: 7px 10px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    color: #1f2937;
    outline: none;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    width: 130px;
}

.notif-rule-notify-time-input:hover {
    border-color: #93c5fd;
    background: #fff;
}

.notif-rule-notify-time-input:focus {
    border-color: var(--modal-brand);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

.notif-rule-notify-time-input::-webkit-calendar-picker-indicator {
    opacity: 0.45;
    cursor: pointer;
    transition: opacity 0.2s;
}

.notif-rule-notify-time-input::-webkit-calendar-picker-indicator:hover {
    opacity: 0.75;
}

.notif-rule-notify-time-clear {
    font-size: 12px;
    padding: 6px 12px;
    background: none;
    color: #6b7280;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.notif-rule-notify-time-clear:hover {
    color: #374151;
    border-color: #9ca3af;
}

.notif-rule-notify-time-desc {
    font-size: 12px;
    color: #6b7280;
    margin: 4px 0 0 0;
}

/* Tab navigation */

.notif-tabs {
    display: flex;
    gap: 16px;
    border-bottom: 1px solid #ebebeb;
}

.notif-tab {
    padding: 8px 4px;
    font-size: 14px;
    font-weight: 400;
    color: #808080;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.notif-tab:hover {
    color: #374151;
}

.notif-tab--active {
    color: #2563eb;
    font-weight: 600;
    border-bottom-color: #2563eb;
}

.notif-tab-badge {
    display: none;
}

/* Rule type badges */

.notif-rule-type-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    margin-right: 6px;
    vertical-align: middle;
    letter-spacing: 0.3px;
}

.notif-rule-type-badge--rule {
    background: #e8f0fe;
    color: var(--modal-brand);
}

.notif-rule-type-badge--slack {
    background: #f3e8ff;
    color: #7c3aed;
}

.notif-rule-type-badge--spec {
    background: #e0f2f1;
    color: #0c356a;
}

/* Add rule dropdown */

.notif-add-rule-wrapper,
.notif-add-dest-wrapper {
    position: relative;
}

/* Shared dropdown panel base: border/shadow/radius/animation/padding */
.notif-dropdown-panel {
    position: fixed;
    background: #fff;
    border: 1px solid rgba(12, 53, 106, 0.12);
    border-radius: 10px;
    box-shadow:
        0 2px 4px rgba(12, 53, 106, 0.06),
        0 8px 24px rgba(12, 53, 106, 0.10);
    z-index: var(--z-modal-confirm);
    padding: 6px;
    animation: notifDropdownIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.notif-add-dropdown {
    min-width: 192px;
    transform-origin: top right;
}

@keyframes notifDropdownIn {
    from { opacity: 0; transform: scale(0.95) translateY(-4px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.notif-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    font: inherit;
    font-size: 13px;
    font-weight: 450;
    line-height: 1.4;
    color: #374151;
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.notif-dropdown-item:hover {
    background: rgba(37, 99, 235, 0.07);
    color: #0c356a;
}

.notif-dropdown-item:active {
    background: rgba(37, 99, 235, 0.13);
}

.notif-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.notif-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.notif-section.notif-destinations-panel {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.notif-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.notif-add-btn {
    font-size: 13px;
    font-weight: 500;
    color: var(--modal-brand);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s ease;
}

.notif-add-btn:hover {
    background: #f0f7ff;
}

.notif-add-rule-link {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #2563eb;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 12px;
    margin-top: 4px;
    text-align: left;
    transition: color 0.15s ease;
}

.notif-add-rule-link:hover {
    color: #0c356a;
}

/* Destination header */

.notif-dest-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.notif-dest-limits {
    font-size: 11px;
    color: #9ca3af;
    white-space: nowrap;
}

/* Destination cards */

.notif-dest-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 6px;
}

.notif-dest-card:last-child {
    margin-bottom: 0;
}

.notif-dest-card-body {
    flex: 1;
    min-width: 0;
}

.notif-dest-card-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
    flex-wrap: wrap;
}

.notif-dest-card-name {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    min-width: 0;
    overflow-wrap: anywhere;
}

.notif-dest-type-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.notif-dest-type-badge--email {
    background: #dbeafe;
    color: #1e40af;
}

.notif-dest-type-badge--slack {
    background: #fef3c7;
    color: #92400e;
}

.notif-dest-type-badge--small {
    font-size: 9px;
    padding: 0 4px;
}

.notif-dest-disabled-badge {
    font-size: 10px;
    font-weight: 500;
    padding: 1px 6px;
    border-radius: 4px;
    background: #f3f4f6;
    color: #9ca3af;
}

.notif-dest-card-detail {
    font-size: 12px;
    color: #6b7280;
    word-break: break-all;
}

.notif-dest-card-actions,
.notif-rule-card-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.notif-rule-card-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.notif-rule-card-actions {
    opacity: 0;
    transition: opacity 0.12s ease;
}

.notif-rule-card:hover .notif-rule-card-actions,
.notif-rule-card--selected .notif-rule-card-actions {
    opacity: 1;
}

.notif-dest-card-actions button,
.notif-rule-card-actions button {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    background: transparent;
}

.notif-dest-edit-btn,
.notif-rule-edit-btn {
    color: var(--modal-brand);
}

.notif-dest-edit-btn:hover,
.notif-rule-edit-btn:hover {
    background: #e8f0fe;
}

.notif-dest-delete-btn,
.notif-rule-delete-btn {
    color: #dc2626;
}

.notif-dest-delete-btn:hover,
.notif-rule-delete-btn:hover {
    background: #fef2f2;
}

.notif-dest-enabled-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

/* Rule cards */

.notif-rule-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: border-color 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

.notif-rule-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.notif-rule-card--selected {
    border-color: var(--modal-brand);
    background: #f0f6ff;
}

.notif-rule-card--selected:hover {
    background: #f0f6ff;
}

.notif-rule-card--disabled {
    background: #f9fafb;
}

.notif-rule-card--disabled .notif-rule-card-title,
.notif-rule-card--disabled .notif-rule-card-detail,
.notif-rule-card--disabled .notif-rule-card-dest,
.notif-rule-card--disabled .notif-rule-card-time,
.notif-rule-card--disabled .notif-rule-card-msg {
    color: #9ca3af;
}

.notif-rule-card:last-child {
    margin-bottom: 0;
}

.notif-rule-card-body {
    flex: 1;
    min-width: 0;
}

.notif-rule-card-badge-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

.notif-rule-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 6px;
    line-height: 1.3;
}

.notif-rule-card-detail {
    font-size: 13px;
    color: #374151;
    word-break: break-word;
    line-height: 1.6;
    margin-bottom: 6px;
}

.notif-rule-disabled-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    color: #6b7280;
    background: #e5e7eb;
    padding: 2px 6px;
    border-radius: 3px;
    line-height: 1.4;
}

.notif-cond-item {
    display: inline;
}

.notif-logic-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    color: var(--modal-brand);
    background: #e8f0fe;
    padding: 1px 5px;
    border-radius: 3px;
    margin: 0 4px;
    vertical-align: middle;
}

.notif-rule-card-dest {
    font-size: 12px;
    color: #6b7280;
    margin-top: 6px;
}

.notif-rule-card-time {
    font-size: 12px;
    color: var(--modal-brand);
    margin-top: 6px;
}

.notif-rule-card-msg {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 6px;
}

/* Rule form */

.notif-form {
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    margin-bottom: 12px;
}

.notif-form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.notif-form-field {
    flex: 1;
    min-width: 0;
}

.notif-form-field--full {
    width: 100%;
    margin-bottom: 12px;
}

.notif-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 12px;
}

.notif-field-error {
    color: #dc2626;
    font-size: 12px;
    font-weight: 400;
    margin-left: 8px;
}

/* Conditions hint row — hint text left, AI button right */

.notif-conditions-hint-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 10px;
}

.notif-conditions-hint-row .notif-ai-generate-btn {
    margin-left: auto;
}

/* Destination empty guidance */

.notif-dest-empty-guide {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
    padding: 10px 12px;
    background: #f9fafb;
    border: 1px dashed #d1d5db;
    border-radius: 6px;
}

.notif-dest-guide-link {
    color: var(--modal-brand);
    text-decoration: none;
    font-weight: 500;
}

.notif-dest-guide-link:hover {
    text-decoration: underline;
}

/* AI prompt generation button */

.notif-ai-generate-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--modal-brand);
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f0fe 100%);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.notif-ai-generate-btn:hover {
    background: linear-gradient(135deg, #e8f0fe 0%, #dbe7f8 100%);
    border-color: rgba(37, 99, 235, 0.35);
}

.notif-ai-prompt-area {
    margin-bottom: 8px;
    padding: 12px;
    background: #f8fafd;
    border: 1px solid rgba(37, 99, 235, 0.12);
    border-radius: 8px;
}

.notif-ai-prompt-area .settings-textarea {
    width: 100%;
    margin-bottom: 8px;
    font-size: 13px;
}

.notif-ai-prompt-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.notif-ai-prompt-action-btn {
    font-size: 12px;
    padding: 5px 12px;
}

.notif-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.notif-select:disabled {
    background-color: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

/* Conditions */

.notif-logic-segmented {
    display: inline-flex;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
}

.notif-logic-seg-btn {
    font-size: 11px;
    font-weight: 500;
    color: #9ca3af;
    background: transparent;
    border: none;
    border-radius: 5px;
    padding: 4px 12px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.notif-logic-seg-btn:hover {
    color: #374151;
}

.notif-logic-seg-btn.is-active {
    background: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(12, 53, 106, 0.08);
}

.notif-logic-seg-btn--and.is-active {
    color: var(--modal-brand);
}

.notif-logic-seg-btn--or.is-active {
    color: #ca8a04;
}

.notif-logic-seg-btn:focus-visible {
    outline: 2px solid var(--modal-brand);
    outline-offset: 2px;
}

.notif-condition-hint {
    font-size: 12px;
    color: #6b7280;
    margin: 0;
    line-height: 1.4;
}

.notif-condition-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.notif-condition-row .notif-cond-column {
    flex: 3;
    min-width: 0;
}

/* Operator native select is hidden (custom dropdown via _notifCreateCustomSelect) */

.notif-condition-row .notif-cond-value-type {
    flex: 0 0 120px;
}

.notif-condition-row .notif-cond-threshold {
    flex: 1;
    min-width: 0;
}

/* Date type hides threshold input (handled by date picker instead) */

/* "が" label between column and value for all types */

.notif-cond-ga-label {
    flex: 0 0 auto;
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
    user-select: none;
    order: 2;
}

/* All types: [Column] が [Value] [Operator] [RemoveBtn] */
.notif-condition-row .notif-cond-column { order: 1; }
.notif-condition-row .notif-cond-threshold { order: 3; }
.notif-condition-row .notif-cond-value-type { order: 3; }
.notif-condition-row .notif-cond-value-param { order: 3; }
.notif-condition-row .notif-date-picker { order: 3; }
.notif-condition-row .notif-date-picker-dropdown { order: 3; }
.notif-condition-row .notif-cond-remove-btn { order: 99; }

/* Custom select trigger/dropdown in condition row (T052) */
.notif-condition-row .notif-custom-select { order: 1; }
.notif-condition-row .notif-custom-select-dropdown { order: 1; }

/* Custom select trigger — base style (full-width variant for form fields) */

.notif-custom-select {
    display: flex;
    align-items: center;
    box-sizing: border-box;
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #111827;
    background: #fff;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.15s;
}

/* Condition row variant — inherits base 40px height (matching .settings-input) */
.notif-condition-row .notif-custom-select {
    flex: 3;
    min-width: 0;
    width: auto;
}

.notif-custom-select:hover {
    border-color: var(--modal-brand);
}

.notif-custom-select:focus-visible {
    border-color: var(--modal-brand);
    box-shadow: 0 0 0 1px var(--modal-brand);
    outline: none;
}

.notif-custom-select--disabled {
    background-color: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

.notif-custom-select--disabled:hover {
    border-color: #d1d5db;
}

.notif-custom-select-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #9ca3af;
}

.notif-custom-select--has-value .notif-custom-select-text {
    color: #111827;
}

.notif-custom-select--disabled .notif-custom-select-text {
    color: #9ca3af;
}

.notif-custom-select-chevron {
    font-size: 9px;
    color: #9ca3af;
    margin-left: 6px;
    flex-shrink: 0;
}

/* Custom select dropdown options — matches date picker option style */

.notif-custom-select-option {
    display: flex;
    align-items: center;
    height: 36px;
    padding: 0 12px;
    border-radius: 6px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    transition: background-color 0.1s;
}

.notif-custom-select-option:hover {
    background-color: rgba(37, 99, 235, 0.07);
    color: #0c356a;
}

.notif-custom-select-option--selected {
    background-color: rgba(37, 99, 235, 0.08);
    color: var(--modal-brand);
    font-weight: 500;
}

.notif-custom-select-option--placeholder {
    color: #9ca3af;
}

/* Custom select dropdown scroll constraint for long option lists */
.notif-custom-select-dropdown {
    max-height: 240px;
    overflow-y: auto;
}

/* Operator custom select — sizing and order within condition row (T053) */

.notif-condition-row .notif-cond-operator-trigger {
    flex: 0 0 124px;
    order: 4;
}

.notif-condition-row .notif-cond-operator-dropdown {
    order: 4;
}

.notif-condition-row[data-category="date"] .notif-cond-operator-trigger {
    flex-basis: 170px;
}

/* Unified date value picker trigger (T047) */

.notif-date-picker {
    flex: 1;
    min-width: 120px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    user-select: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.notif-date-picker:hover {
    border-color: var(--modal-brand);
}

.notif-date-picker:focus-visible {
    border-color: var(--modal-brand);
    box-shadow: 0 0 0 1px var(--modal-brand);
    outline: none;
}

.notif-date-picker-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #9ca3af;
}

.notif-date-picker--has-value .notif-date-picker-text {
    color: #111827;
}

.notif-date-picker-chevron {
    font-size: 9px;
    color: #9ca3af;
    margin-left: 6px;
    flex-shrink: 0;
}

/* Date value picker dropdown panel — inherits .notif-dropdown-panel base */

.notif-date-picker-option {
    display: flex;
    align-items: center;
    height: 36px;
    padding: 0 12px;
    border-radius: 6px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    transition: background-color 0.1s;
}

.notif-date-picker-option:hover {
    background-color: rgba(37, 99, 235, 0.07);
    color: #0c356a;
}

.notif-date-picker-option--selected {
    background-color: rgba(37, 99, 235, 0.08);
    color: var(--modal-brand);
    font-weight: 500;
}

.notif-date-picker-option--param {
    gap: 4px;
}

.notif-date-picker-param-input {
    width: 48px;
    height: 24px;
    padding: 0 6px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    text-align: center;
}

.notif-date-picker-param-input:focus {
    border-color: var(--modal-brand);
    box-shadow: 0 0 0 1px var(--modal-brand);
}

.notif-date-picker-param-suffix {
    font-size: 13px;
    color: inherit;
}

.notif-date-picker-separator {
    height: 1px;
    background: #e5e7eb;
    margin: 4px 8px;
}

.notif-date-picker-free-input {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
}

.notif-date-picker-date-input {
    flex: 1;
    height: 28px;
    padding: 0 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    min-width: 0;
}

.notif-date-picker-date-input:focus {
    border-color: var(--modal-brand);
    box-shadow: 0 0 0 1px var(--modal-brand);
}

.notif-date-picker-date-input--error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 1px #ef4444 !important;
}

.notif-date-picker-apply {
    height: 28px;
    padding: 0 10px;
    background-color: var(--modal-brand);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.notif-date-picker-apply:hover {
    background-color: #0c356a;
}

.notif-condition-row .notif-cond-value-param {
    flex: 0 0 60px;
}

.notif-cond-remove-btn {
    flex: 0 0 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #9ca3af;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.notif-cond-remove-btn:hover {
    color: #dc2626;
    background: #fef2f2;
    border-color: #fecaca;
}

/* Condition Groups (nested) */

.notif-condition-group {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    background: #ffffff;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.notif-condition-group[data-logic="AND"] {
    background: #f5f9ff;
    border-color: #dbeafe;
}

.notif-condition-group[data-logic="OR"] {
    background: #fefce8;
    border-color: #fde68a;
}

.notif-condition-group--nested[data-logic="AND"] {
    border-left: 3px solid var(--modal-brand);
}

.notif-condition-group--nested[data-logic="OR"] {
    border-left: 3px solid #ca8a04;
}

.notif-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.notif-group-remove-btn {
    flex: 0 0 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #9ca3af;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.notif-group-remove-btn:hover {
    color: #dc2626;
    background: #fef2f2;
    border-color: #fecaca;
}

.notif-group-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.notif-add-condition-btn {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    background: none;
    border: 1px dashed #d1d5db;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    flex: 1;
    transition: all 0.15s ease;
}

.notif-add-condition-btn:hover {
    color: var(--modal-brand);
    border-color: var(--modal-brand);
    background: #f0f7ff;
}

.notif-add-group-btn {
    font-size: 12px;
    font-weight: 500;
    color: var(--modal-brand);
    background: none;
    border: 1px dashed #bfdbfe;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    flex: 1;
    transition: all 0.15s ease;
}

.notif-add-group-btn:hover {
    color: #0c356a;
    border-color: var(--modal-brand);
    background: #e8f0fe;
}

/* Destination checkboxes in rule form */

.notif-dest-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.notif-dest-checkbox-label {
    display: flex;
    align-items: center;
    align-self: flex-start;
    gap: 8px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    padding: 4px 0;
}

.notif-dest-checkbox {
    accent-color: var(--modal-brand);
    width: 15px;
    height: 15px;
    cursor: pointer;
}

.notif-test-send-area {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.notif-test-send-btn {
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid var(--modal-brand);
    background: transparent;
    color: var(--modal-brand);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.notif-test-send-btn:hover {
    background: rgba(37, 99, 235, 0.07);
}

.notif-test-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.notif-test-msg {
    font-size: 12px;
    line-height: 1.4;
    transition: color 0.15s ease;
    overflow-wrap: anywhere;
}

.notif-test-msg--success {
    color: #15803d;
}

.notif-test-msg--error {
    color: #dc2626;
}

.notif-test-msg--warn {
    color: #b45309;
}

/* Button loading spinner */

.notif-btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
    opacity: 0.7;
}

/* Structured test result */

.notif-test-result {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.notif-test-result-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.notif-test-result-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    line-height: 1.4;
}

.notif-test-result-icon {
    font-weight: 700;
    flex-shrink: 0;
}

.notif-test-result-icon--success {
    color: #15803d;
}

.notif-test-result-icon--error {
    color: #dc2626;
}

.notif-test-result-error {
    color: #dc2626;
    font-size: 11px;
}

.notif-test-eval {
    font-size: 11px;
    font-weight: 500;
    margin-top: 2px;
}

.notif-test-eval[data-tone="success"] {
    color: #15803d;
}

.notif-test-eval[data-tone="warn"] {
    color: #b45309;
}

.notif-test-eval[data-tone="muted"] {
    color: #9ca3af;
}

/* Destination limit reached indicator */

.notif-dest-limit-item[data-full="true"] {
    color: #dc2626;
    font-weight: 600;
}

/* Empty state text */

.notif-empty-text {
    font-size: 13px;
    color: #9ca3af;
    text-align: center;
    padding: 12px 0;
}

.notif-empty-hint {
    font-size: 12px;
    color: #6b7280;
    text-align: center;
    padding: 10px 12px;
    border: 1px dashed #dbe2ea;
    border-radius: 10px;
    background: #f8fafc;
}

.notif-empty-hint--spacious {
    padding-top: 96px;
}


/* --- モーダルアニメーション --- */

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* リッチテキスト本文のスタイル（proseクラス） */
.prose {
    color: #374151;
    line-height: 1.75;
}

.prose h1, .prose h2, .prose h3, .prose h4 {
    color: #1f2937;
    font-weight: 600;
    margin-top: 1.5em;
    margin-bottom: 0.75em;
}

.prose h1 { font-size: 1.5em; }
.prose h2 { font-size: 1.25em; }
.prose h3 { font-size: 1.125em; }
.prose h4 { font-size: 1em; }

.prose p {
    margin-top: 0.75em;
    margin-bottom: 0.75em;
}

.prose a {
    color: #2563eb;
    text-decoration: underline;
}

.prose a:hover {
    color: #1d4ed8;
}

.prose ul, .prose ol {
    margin-top: 0.75em;
    margin-bottom: 0.75em;
    padding-left: 1.5em;
}

.prose li {
    margin-top: 0.25em;
    margin-bottom: 0.25em;
}

.prose code {
    background-color: #f3f4f6;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.875em;
    font-family: 'Courier New', monospace;
}

.prose pre {
    background-color: #1f2937;
    color: #f9fafb;
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin-top: 1em;
    margin-bottom: 1em;
}

.prose pre code {
    background-color: transparent;
    padding: 0;
    color: inherit;
}

.prose blockquote {
    border-left: 4px solid #d1d5db;
    padding-left: 1em;
    margin-left: 0;
    font-style: italic;
    color: #6b7280;
}

.prose hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin-top: 2em;
    margin-bottom: 2em;
}

.prose img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 0.75em 0;
}

/* === 成功トースト通知 === */
/* === 通知バナー（統一） === */
.morning-notification-banner {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-toast);
    background: #ffffff;
    color: #374151;
    padding: 10px 16px;
    border: 1px solid #bbf7d0; /* green-200 */
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: fit-content;
    max-width: 90vw;
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

.morning-notification-banner.success {
    border: 1px solid #bbf7d0; /* green-200 */
}

.morning-notification-banner.error {
    border: 1px solid #fecaca; /* red-200 */
}

.morning-notification-banner.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(-10px);
}

.morning-notification-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.morning-notification-icon {
    width: 20px;
    height: 20px;
    background-color: #22c55e; /* green-500 */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
}

.morning-notification-banner.success .morning-notification-icon {
    background-color: #22c55e; /* green-500 */
}

.morning-notification-banner.error .morning-notification-icon {
    background-color: #ef4444; /* red-500 */
}

.morning-notification-icon svg {
    width: 14px;
    height: 14px;
    stroke-width: 3px;
}

.morning-notification-text {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
}

.morning-notification-close {
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-left: 4px;
}

.morning-notification-close:hover {
    background-color: #f3f4f6;
    color: #6b7280;
}

/* gray バナー（カラム未選択時・情報表示用） */
.morning-notification-banner.gray {
    border: 1px solid #e5e7eb; /* gray-200 */
}

.morning-notification-banner.gray .morning-notification-icon {
    background-color: #9ca3af; /* gray-400 */
}

/* info バナー（先頭空行スキップ等の情報通知用） */
.morning-notification-banner.info {
    border: 1px solid #93c5fd;
    background-color: #eff6ff;
}

.morning-notification-banner.info .morning-notification-icon {
    background-color: #2563eb;
}

/* warning バナー（バリデーション/制約エラー用） */
.morning-notification-banner.warning {
    border: 1px solid #fde68a;
    background-color: #fffbeb;
}

.morning-notification-banner.warning .morning-notification-icon {
    background-color: #f59e0b;
}

/* === 単位ドロップダウンメニュー === */
.unit-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 50;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 150px;
    margin-top: 4px;
    padding: 4px 0;
}

.unit-dropdown-portal {
    position: fixed;
    z-index: 2100;
    margin-top: 0;
}

.unit-dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.unit-dropdown-item:hover {
    background-color: #f3f4f6;
}

/* K/M サブメニュー */
.unit-submenu {
    position: absolute;
    top: 0;
    left: calc(100% - 1px);
    z-index: 51;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 100px;
    padding: 4px 0;
}

.unit-submenu .unit-dropdown-item {
    padding: 8px 12px;
}

/* フリー単位入力コンテナ */
.unit-custom-input-container {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-top: 1px solid #e5e7eb;
    margin-top: 4px;
}

.unit-custom-input {
    width: 80px;
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
}

.unit-custom-input:focus {
    border-color: #1465a3;
    box-shadow: 0 0 0 2px rgba(20, 101, 163, 0.1);
}

.unit-custom-apply-btn {
    padding: 4px 10px;
    background-color: #1465a3;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.2s;
}

.unit-custom-apply-btn:hover {
    background-color: #0c356a;
}

/* ===== 値表示ドロップダウンメニュー ===== */
.value-display-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 50;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 170px;
    padding: 4px 0;
    margin-top: 4px;
}

.value-display-dropdown-portal {
    position: fixed;
    z-index: 2100;
    margin-top: 0;
}

.value-display-dropdown-item {
    padding: 7px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #374151;
    transition: background-color 0.15s ease;
    white-space: nowrap;
}

.value-display-dropdown-item:hover {
    background-color: #f3f4f6;
}

.value-display-dropdown-divider {
    height: 1px;
    background-color: #e5e7eb;
    margin: 4px 0;
}

.value-display-has-submenu {
    position: relative;
}

.value-display-submenu {
    position: absolute;
    top: 0;
    left: calc(100% - 1px);
    z-index: 51;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 140px;
    padding: 4px 0;
}

.value-display-submenu .value-display-dropdown-item {
    padding: 6px 10px;
}

/* ===== しきい値セクション ===== */
.value-display-threshold-section {
    padding: 4px 0;
}

.value-display-threshold-title {
    padding: 4px 12px 2px;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    user-select: none;
}

.value-display-threshold-current {
    padding: 2px 12px 4px;
    font-size: 11px;
    color: #9ca3af;
}

.value-display-threshold-input-row {
    padding: 0 8px;
}

.value-display-threshold-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 4px;
}

.value-display-threshold-input {
    flex: 1;
    height: 28px;
    padding: 0 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    min-width: 0;
}

.value-display-threshold-input:focus {
    border-color: #1465a3;
    box-shadow: 0 0 0 1px #1465a3;
}

.value-display-threshold-apply-btn {
    height: 28px;
    padding: 0 10px;
    background-color: #1465a3;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.value-display-threshold-apply-btn:hover {
    background-color: #0c356a;
}

.value-display-threshold-clear {
    color: #9ca3af;
    font-size: 11px;
    padding: 5px 12px;
    cursor: pointer;
}

.value-display-threshold-clear:hover {
    background-color: #f3f4f6;
    color: #ef4444;
}

.value-display-threshold-note {
    padding: 6px 12px;
    font-size: 11px;
    color: #9ca3af;
    user-select: none;
}

.value-display-threshold-help {
    padding: 2px 12px 4px;
    font-size: 10px;
    color: #c0c4cc;
    user-select: none;
}

/* Type Conversion Dropdown Styles */
.type-conversion-dropdown-menu {
    position: fixed;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 4px 0;
    min-width: 160px;
    z-index: 2200;
}

.type-conversion-dropdown-menu.hidden {
    display: none;
}

.type-conversion-dropdown-item {
    display: flex;
    align-items: center;
    padding: 6px 16px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.type-conversion-dropdown-item:hover {
    background-color: #f3f4f6;
}

.type-conversion-dropdown-divider {
    height: 1px;
    background-color: #f3f4f6;
    margin: 4px 0;
}

/* Submenu Styles */
.type-conversion-has-submenu {
    position: relative;
}

.type-conversion-submenu {
    position: absolute;
    top: 0;
    left: 100%;
    margin-left: 4px;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 4px 0;
    min-width: 180px;
    z-index: 51;
}

/* ===== 小数点桁数ドロップダウンメニュー ===== */
.decimal-places-dropdown-menu {
    position: fixed;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 4px 0;
    min-width: 200px;
    z-index: 2200;
}

.decimal-places-dropdown-menu.hidden {
    display: none;
}

.decimal-places-dropdown-item {
    display: flex;
    align-items: center;
    padding: 6px 16px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.decimal-places-dropdown-item:hover {
    background-color: #f3f4f6;
}

.decimal-places-dropdown-divider {
    height: 1px;
    background-color: #f3f4f6;
    margin: 4px 0;
}

.decimal-places-input-container {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
}

.decimal-places-input {
    width: 140px;
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
}

.decimal-places-input:focus {
    border-color: #1465a3;
    box-shadow: 0 0 0 2px rgba(20, 101, 163, 0.1);
}

.decimal-places-input::-webkit-outer-spin-button,
.decimal-places-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.decimal-places-input[type=number] {
    -moz-appearance: textfield;
}

.decimal-places-apply-btn {
    padding: 4px 10px;
    background-color: #1465a3;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.2s;
}

.decimal-places-apply-btn:hover {
    background-color: #0c356a;
}

/* === 自動更新セクション === */
#manual-refresh-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#manual-refresh-btn .animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}


/* ============================================================
   サブスクリプション管理モーダル
   ============================================================ */

/* --- モーダルヘッダー --- */
/* --- サブスクリプションモーダル パネル --- */
.subscription-panel {
    width: min(740px, calc(100vw - 32px));
    max-height: min(90vh, calc(100vh - 48px));
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 14px;
    box-shadow: 0 24px 48px rgba(12, 53, 106, 0.12), 0 0 1px rgba(0, 0, 0, 0.03);
}

.subscription-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px 16px;
}

.subscription-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #0c356a;
    letter-spacing: -0.01em;
}

.subscription-modal-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: #9ca3af;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.subscription-modal-close-btn:hover {
    background: #f3f4f6;
    color: #4b5563;
}

.subscription-modal-body {
    padding: 4px 28px 8px;
    overflow-y: auto;
}

.subscription-error {
    margin-bottom: 16px;
    padding: 10px 14px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    font-size: 13px;
    color: #b91c1c;
}

.subscription-toggle-wrap {
    display: flex;
    justify-content: center;
    padding: 20px 0 4px;
}

/* --- 課金サイクルトグル --- */
.billing-toggle {
    display: inline-flex;
    background: #f3f4f6;
    border-radius: 999px;
    padding: 4px;
    gap: 2px;
}

.billing-toggle-btn {
    position: relative;
    padding: 7px 20px;
    font-size: 13px;
    font-weight: 500;
    color: #9ca3af;
    border-radius: 999px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.billing-toggle-btn:hover {
    color: #374151;
}

.billing-toggle-active {
    background: #ffffff;
    color: #2563eb;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(12, 53, 106, 0.08);
}

.billing-toggle-discount {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    color: #059669;
    background: #ecfdf5;
    padding: 2px 6px;
    border-radius: 999px;
    letter-spacing: 0.01em;
}

/* --- プランカードグリッド --- */
.plan-cards-grid {
    display: flex;
    gap: 14px;
    padding: 24px 0 8px;
}

/* --- プランカード --- */
.plan-card {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-width: 0;
    background: #ffffff;
    border-radius: 14px;
    padding: 24px 18px 20px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.plan-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

/* 現在のプラン — 青系 */
.plan-card-current {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03), 0 8px 32px rgba(12, 53, 106, 0.10);
    padding: 32px 22px 24px;
}

.plan-card-current:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03), 0 8px 32px rgba(12, 53, 106, 0.14);
}

/* Proカード背景 */
.plan-card[data-plan="pro"] {
    background: #fafbfc;
}

/* --- カードヘッダー --- */
.plan-card-header {
    text-align: center;
    margin-bottom: 20px;
}

.plan-card-name-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 10px;
}

.plan-card-name {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin: 0;
    letter-spacing: -0.01em;
}

.plan-card-current .plan-card-name {
    font-size: 15px;
    font-weight: 700;
    color: #0c356a;
}

/* おすすめラベル — インラインpill */
.plan-recommended-label {
    display: inline-flex;
    align-items: center;
    padding: 4px 14px;
    border-radius: 999px;
    background: #2563eb;
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

/* 現在バッジ — プラン名横 */
.plan-current-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
    color: #2563eb;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}

.plan-card-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 1px;
}

.plan-price-amount {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.02em;
    line-height: 1;
}

.plan-card-current .plan-price-amount {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.plan-price-period {
    font-size: 13px;
    font-weight: 400;
    color: #9ca3af;
}

.plan-savings-badge {
    display: inline-block;
    margin-top: 8px;
    font-size: 11px;
    font-weight: 600;
    color: #059669;
    background: #ecfdf5;
    padding: 3px 10px;
    border-radius: 999px;
}

.plan-monthly-equiv {
    margin-top: 4px;
    font-size: 12px;
    color: #9ca3af;
}

/* --- Feature intro テキスト --- */
.plan-feature-intro {
    font-size: 11px;
    color: #9ca3af;
    margin: 0 0 8px;
}

/* --- 機能リスト --- */
.plan-card-features {
    flex: 1;
    margin-bottom: 16px;
}

.plan-card-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.plan-card-features li {
    font-size: 12px;
    color: #4b5563;
    padding-left: 24px;
    position: relative;
    line-height: 1.5;
}

.plan-card-current .plan-card-features li {
    font-size: 13px;
    color: #374151;
}

.plan-card-features li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 3px;
    width: 16px;
    height: 16px;
    background-color: #f3f4f6;
    border-radius: 8px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%239ca3af'%3E%3Cpath fill-rule='evenodd' d='M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-size: 10px;
    background-repeat: no-repeat;
    background-position: center;
}

/* 現在プランのチェックマーク — 青 */
.plan-card-current .plan-card-features li::before {
    background-color: rgba(37, 99, 235, 0.1);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%232563eb'%3E%3Cpath fill-rule='evenodd' d='M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z' clip-rule='evenodd'/%3E%3C/svg%3E");
}

/* --- アクションボタン --- */
.plan-card-action {
    margin-top: auto;
}

.plan-btn {
    display: block;
    width: 100%;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    border: 1.5px solid #e2e5ea;
    border-radius: 10px;
    background: transparent;
    color: #0c356a;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.plan-btn:disabled {
    cursor: default;
}

.plan-btn-current {
    background: rgba(37, 99, 235, 0.06);
    color: #2563eb;
    border-color: rgba(37, 99, 235, 0.2);
}

.plan-btn-select,
.plan-btn-upgrade {
    background: transparent;
    color: #0c356a;
    border-color: #e2e5ea;
}

.plan-btn-select:hover,
.plan-btn-upgrade:hover {
    background: #f8f9fa;
    border-color: #d1d5db;
}

.plan-btn-downgrade {
    background: transparent;
    color: #0c356a;
    border-color: #e2e5ea;
}

.plan-btn-downgrade:hover {
    background: #f8f9fa;
    border-color: #d1d5db;
}

/* --- サブスクリプション フッター --- */
.subscription-modal-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px 32px 24px;
}

.subscription-renewal-date {
    font-size: 12px;
    color: #9ca3af;
}

.subscription-footer-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.subscription-footer-link {
    font-size: 12px;
    color: #9ca3af;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s ease;
}

.subscription-footer-link:hover {
    color: #374151;
}

.subscription-footer-link--cancel:hover {
    color: #dc2626;
}

.subscription-footer-link:disabled {
    cursor: default;
    opacity: 0.6;
}

/* --- 解約確認モーダル --- */
.cancel-confirm-panel {
    width: min(420px, calc(100vw - 32px));
    padding: 28px 32px 24px;
    border-radius: 14px;
}

.cancel-confirm-title {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1f;
}

.cancel-confirm-desc {
    margin: 0 0 20px;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.6;
}

.cancel-confirm-form {
    margin-bottom: 20px;
}

.cancel-confirm-label {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 6px;
}

.cancel-confirm-select {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    color: #374151;
    outline: none;
    transition: border-color 0.2s ease;
}

.cancel-confirm-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.cancel-confirm-textarea {
    width: 100%;
    margin-top: 12px;
    padding: 8px 12px;
    font-size: 13px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    color: #374151;
    outline: none;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.cancel-confirm-textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.cancel-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.cancel-confirm-btn-secondary {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.cancel-confirm-btn-secondary:hover {
    color: #374151;
}

.cancel-confirm-btn-danger {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    background: #dc2626;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cancel-confirm-btn-danger:hover {
    background: #b91c1c;
}

/* --- トリガーボタン（プロフィールモーダル内） --- */
.plan-trigger-trial {
    background: linear-gradient(135deg, var(--modal-brand) 0%, #0c356a 100%);
    color: #ffffff;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.plan-trigger-trial::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    animation: shimmer 3s ease-in-out infinite;
}

.plan-trigger-trial:hover {
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}

@keyframes shimmer {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

/* --- Checkout成功トースト --- */

/* ──────────────────────────────────
   Undo / Redo buttons
   ────────────────────────────────── */
.undo-redo-group {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 4px;
}

.undo-redo-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #4b5563;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    outline: none;
}

.undo-redo-btn:hover:not(:disabled) {
    background: #e5e7eb;
    color: #1f2937;
}

.undo-redo-btn:active:not(:disabled) {
    background: #d1d5db;
}

.undo-redo-btn:focus-visible {
    box-shadow: 0 0 0 2px #1465a3;
}

.undo-redo-btn:disabled {
    color: #d1d5db;
    cursor: default;
    pointer-events: none;
}

/* DEV: テンプレート作成ボタン（開発用・将来削除） */
.template-download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px dashed #9ca3af;
    border-radius: 6px;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    outline: none;
}

.template-download-btn:hover {
    background: #eff6ff;
    color: #1465a3;
    border-color: #1465a3;
}

.template-download-btn:active {
    background: #dbeafe;
}

.template-download-btn:focus-visible {
    box-shadow: 0 0 0 2px #1465a3;
}
/* /DEV: テンプレート作成ボタン */

/* テンプレート適用モーダル — Scandinavian Design */
.template-modal-container {
    background: #fff;
    border-radius: var(--modal-panel-radius);
    box-shadow: var(--modal-panel-shadow);
    width: 520px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.template-modal-header {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #ebebeb;
}

.template-modal-body {
    padding: 28px 28px 20px;
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.template-target-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.template-tab-select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 13px;
    color: #374151;
    background: #fafafa;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    appearance: auto;
}

.template-tab-select:focus {
    border-color: var(--modal-brand);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.template-cards-area {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.template-card {
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    background: #fafafa;
}

.template-card:hover {
    border-color: #93c5fd;
    background: #f8faff;
}

.template-card.selected {
    border-color: var(--modal-brand);
    background: #f0f7ff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.template-card-body {
    flex: 1;
    min-width: 0;
}

.template-card-name {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.template-card-desc {
    font-size: 12.5px;
    color: #6b7280;
    margin-bottom: 12px;
    line-height: 1.5;
}

.template-card-category {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    color: var(--modal-brand);
    background: rgba(37, 99, 235, 0.08);
    padding: 3px 10px;
    border-radius: 20px;
}

.template-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.template-card-tag {
    font-size: 11px;
    color: #6b7280;
    background: #f3f4f6;
    padding: 3px 8px;
    border-radius: 6px;
}

.template-modal-footer {
    padding: 16px 28px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #f0f0f0;
}

.template-btn-primary {
    padding: 10px 22px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: var(--modal-brand);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.template-btn-primary:hover:not(:disabled) {
    background: #1d4ed8;
}

.template-btn-primary:active:not(:disabled) {
    transform: scale(0.98);
}

.template-btn-primary:disabled {
    opacity: 0.4;
    cursor: default;
}

.template-btn-secondary {
    padding: 10px 22px;
    font-size: 13px;
    font-weight: 500;
    color: #4b5563;
    background: transparent;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.template-btn-secondary:hover:not(:disabled) {
    background: #f9fafb;
    border-color: #9ca3af;
}

.template-btn-secondary:disabled {
    opacity: 0.4;
    cursor: default;
}

.template-error-box {
    padding: 12px 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: #991b1b;
    font-size: 12.5px;
    line-height: 1.5;
}

/* === 運営メッセージモーダル === */
.admin-message-panel {
    width: min(700px, 100%);
    max-height: min(500px, calc(100vh - 48px));
}

.admin-message-header {
    padding: 28px 32px 18px;
}

.admin-message-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.admin-message-heading-group,
.admin-message-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-message-heading {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    color: #1a1a1f;
}

.admin-message-priority {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 24px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
}

.admin-message-priority--critical {
    background: #db2626;
    color: #ffffff;
}

.admin-message-priority--high {
    background: #fff7ed;
    color: #b2731a;
}

.admin-message-count {
    font-size: 13px;
    font-weight: 500;
    color: #808080;
}

.admin-message-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: #999999;
    font-size: 22px;
    line-height: 1;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.admin-message-close-btn:hover {
    background: #f3f4f6;
    color: #4b5563;
}

.admin-message-panel-divider {
    height: 1px;
    background: #ebebeb;
}

.admin-message-content {
    padding: 18px 32px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
}

.admin-message-date {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    background: #edf2ff;
    color: #2663eb;
    font-size: 11px;
    font-weight: 500;
}

.admin-message-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    color: #1a1a1f;
}

.admin-message-body-wrap {
    min-height: 200px;
    max-height: 260px;
    overflow: auto;
    padding: 16px;
    border-radius: 8px;
    background: #fafafc;
}

.admin-message-body {
    color: #404040;
    font-size: 14px;
    line-height: 1.7;
}

.admin-message-body > *:first-child {
    margin-top: 0;
}

.admin-message-body > *:last-child {
    margin-bottom: 0;
}

.admin-message-body h1,
.admin-message-body h2,
.admin-message-body h3 {
    color: #1f2937;
    line-height: 1.5;
}

.admin-message-body ul,
.admin-message-body ol {
    padding-left: 1.2em;
}

.admin-message-body img,
.admin-message-body table {
    max-width: 100%;
}

.admin-message-body table {
    width: 100%;
    border-collapse: collapse;
}

.admin-message-body th,
.admin-message-body td {
    padding: 8px 10px;
    border: 1px solid #e5e7eb;
}

.admin-message-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 32px 16px;
    border-top: 1px solid #ebebeb;
}

.admin-message-dismiss-type {
    font-size: 10px;
    color: #b3b3b3;
    letter-spacing: 0.02em;
    text-transform: lowercase;
}

.admin-message-ok-btn {
    min-width: 80px;
    padding: 0 20px;
    background: #2563eb;
    color: #ffffff;
    border: none;
}

.admin-message-ok-btn:hover {
    background: #1f55ca;
}

/* =============================================
   自動保存インジケーター
   ============================================= */
.save-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    transition: opacity 0.3s ease;
    user-select: none;
    pointer-events: none;
}

.save-indicator--hidden {
    opacity: 0;
}

/* 保存中: 灰色チェック */
.save-indicator--saving {
    opacity: 1;
    color: #9ca3af;
}

/* 保存済み: 緑チェック（朝の更新通知 .morning-notification-icon と同じ green-500） */
.save-indicator--saved {
    opacity: 1;
    color: #22c55e;
}

/* 消去フェード中は緑を維持（--hidden だけにすると color が親へ戻り、opacity アニメ中に変な色になる） */
.save-indicator--saved.save-indicator--hidden {
    opacity: 0;
    color: #22c55e;
}
/* /自動保存インジケーター */

/* ===================================================================
   DS Calendar — カスタム日付ピッカー (design-system.md 準拠)
   =================================================================== */

/* --- コンテナ --- */
.ds-cal {
    position: relative;
    width: 100%;
}

/* --- トリガー（入力フィールド風ボタン） --- */
.ds-cal-trigger {
    display: flex;
    align-items: center;
    width: 100%;
    height: 38px;
    padding: 0 10px;
    background: #fff;
    border: 1px solid #d7e0e7;
    border-radius: 9px;
    font-size: 12px;
    color: #24364a;
    cursor: pointer;
    transition: border-color 150ms ease, box-shadow 150ms ease;
    box-sizing: border-box;
}

.ds-cal-trigger:hover {
    border-color: #1465a3;
}

.ds-cal-trigger:focus-visible {
    outline: none;
    border-color: #1465a3;
    box-shadow: 0 0 0 3px rgba(20, 101, 163, 0.10);
}

.ds-cal-trigger-text {
    flex: 1;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 400;
    line-height: 1.4;
}

.ds-cal-trigger-text--placeholder {
    color: #9ca3af;
}

.ds-cal-trigger-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-left: 8px;
    color: #6f8294;
    transition: color 150ms ease;
}

.ds-cal-trigger:hover .ds-cal-trigger-icon {
    color: #1465a3;
}

/* --- ドロップダウン --- */
.ds-cal-dropdown {
    display: none;
    position: fixed;
    z-index: 99999;
    width: 280px;
    max-width: calc(100vw - 24px);
    background: #ffffff;
    border: 1px solid rgba(212, 220, 228, 0.95);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(12, 53, 106, 0.14), 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 14px;
    box-sizing: border-box;
}

.ds-cal-dropdown--open {
    display: block;
    animation: ds-cal-fade-in 150ms ease-out;
}

@keyframes ds-cal-fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --- ヘッダー（月年ナビゲーション） --- */
.ds-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.ds-cal-header-label {
    font-size: 14px;
    font-weight: 700;
    color: #0c356a;
    user-select: none;
}

.ds-cal-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #6f8294;
    cursor: pointer;
    transition: background-color 150ms ease, color 150ms ease;
}

.ds-cal-nav-btn:hover {
    background: rgba(20, 101, 163, 0.08);
    color: #1465a3;
}

.ds-cal-nav-btn svg {
    width: 14px;
    height: 14px;
}

/* --- カレンダーグリッド --- */
.ds-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

/* --- 曜日ラベル --- */
.ds-cal-dow {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    font-size: 11px;
    font-weight: 600;
    color: #7b8b9b;
    user-select: none;
}

/* --- 日セル --- */
.ds-cal-day {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    font-size: 12px;
    font-weight: 500;
    color: #24364a;
    border: none;
    background: transparent;
    padding: 0;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 150ms ease, color 150ms ease;
    user-select: none;
}

.ds-cal-day:not(.ds-cal-day--blank):not(.ds-cal-day--disabled):not(.ds-cal-day--selected):hover {
    background: rgba(20, 101, 163, 0.06);
    color: #1465a3;
}

.ds-cal-day--blank {
    cursor: default;
}

.ds-cal-day--today {
    border: 1.5px solid #1465a3;
    color: #1465a3;
    font-weight: 700;
}

.ds-cal-day--selected {
    background: #1465a3;
    color: #fff;
    font-weight: 700;
}

.ds-cal-day--selected.ds-cal-day--today {
    border-color: #1465a3;
}

.ds-cal-day--disabled {
    color: #c8d2dc;
    cursor: not-allowed;
}

@media (prefers-reduced-motion: reduce) {
    .ds-cal-dropdown--open { animation: none; }
    .ds-cal-trigger,
    .ds-cal-day,
    .ds-cal-nav-btn,
    .ds-cal-trigger-icon { transition: none; }
}
