/* ===================================
   仮想通貨トレードシミュレーター
   スタイルシート
=================================== */

/* --- リセットと基本設定 --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* カラーパレット - ライトモード */
    --bg-primary: #ffffff;
    --bg-secondary: #f6f8fa;
    --bg-card: #ffffff;
    --bg-hover: #f3f4f6;

    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;

    --accent-blue: #2563eb;
    --accent-green: #16a34a;
    --accent-red: #dc2626;
    --accent-yellow: #ca8a04;
    --accent-purple: #7c3aed;

    --border-color: #e5e7eb;

    /* グラデーション */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-green: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --gradient-red: linear-gradient(135deg, #cb2d3e 0%, #ef473a 100%);

    /* シャドウ */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);

    /* アニメーション */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
}

/* ダークモード */
body.dark-mode {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-card: #21262d;
    --bg-hover: #30363d;

    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;

    --accent-blue: #58a6ff;
    --accent-green: #3fb950;
    --accent-red: #f85149;
    --accent-yellow: #d29922;
    --accent-purple: #a371f7;

    --border-color: #30363d;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
}

body {
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* --- アプリコンテナ --- */
.app-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* --- ヘッダー --- */
.header {
    text-align: center;
    padding: 30px 0;
    margin-bottom: 20px;
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* --- ダークモードトグル --- */
.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

.header {
    position: relative;
}

/* --- 注意文バナー --- */
.notice-banner {
    background: rgba(210, 153, 34, 0.15);
    border: 1px solid rgba(210, 153, 34, 0.4);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 20px;
    color: var(--accent-yellow);
    font-size: 0.9rem;
    text-align: center;
}

/* チャート内の注意文 */
.chart-notice {
    color: var(--accent-yellow);
    font-size: 0.8rem;
    text-align: center;
    padding: 8px;
    margin-bottom: 8px;
    opacity: 0.8;
}


/* --- 残高セクション --- */
.balance-section {
    margin-bottom: 25px;
}

.balance-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 15px;
}

.balance-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.balance-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.balance-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.balance-value.positive {
    color: var(--accent-green);
}

.balance-value.negative {
    color: var(--accent-red);
}

.reset-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.reset-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* --- チャートセクション --- */
.chart-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 25px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.chart-coin-selector select {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 16px;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    min-width: 180px;
}

.chart-coin-selector select:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.chart-sort-selector select {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    min-width: 130px;
}

.chart-sort-selector select:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.chart-trade-buttons {
    display: flex;
    gap: 10px;
}

.chart-buy-btn,
.chart-sell-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.chart-buy-btn {
    background: var(--accent-green);
    color: white;
}

.chart-buy-btn:hover {
    background: #2ea043;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.chart-sell-btn {
    background: var(--accent-red);
    color: white;
}

.chart-sell-btn:hover {
    background: #da3633;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.chart-period-selector {
    display: flex;
    gap: 8px;
}

.period-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 16px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.period-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.period-btn.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

.chart-container {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    height: 300px;
    position: relative;
}

.chart-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
}

.stat-item {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
}

.stat-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.stat-value.positive {
    color: var(--accent-green);
}

.stat-value.negative {
    color: var(--accent-red);
}

/* --- 通貨追加セクション --- */
.add-currency-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 25px;
}

.add-currency-section h2 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.search-container {
    display: flex;
    gap: 10px;
}

.search-container input {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition-fast);
}

.search-container input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2);
}

.search-container input::placeholder {
    color: var(--text-muted);
}

.search-btn {
    background: var(--gradient-primary);
    border: none;
    border-radius: 10px;
    padding: 12px 24px;
    color: white;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.search-results {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.search-result-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: var(--transition-fast);
}

.search-result-item:hover {
    background: var(--bg-hover);
    border-color: var(--accent-blue);
}

.search-result-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-result-info img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.search-result-name {
    font-weight: 500;
}

.search-result-symbol {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
}

.add-btn {
    background: var(--accent-green);
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    color: white;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.add-btn:hover {
    transform: scale(1.05);
}

/* --- 価格セクション --- */
.prices-section {
    margin-bottom: 25px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-header h2 {
    font-size: 1.2rem;
    color: var(--text-primary);
}

.last-update {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.price-list-notice {
    color: var(--accent-yellow);
    font-size: 0.75rem;
    opacity: 0.9;
}

.filter-container {
    margin-bottom: 15px;
}

.search-row {
    display: flex;
    gap: 10px;
}

.search-row input {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition-fast);
}

.search-row input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2);
}

.search-row input::placeholder {
    color: var(--text-muted);
}

.api-search-btn {
    background: var(--accent-purple);
    border: none;
    border-radius: 10px;
    padding: 12px 20px;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.api-search-btn:hover {
    background: #8b5cf6;
    transform: translateY(-1px);
}

.sort-row {
    margin-top: 10px;
}

.price-list-sort {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    min-width: 160px;
}

.api-search-results {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.api-result-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition-fast);
}

.api-result-item:hover {
    border-color: var(--accent-purple);
}

.api-result-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.api-result-info img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.api-result-name {
    font-weight: 500;
}

.api-result-symbol {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    margin-left: 8px;
}

.api-result-actions {
    display: flex;
    gap: 8px;
}

.api-buy-btn,
.api-sell-btn {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.api-buy-btn {
    background: var(--accent-green);
    color: white;
}

.api-sell-btn {
    background: var(--accent-red);
    color: white;
}

.prices-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.price-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: var(--transition-fast);
}

.price-card:hover {
    background: var(--bg-card);
    border-color: var(--accent-blue);
    transform: translateX(4px);
}

.coin-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.coin-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.coin-details h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 2px;
    color: var(--text-primary);
}

.coin-symbol {
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
}

.coin-center {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    min-width: 180px;
}

.coin-price {
    font-size: 1.1rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    min-width: 130px;
    text-align: right;
    color: var(--text-primary);
}

.coin-change {
    font-size: 0.85rem;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 500;
    min-width: 75px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.coin-change.positive {
    background: rgba(63, 185, 80, 0.15);
    color: var(--accent-green);
}

.coin-change.negative {
    background: rgba(248, 81, 73, 0.15);
    color: var(--accent-red);
}

.coin-actions {
    display: flex;
    gap: 8px;
}

.buy-btn,
.sell-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.buy-btn {
    background: var(--accent-green);
    color: white;
}

.buy-btn:hover {
    background: #2ea043;
    transform: translateY(-1px);
}

.sell-btn {
    background: var(--accent-red);
    color: white;
}

.sell-btn:hover {
    background: #da3633;
    transform: translateY(-1px);
}

/* --- ポートフォリオセクション --- */
.portfolio-section {
    margin-bottom: 25px;
}

.portfolio-section h2 {
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.portfolio-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.portfolio-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.portfolio-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.portfolio-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.portfolio-info h4 {
    font-size: 0.95rem;
    margin-bottom: 2px;
    color: var(--text-primary);
}

.portfolio-amount {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.portfolio-right {
    text-align: right;
}

.portfolio-value {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 2px;
    color: var(--text-primary);
}

.portfolio-profit {
    font-size: 0.85rem;
}

.portfolio-profit.positive {
    color: var(--accent-green);
}

.portfolio-profit.negative {
    color: var(--accent-red);
}

.empty-message {
    color: var(--text-muted);
    text-align: center;
    padding: 30px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px dashed var(--border-color);
}

/* --- 取引履歴セクション --- */
.history-section {
    margin-bottom: 25px;
}

.history-section h2 {
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.history-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.history-type {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 48px;
    text-align: center;
    display: inline-block;
}

.history-type.buy {
    background: rgba(63, 185, 80, 0.15);
    color: var(--accent-green);
}

.history-type.sell {
    background: rgba(248, 81, 73, 0.15);
    color: var(--accent-red);
}

.history-coin {
    font-weight: 500;
    color: var(--text-primary);
}

.history-right {
    text-align: right;
}

.history-amount {
    font-weight: 500;
    color: var(--text-primary);
}

.history-time {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* --- モーダル --- */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease;
}

.modal.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 90%;
    max-width: 520px;
    padding: 24px;
    position: relative;
    animation: slideUp 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

/* モーダル内ミニチャート */
.modal-chart-section {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
}

.modal-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.modal-chart-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.modal-period-selector {
    display: flex;
    gap: 5px;
}

.modal-period-btn {
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px 10px;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.modal-period-btn:hover {
    color: var(--text-primary);
}

.modal-period-btn.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

.modal-chart-container {
    height: 150px;
    position: relative;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-btn {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 1.8rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
}

.close-btn:hover {
    color: var(--text-primary);
}

.modal-content h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
}

.coin-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--bg-card);
    border-radius: 12px;
    margin-bottom: 20px;
}

.coin-info img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.coin-info div {
    display: flex;
    flex-direction: column;
}

#modal-coin-name {
    font-weight: 600;
    font-size: 1.1rem;
}

#modal-coin-price {
    color: var(--text-secondary);
}

.trade-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.tab-btn.active[data-action="buy"] {
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: white;
}

.tab-btn.active[data-action="sell"] {
    background: var(--accent-red);
    border-color: var(--accent-red);
    color: white;
}

/* 保有量表示エリア */
.holding-info {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: linear-gradient(135deg, rgba(248, 81, 73, 0.1) 0%, rgba(248, 81, 73, 0.05) 100%);
    border: 1px solid rgba(248, 81, 73, 0.3);
    border-radius: 10px;
    margin-bottom: 15px;
}

.holding-info.visible {
    display: flex;
}

.holding-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.holding-value {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.holding-yen {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.trade-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.trade-form label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.trade-form input {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px 16px;
    color: var(--text-primary);
    font-size: 1.1rem;
    transition: var(--transition-fast);
}

.trade-form input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.quick-buttons {
    display: flex;
    gap: 10px;
}

.quick-btn {
    flex: 1;
    padding: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition-fast);
}

.quick-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.trade-summary {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    background: var(--bg-card);
    border-radius: 10px;
    font-size: 1rem;
}

#trade-total {
    font-weight: 600;
    color: var(--accent-blue);
}

.execute-btn {
    background: var(--gradient-green);
    border: none;
    border-radius: 12px;
    padding: 16px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.execute-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.execute-btn.sell {
    background: var(--gradient-red);
}

.execute-btn.short {
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
}

.execute-btn.cover {
    background: linear-gradient(135deg, #ca8a04 0%, #eab308 100%);
}

/* 4タブレイアウト */
.trade-tabs-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.trade-tabs-4 .tab-btn {
    padding: 10px 8px;
    font-size: 0.9rem;
}

.tab-btn.active[data-action="short"] {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
    color: white;
}

.tab-btn.active[data-action="cover"] {
    background: var(--accent-yellow);
    border-color: var(--accent-yellow);
    color: white;
}

/* 履歴の空売り/買戻しスタイル */
.history-type.short {
    background: rgba(124, 58, 237, 0.15);
    color: var(--accent-purple);
}

.history-type.cover {
    background: rgba(202, 138, 4, 0.15);
    color: var(--accent-yellow);
}

.history-profit {
    font-size: 0.8rem;
    font-weight: 600;
}

.history-profit.positive {
    color: var(--accent-green);
}

.history-profit.negative {
    color: var(--accent-red);
}

/* ポートフォリオのショートポジション表示 */
.portfolio-card.short-position,
.portfolio-card-detailed.short-position {
    border-left: 4px solid var(--accent-purple);
}

.short-label {
    background: rgba(124, 58, 237, 0.15);
    color: var(--accent-purple);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 8px;
}

.trade-buttons {
    display: flex;
    gap: 10px;
}

.trade-buttons .execute-btn {
    flex: 1;
}

.watchlist-btn {
    background: var(--bg-card);
    border: 2px solid var(--accent-blue);
    border-radius: 12px;
    padding: 16px;
    color: var(--accent-blue);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.watchlist-btn:hover {
    background: var(--accent-blue);
    color: white;
}

.watchlist-btn.added {
    background: var(--bg-card);
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.watchlist-btn.added:hover {
    background: var(--accent-red);
    color: white;
}

/* --- 入力モード切り替え --- */
.input-mode-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 5px;
}

.mode-btn {
    flex: 1;
    padding: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.mode-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.mode-btn.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group.hidden {
    display: none;
}

.yen-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.yen-symbol {
    position: absolute;
    left: 16px;
    color: var(--accent-blue);
    font-size: 1.2rem;
    font-weight: 600;
}

.yen-input-wrapper input {
    width: 100%;
    padding-left: 40px !important;
    font-size: 1.2rem !important;
}

.calculated-amount {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: center;
    padding: 8px;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px dashed var(--border-color);
}

.calculated-amount span {
    color: var(--accent-green);
    font-weight: 600;
}

/* --- ローディング --- */
.loading {
    display: flex;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* --- レスポンシブ --- */
@media (max-width: 600px) {
    .app-container {
        padding: 10px;
    }

    .header h1 {
        font-size: 1.3rem;
    }

    .balance-card {
        grid-template-columns: 1fr;
        padding: 15px;
    }

    .balance-value {
        font-size: 1.2rem;
    }

    .balance-label {
        font-size: 0.8rem;
    }

    .search-container {
        flex-direction: column;
    }

    /* コインリスト */
    .coin-card {
        padding: 10px;
        flex-wrap: wrap;
    }

    .coin-left {
        flex: 0 0 auto;
        min-width: 0;
    }

    .coin-icon {
        width: 32px;
        height: 32px;
    }

    .coin-info h3 {
        font-size: 0.85rem;
    }

    .coin-symbol {
        font-size: 0.7rem;
    }

    .coin-center {
        min-width: 0;
        flex: 0 0 auto;
    }

    .coin-price {
        font-size: 0.85rem;
        min-width: 0;
    }

    .coin-change {
        font-size: 0.7rem;
        padding: 2px 6px;
        min-width: 0;
    }

    .coin-right {
        flex-direction: row;
        gap: 4px;
        align-items: center;
        flex: 0 0 auto;
    }

    .coin-actions,
    .coin-buttons {
        gap: 4px;
    }

    .coin-buttons button {
        padding: 4px 8px;
        font-size: 0.65rem;
    }

    /* ナビゲーション */
    .main-nav {
        flex-direction: column;
        gap: 8px;
        padding: 6px;
    }

    .nav-link {
        width: 100%;
        text-align: center;
        padding: 10px;
        font-size: 0.9rem;
    }

    /* 履歴アイテム */
    .history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 10px 12px;
    }

    .history-left {
        width: 100%;
    }

    .history-right {
        width: 100%;
        text-align: left;
    }

    .history-amount {
        font-size: 0.85rem;
        word-break: break-all;
    }

    /* ポートフォリオカード */
    .portfolio-card-detailed {
        flex-wrap: wrap;
        gap: 12px;
        padding: 12px;
    }

    .portfolio-center,
    .portfolio-right-detailed {
        flex: 1 1 45%;
        min-width: 0;
    }

    .portfolio-actions {
        width: 100%;
        justify-content: flex-end;
    }

    /* チャート */
    .chart-container {
        height: 200px;
    }

    .chart-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .chart-stats {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .stat-value {
        font-size: 0.9rem;
    }

    /* 期間ボタン */
    .period-buttons {
        flex-wrap: wrap;
        gap: 4px;
    }

    .period-btn {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    /* セクションヘッダー */
    .section-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .section-header h2 {
        font-size: 1rem;
    }

    /* フォーム要素 */
    input,
    select {
        font-size: 16px;
        /* iOSズーム防止 */
    }

    /* モーダル */
    .modal-content {
        width: 95%;
        max-height: 90vh;
        margin: 10px;
        padding: 15px;
    }

    .trade-tabs {
        gap: 4px;
    }

    .tab-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    /* チャート期間セレクター */
    .chart-period-selector {
        flex-wrap: wrap;
        gap: 4px;
    }

    .chart-period-selector .period-btn,
    .period-btn {
        padding: 5px 8px;
        font-size: 0.7rem;
        min-width: auto;
    }

    /* モーダル期間ボタン */
    .modal-period-selector {
        flex-wrap: wrap;
        gap: 4px;
    }

    .modal-period-btn {
        padding: 4px 8px;
        font-size: 0.7rem;
    }

    /* ソート選択 */
    .chart-sort-selector select,
    .price-list-sort {
        font-size: 0.75rem;
        padding: 6px 8px;
        min-width: 100px;
        max-width: 120px;
    }

    .chart-coin-selector select {
        font-size: 0.85rem;
        padding: 8px 10px;
        min-width: 130px;
    }

    /* コインカードのボタン */
    .coin-card .coin-buttons {
        flex-wrap: wrap;
        gap: 4px;
    }

    .coin-card .coin-buttons button,
    .buy-btn,
    .sell-btn,
    .chart-buy-btn,
    .chart-sell-btn {
        padding: 5px 10px;
        font-size: 0.7rem;
        white-space: nowrap;
    }

    /* チャートヘッダー全体 */
    .chart-trade-buttons {
        gap: 6px;
    }

    /* フィルター・検索行 */
    .filter-container {
        gap: 8px;
    }

    .search-row {
        flex-direction: column;
        gap: 8px;
    }

    .api-search-btn {
        width: 100%;
        font-size: 0.8rem;
    }

    #coin-filter {
        font-size: 0.85rem;
    }
}

/* --- ナビゲーション --- */
.main-nav {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    padding: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
}

.nav-link {
    flex: 1;
    text-align: center;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-fast);
    background: transparent;
}

.nav-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-link.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

/* --- 保有資産ページ専用スタイル --- */
.portfolio-summary-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 25px;
}

.portfolio-summary-section h2 {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.portfolio-chart-container {
    height: 280px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ポートフォリオ詳細カード */
.portfolio-card-detailed {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    transition: var(--transition-fast);
}

.portfolio-card-detailed:hover {
    background: var(--bg-card);
    border-color: var(--accent-blue);
    transform: translateX(4px);
}

.portfolio-center {
    text-align: center;
}

.portfolio-current-price {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.portfolio-change {
    font-size: 0.85rem;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 500;
    display: inline-block;
    margin-top: 4px;
}

.portfolio-change.positive {
    background: rgba(63, 185, 80, 0.15);
    color: var(--accent-green);
}

.portfolio-change.negative {
    background: rgba(248, 81, 73, 0.15);
    color: var(--accent-red);
}

.portfolio-right-detailed {
    text-align: right;
    min-width: 140px;
}

.portfolio-actions {
    display: flex;
    gap: 8px;
}

.portfolio-buy-btn,
.portfolio-sell-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.portfolio-buy-btn {
    background: var(--accent-green);
    color: white;
}

.portfolio-buy-btn:hover {
    background: #2ea043;
    transform: translateY(-1px);
}

.portfolio-sell-btn {
    background: var(--accent-red);
    color: white;
}

.portfolio-sell-btn:hover {
    background: #da3633;
    transform: translateY(-1px);
}

/* --- 資産推移セクション --- */
.asset-history-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 25px;
}

.asset-history-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.asset-history-section h2 {
    margin: 0;
}

.history-period-selector {
    display: flex;
    gap: 8px;
}

.history-period-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 14px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.history-period-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.history-period-btn.active {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
    color: white;
}

.asset-history-chart-container {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    height: 280px;
    margin-bottom: 20px;
    position: relative;
}

.asset-history-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
}

.history-stat-item {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
}

.history-stat-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 6px;
}

.history-stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.history-stat-value.positive {
    color: var(--accent-green);
}

.history-stat-value.negative {
    color: var(--accent-red);
}

/* モバイル対応 */
@media (max-width: 600px) {
    .asset-history-section .section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .history-period-selector {
        justify-content: center;
        flex-wrap: wrap;
    }

    .asset-history-chart-container {
        height: 220px;
    }
}

/* --- 前日比表示 --- */
.daily-change-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    padding: 8px 16px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.daily-change-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.daily-change-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.daily-change-value.positive {
    color: var(--accent-green);
}

.daily-change-value.negative {
    color: var(--accent-red);
}

/* --- 通貨詳細情報セクション --- */
.coin-details-section {
    background: var(--bg-card);
    border-radius: 12px;
    margin: 15px 0;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.coin-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(88, 166, 255, 0.05);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
}

.coin-details-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.coin-details-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 4px 8px;
    transition: var(--transition-fast);
}

.coin-details-toggle:hover {
    color: var(--text-primary);
}

.coin-details-content {
    padding: 16px;
    max-height: 300px;
    overflow-y: auto;
    transition: max-height 0.3s ease;
}

.coin-details-content.collapsed {
    max-height: 0;
    padding: 0 16px;
    overflow: hidden;
}

.coin-market-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.market-stat {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.market-stat-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-bottom: 4px;
}

.market-stat-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.coin-description {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 12px;
}

.coin-description h4 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.coin-description p {
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.6;
    max-height: 120px;
    overflow-y: auto;
}

/* --- 折りたたみセクション --- */
.collapsible-section .section-header {
    flex-wrap: wrap;
}

.section-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-toggle-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.section-toggle-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--accent-blue);
}

.section-toggle-btn.collapsed {
    transform: rotate(-90deg);
}

.collapsible-content {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    max-height: 1000px;
    opacity: 1;
}

.collapsible-content.collapsed {
    max-height: 0;
    opacity: 0;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* 資産推移の折りたたみ時にstatsも隠す */
#history-content.collapsed .asset-history-stats {
    display: none;
}

/* ===================================
   シミュレーターモード切り替えタブ
=================================== */

.simulator-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px;
}

.simulator-tab {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.simulator-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.simulator-tab.active {
    background: var(--gradient-primary);
    color: white;
}

.simulator-content {
    animation: fadeIn 0.3s ease;
}

.setting-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* --- 日付入力 --- */
.onetime-date-input {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 1rem;
    width: 100%;
    cursor: pointer;
}

.onetime-date-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2);
}

.onetime-date-input::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

/* --- 一括購入結果ハイライト --- */
.onetime-result-highlight {
    background: linear-gradient(135deg, rgba(88, 166, 255, 0.1) 0%, rgba(163, 113, 247, 0.1) 100%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 25px;
    text-align: center;
}

.onetime-main-result {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.onetime-label {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.onetime-label span {
    color: var(--text-primary);
    font-weight: 600;
}

.onetime-value-comparison {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.onetime-invested,
.onetime-current {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.onetime-invested .label,
.onetime-current .label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.onetime-invested .value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.onetime-current .value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-blue);
}

.onetime-arrow {
    font-size: 2rem;
    color: var(--text-muted);
}

.onetime-profit-display {
    font-size: 1.5rem;
    font-weight: 700;
    padding: 15px 25px;
    border-radius: 12px;
    display: inline-block;
}

.onetime-profit-display.positive {
    background: rgba(63, 185, 80, 0.15);
    color: var(--accent-green);
}

.onetime-profit-display.negative {
    background: rgba(248, 81, 73, 0.15);
    color: var(--accent-red);
}

/* ===================================
   DCA（積立シミュレーター）スタイル
=================================== */


/* --- 設定セクション --- */
.dca-settings-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 25px;
}

.dca-settings-section h2 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.dca-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    align-items: end;
}

.dca-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dca-input-group label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.dca-input-group select,
.dca-input-group input {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition-fast);
}

.dca-input-group select:focus,
.dca-input-group input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2);
}

.dca-yen-input {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0 16px;
    transition: var(--transition-fast);
}

.dca-yen-input:focus-within {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2);
}

.dca-yen-input .yen-symbol {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-right: 8px;
}

.dca-yen-input input {
    border: none;
    background: transparent;
    padding: 12px 0;
    flex: 1;
}

.dca-yen-input input:focus {
    outline: none;
    box-shadow: none;
}

.dca-simulate-btn {
    background: var(--gradient-primary);
    border: none;
    border-radius: 10px;
    padding: 14px 28px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    min-height: 50px;
}

.dca-simulate-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

/* --- 結果セクション --- */
.dca-results-section {
    margin-bottom: 25px;
}

.dca-results-section h2 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.dca-results-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.dca-result-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: center;
    position: relative;
}

/* ツールチップアイコン（はてな） */
.dca-tooltip-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 18px;
    height: 18px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    transition: var(--transition-fast);
}

.dca-tooltip-icon:hover {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

.dca-result-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.dca-result-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    word-break: break-all;
}

.dca-result-value.positive {
    color: var(--accent-green);
}

.dca-result-value.negative {
    color: var(--accent-red);
}

/* --- チャート --- */
.dca-chart-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 25px;
    height: 350px;
}

/* --- 履歴セクション --- */
.dca-details-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
}

.dca-details-section h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.dca-history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.dca-history-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.dca-history-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
    min-width: 80px;
}

.dca-history-details {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    justify-content: center;
}

.dca-history-amount {
    color: var(--text-primary);
    font-weight: 600;
}

.dca-history-coins {
    color: var(--accent-blue);
    font-size: 0.9rem;
}

.dca-history-price {
    color: var(--text-muted);
    font-size: 0.85rem;
    min-width: 120px;
    text-align: right;
}

.dca-history-more {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
    padding: 10px;
}

/* --- ローディング --- */
.dca-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    margin-bottom: 25px;
}

.dca-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.dca-loading p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* --- エラー表示 --- */
.dca-error {
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid var(--accent-red);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
    text-align: center;
}

.dca-error p {
    color: var(--accent-red);
    font-size: 1rem;
}

/* --- レスポンシブ対応 --- */
@media (max-width: 600px) {
    .dca-form {
        grid-template-columns: 1fr;
    }

    .dca-results-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .dca-result-card {
        padding: 15px;
    }

    .dca-result-value {
        font-size: 1.1rem;
    }

    .dca-history-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .dca-history-details {
        width: 100%;
        justify-content: flex-start;
    }

    .dca-history-price {
        width: 100%;
        text-align: left;
    }
}

/* ===================================
   法的ページ（プライバシー・利用規約）
=================================== */

.legal-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 25px;
}

.legal-content {
    max-width: 800px;
    margin: 0 auto;
}

.legal-date {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.legal-content h2 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-top: 30px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent-blue);
}

.legal-content h2:first-of-type {
    margin-top: 0;
}

.legal-content h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-top: 20px;
    margin-bottom: 10px;
}

.legal-content p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 15px;
}

.legal-content ul {
    color: var(--text-secondary);
    margin-left: 25px;
    margin-bottom: 15px;
}

.legal-content li {
    margin-bottom: 8px;
    line-height: 1.7;
}

.legal-content a {
    color: var(--accent-blue);
    text-decoration: none;
}

.legal-content a:hover {
    text-decoration: underline;
}

.warning-box {
    background: rgba(210, 153, 34, 0.15);
    border: 1px solid rgba(210, 153, 34, 0.4);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

.warning-box strong {
    display: block;
    color: var(--accent-yellow);
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.warning-box p {
    color: var(--text-primary);
    margin-bottom: 10px;
}

.warning-box ul {
    color: var(--text-primary);
}

/* --- フッター --- */
.legal-footer {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 20px;
    margin-top: 20px;
    border-top: 1px solid var(--border-color);
}

.legal-footer a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.legal-footer a:hover {
    color: var(--accent-blue);
}

/* ===================================
   お問い合わせページ
=================================== */

.contact-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 25px;
}

.contact-content {
    max-width: 700px;
    margin: 0 auto;
}

.contact-info {
    margin-bottom: 30px;
}

.contact-info h2 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.contact-info p {
    color: var(--text-secondary);
    line-height: 1.7;
}

.contact-notes {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.contact-notes h3 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.contact-notes ul {
    color: var(--text-secondary);
    margin-left: 20px;
}

.contact-notes li {
    margin-bottom: 6px;
    font-size: 0.9rem;
}

/* --- お問い合わせフォーム --- */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
}

.form-group .required {
    color: var(--accent-red);
}

.form-group input,
.form-group select,
.form-group textarea {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-group select {
    cursor: pointer;
}

/* チェックボックス */
.checkbox-group {
    flex-direction: row;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 400;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-label a {
    color: var(--accent-blue);
    text-decoration: none;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

/* 送信ボタン */
.submit-btn {
    background: var(--gradient-primary);
    border: none;
    border-radius: 10px;
    padding: 14px 30px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    margin-top: 10px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* 送信完了メッセージ */
.contact-success {
    text-align: center;
    padding: 40px 20px;
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.contact-success h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.contact-success p {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.back-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 24px;
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    margin-top: 20px;
    transition: var(--transition-fast);
}

.back-btn:hover {
    background: var(--bg-hover);
}

/* --- レスポンシブ対応 --- */
@media (max-width: 600px) {

    .legal-section,
    .contact-section {
        padding: 20px;
    }

    .legal-content h2 {
        font-size: 1.1rem;
    }

    .legal-footer {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
}

/* ===================================
   データ管理セクション
=================================== */

.data-management-section {
    margin-bottom: 25px;
}

.data-management-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.data-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.data-btn.export-btn {
    background: var(--bg-card);
    color: var(--text-primary);
}

.data-btn.export-btn:hover {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.data-btn.import-btn {
    background: var(--bg-card);
    color: var(--text-primary);
}

.data-btn.import-btn:hover {
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.data-management-hint {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 12px;
}

/* レスポンシブ */
@media (max-width: 480px) {
    .data-management-buttons {
        flex-direction: column;
    }

    .data-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===================================
   セーブコードモーダル
=================================== */

.data-btn.savecode-btn {
    background: var(--bg-card);
    color: var(--text-primary);
}

.data-btn.savecode-btn:hover {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.data-btn.reset-btn {
    background: var(--bg-card);
    color: var(--accent-red);
    border-color: var(--accent-red);
}

.data-btn.reset-btn:hover {
    background: var(--accent-red);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.savecode-modal-content {
    max-width: 480px;
    text-align: center;
}

.savecode-modal-content h2 {
    margin-bottom: 20px;
    color: var(--text-primary);
}

.savecode-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.savecode-tab-btn {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.savecode-tab-btn.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

.savecode-tab-content {
    display: none;
}

.savecode-tab-content.active {
    display: block;
}

.savecode-instruction {
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.savecode-display {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.savecode-output {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: monospace;
    font-size: 0.8rem;
    word-break: break-all;
    resize: none;
}

.copy-btn {
    padding: 12px 20px;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.copy-btn:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
}

.savecode-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.savecode-note {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.savecode-input {
    width: 100%;
    min-height: 100px;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: monospace;
    font-size: 0.85rem;
    resize: vertical;
    margin-bottom: 15px;
}

.savecode-input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.load-savecode-btn {
    width: 100%;
    padding: 12px;
    background: var(--accent-green);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.load-savecode-btn:hover {
    background: #15803d;
    transform: translateY(-2px);
}

/* ===== ガイドページ ===== */
.guide-section {
    padding: 20px;
}

.guide-content {
    max-width: 800px;
    margin: 0 auto;
}

.guide-intro {
    background: var(--bg-card);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.guide-intro h2 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.guide-intro p {
    color: var(--text-secondary);
    line-height: 1.8;
}

.feature-highlights {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: var(--bg-secondary);
    border-radius: 10px;
}

.feature-icon {
    font-size: 1.5rem;
}

.feature-text {
    font-weight: 500;
    color: var(--text-primary);
}

.guide-steps {
    margin-bottom: 30px;
}

.guide-steps h2 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.step-card {
    display: flex;
    gap: 15px;
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: var(--shadow-sm);
}

.step-number {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.step-content h3 {
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.step-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.guide-features {
    margin-bottom: 30px;
}

.guide-features h2 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.feature-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: var(--shadow-sm);
}

.feature-card h3 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.feature-card ul {
    margin-left: 20px;
    color: var(--text-secondary);
}

.feature-card li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.guide-faq {
    margin-bottom: 30px;
}

.guide-faq h2 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.faq-item {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}

.faq-item h3 {
    font-size: 0.95rem;
    color: var(--accent-blue);
    margin-bottom: 10px;
}

.faq-item p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.guide-cta {
    text-align: center;
    padding: 30px 0;
}

.cta-button {
    display: inline-block;
    padding: 15px 40px;
    background: var(--gradient-primary);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

@media (max-width: 480px) {
    .feature-highlights {
        grid-template-columns: 1fr;
    }
}

/* ===== API帰属表示 ===== */
.api-attribution {
    width: 100%;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.api-attribution a {
    color: var(--text-secondary);
    text-decoration: none;
}

.api-attribution a:hover {
    color: var(--accent-blue);
    text-decoration: underline;
}

/* ===== アフィリエイトセクション ===== */
.affiliate-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    margin-top: 30px;
    margin-bottom: 20px;
}

.affiliate-section h2 {
    font-size: 1.3rem;
    margin-bottom: 12px;
    color: var(--text-primary);
    text-align: center;
}

.affiliate-intro {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 25px;
    font-size: 0.95rem;
}

.affiliate-cards {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.affiliate-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 14px;
    padding: 18px 20px;
    text-decoration: none;
    color: inherit;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.affiliate-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.affiliate-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: var(--transition-fast);
}

.affiliate-card:hover::before {
    opacity: 1;
}

.affiliate-logo {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
}

.affiliate-info {
    flex: 1;
}

.affiliate-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.affiliate-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.affiliate-badge {
    background: var(--gradient-primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
    white-space: nowrap;
}

.affiliate-disclaimer {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 20px;
}

.affiliate-inline {
    margin-top: 25px;
}

/* レスポンシブ対応 */
@media (max-width: 600px) {
    .affiliate-section {
        padding: 20px 15px;
    }

    .affiliate-card {
        padding: 14px 16px;
    }

    .affiliate-logo {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .affiliate-info h3 {
        font-size: 1rem;
    }

    .affiliate-badge {
        font-size: 0.7rem;
        padding: 4px 10px;
    }
}

/* ===== サイドバー広告（PCのみ表示） ===== */
.page-wrapper {
    display: flex;
    justify-content: center;
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    padding-left: 340px;
    /* サイドバー幅(280px)+gap(40px)+余白でバランス調整 */
}

.main-content {
    flex: 0 1 900px;
    /* 固定幅で中央配置 */
    max-width: 900px;
    min-width: 0;
}

.sidebar-ads {
    width: 280px;
    flex-shrink: 0;
    display: none;
    /* デフォルトは非表示 */
}

.sidebar-sticky {
    position: sticky;
    top: 20px;
}

.sidebar-ad-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
}

.sidebar-ad-card h3 {
    font-size: 1rem;
    margin-bottom: 15px;
    color: var(--text-primary);
    text-align: center;
}

.sidebar-ad-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-ad-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

.sidebar-ad-item:hover {
    border-color: var(--accent-blue);
    transform: translateX(3px);
    box-shadow: var(--shadow-md);
}

.sidebar-ad-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sidebar-ad-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-ad-info strong {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.sidebar-ad-info span {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.sidebar-ad-note {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 12px;
}

/* PC表示時（1200px以上）のみサイドバーを表示 */
@media (min-width: 1200px) {
    .sidebar-ads {
        display: block;
    }

    .app-container.main-content {
        padding: 20px 0;
    }
}

/* タブレット以下ではpage-wrapperを通常のブロックに */
@media (max-width: 1199px) {
    .page-wrapper {
        display: block;
        padding: 0;
    }

    .app-container.main-content {
        max-width: 900px;
        margin: 0 auto;
        padding: 20px;
        padding-bottom: 100px;
        /* 下部固定バナーのスペース確保 */
    }

    /* サイドバーを下部固定バナーに変換 */
    .sidebar-ads {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        z-index: 1000;
        padding: 0;
    }

    .sidebar-sticky {
        position: static;
    }

    .sidebar-ad-card {
        margin: 0;
        border-radius: 16px 16px 0 0;
        padding: 12px 16px;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    }

    .sidebar-ad-card h3 {
        display: none;
        /* モバイルではタイトル非表示 */
    }

    .sidebar-ad-list {
        flex-direction: row;
        justify-content: center;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .sidebar-ad-item {
        flex-direction: column;
        text-align: center;
        padding: 8px 12px;
        min-width: 80px;
        gap: 4px;
    }

    .sidebar-ad-icon {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .sidebar-ad-info {
        align-items: center;
    }

    .sidebar-ad-info strong {
        font-size: 0.75rem;
    }

    .sidebar-ad-info span {
        display: none;
        /* モバイルでは説明文非表示 */
    }

    .sidebar-ad-note {
        display: none;
        /* モバイルでは注釈非表示 */
    }
}