/* ベース：文字の美しさにこだわる */
body {
    font-family: "Inter", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
    color: #1a1a1a;
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}

:root {
    --primary: #0070bc;
    --warning: #ff9d00;
    --bg-light: #f8fafc;
    --placeholder-color: #9aa3af;
}

/* 入力補助であることが分かるよう、placeholder は通常文字より薄くする */
input::placeholder,
textarea::placeholder {
    color: var(--placeholder-color) !important;
    opacity: 1;
}

/* レガシーブラウザ向け */
input::-ms-input-placeholder,
textarea::-ms-input-placeholder {
    color: var(--placeholder-color) !important;
}

.text-primary { color: var(--primary) !important; }
.bg-primary { background-color: var(--primary) !important; }
.btn-warning { background-color: var(--warning); border: none; color: #fff; }
.btn-warning:hover { background-color: #e68d00; color: #fff; transform: translateY(-2px); transition: 0.3s; }

/* ヒーローエリアの装飾 */
.min-vh-70 { min-height: 70vh; }
.badge-new {
    background: #eef7ff;
    color: var(--primary);
    padding: 6px 16px;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 1px;
    border-radius: 50px;
}
.hero-title { font-size: calc(1.8rem + 1.5vw); letter-spacing: -0.02em; }

/* 特徴カード */
.feature-card {
    background: #fff;
    border-radius: 20px;
    transition: 0.3s ease;
}
.icon-box {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 32px;
}
.bg-light-blue { background-color: #f0f7ff; }

/* 料金プラン */
.price-card { transition: 0.3s; position: relative; }
.price-card.premium { border: 3px solid var(--primary) !important; }
.recommend-tag {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    padding: 4px 20px;
    border-radius: 50px;
}

/* モバイル最適化の微調整 */
@media (max-width: 991px) {
    .navbar-brand { font-size: 1.4rem !important; }
    .hero-title { font-size: 1.8rem; }
    .hero-img-wrap { padding: 0 10%; }
    /* スマホではプランの強調を戻す */
    .price-card.premium { transform: none !important; margin-bottom: 20px; }
    .fixed-bottom { z-index: 1050; }
    .shadow-lg-up { box-shadow: 0 -10px 30px rgba(0,0,0,0.1); }
}

/* ボタンのサイズ拡張 */
.btn-xl { padding: 18px 40px; font-size: 1.1rem; }
.rounded-4 { border-radius: 1.5rem !important; }

/* ノートカテゴリバッジ（白背景のカードヘッダー等でも視認性を確保） */
.badge.note-cat-1,
.badge.note-cat-2,
.badge.note-cat-3,
.badge.note-cat-4,
.badge.note-cat-5,
.badge.note-cat-unset {
    font-weight: 600;
    border-width: 1px;
    border-style: solid;
}
.badge.note-cat-1 {
    background-color: #dbeafe;
    color: #1e3a8a;
    border-color: #93c5fd;
}
.badge.note-cat-2 {
    background-color: #d1fae5;
    color: #065f46;
    border-color: #6ee7b7;
}
.badge.note-cat-3 {
    background-color: #ede9fe;
    color: #5b21b6;
    border-color: #c4b5fd;
}
.badge.note-cat-4 {
    background-color: #ffedd5;
    color: #9a3412;
    border-color: #fdba74;
}
.badge.note-cat-5 {
    background-color: #e2e8f0;
    color: #334155;
    border-color: #94a3b8;
}
.badge.note-cat-unset {
    background-color: #f1f5f9;
    color: #475569;
    border-color: #cbd5e1;
}

/* ノート作成・編集: 入力欄右下の文字数カウンター */
.note-field-with-counter {
    position: relative;
}
.note-field-with-counter .form-control {
    padding-right: 5.5rem;
}
.note-field-with-counter--textarea .form-control {
    padding-bottom: 1.75rem;
}
.note-field-with-counter .note-char-counter {
    position: absolute;
    right: 0.75rem;
    bottom: 0.5rem;
    font-size: 0.75rem;
    line-height: 1;
    color: var(--bs-secondary-color);
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
}
.note-field-with-counter .note-char-counter.is-over-limit {
    color: var(--bs-danger);
    font-weight: 600;
}

/* リソース画面（一覧・作成・編集・詳細）共通 */
.resource-list-page,
.resource-page {
    margin-bottom: 3rem;
}
.resource-form-actions {
    margin-top: 0.25rem;
}
.resource-list-item-card {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.resource-list-item-card:hover,
.resource-list-item-card:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.12) !important;
    border-color: rgba(13, 110, 253, 0.35) !important;
}
.resource-list-item-card--row:hover,
.resource-list-item-card--row:focus-visible {
    transform: none;
}
.resource-list-empty__icon {
    font-size: 4rem;
    line-height: 1;
}

/* 設定画面: 項目ヘルプ（? + ツールチップ） */
.settings-help-label {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.2rem;
}
.settings-help {
    position: relative;
    display: inline-flex;
    vertical-align: middle;
    flex-shrink: 0;
}
.settings-help__trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: #6c757d;
    line-height: 1;
    border-radius: 50%;
    cursor: help;
}
.settings-help__trigger:hover,
.settings-help__trigger:focus-visible {
    color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 112, 188, 0.2);
}
.settings-help__trigger .bi {
    font-size: 1.05rem;
}
.settings-help__tip {
    display: none;
    position: absolute;
    z-index: 1080;
    top: calc(100% + 6px);
    right: 0;
    width: min(18rem, calc(100vw - 2rem));
    padding: 0.55rem 0.65rem;
    font-size: 0.8125rem;
    font-weight: 400;
    line-height: 1.45;
    color: #212529;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 0.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    text-align: left;
    white-space: normal;
}
@media (hover: hover) and (pointer: fine) {
    .settings-help:hover .settings-help__tip,
    .settings-help:focus-within .settings-help__tip {
        display: block;
    }
}
.settings-help.is-open .settings-help__tip {
    display: block;
}

/* disabled 時: Bootstrap はラベル全体を opacity 0.5 にするが、? とチップは不透明のまま */
.form-check-input:disabled ~ .form-check-label.settings-help-label,
.form-check-input[disabled] ~ .form-check-label.settings-help-label {
    opacity: 1;
}
/* 項目名のみ従来どおり薄く（text-muted の子項目は色指定のみ） */
.form-check-input:disabled ~ .form-check-label.settings-help-label:not(.text-muted) > span:first-of-type,
.form-check-input[disabled] ~ .form-check-label.settings-help-label:not(.text-muted) > span:first-of-type {
    opacity: 0.5;
}

/* 見守り方法: スイッチなしの親ラベル（本サービスの利用とラベル位置を揃える） */
.settings-activity-section-spacer {
    visibility: hidden;
    pointer-events: none;
}