/* ヘルプモーダルダイアログ */
#help-dialog {
    width: min(640px, 90vw);
    max-height: 80vh;
    border: none;
    border-radius: 0.5rem;
    padding: 0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

#help-dialog::backdrop {
    background: rgba(0, 0, 0, 0.5);
}

.help-dialog-inner {
    display: flex;
    flex-direction: column;
    max-height: 80vh;
}

.help-dialog-header {
    display: flex;
    justify-content: flex-end;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    flex-shrink: 0;
}

.help-dialog-body {
    overflow-y: auto;
    padding: 1.25rem 1.5rem;
    font-size: 0.875rem;
    color: #374151;
    line-height: 1.6;
}

.help-dialog-body h1 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #1f2937;
}

.help-dialog-body h2 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-top: 1rem;
    margin-bottom: 0.375rem;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.25rem;
}

.help-dialog-body p {
    margin-bottom: 0.5rem;
}

.help-dialog-body ul {
    list-style-type: disc;
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
}

.help-dialog-body li {
    margin-bottom: 0.25rem;
}

/* ヘルプ起動アイコンボタン */
.help-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 9999px;
    border: none;
    background: transparent;
    color: #48bb78;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.15s;
    padding: 0;
}

.help-icon-btn:hover {
    background-color: #dcfce7;
    color: #276749;
}

.help-icon-btn:focus {
    outline: none;
}

.help-icon-btn:focus-visible {
    outline: 2px solid #48bb78;
    outline-offset: 2px;
}

.help-icon-btn svg {
    width: 1.25rem;
    height: 1.25rem;
    pointer-events: none;
}

/* ===== アクセントグリーン統一 (#48bb78) ===== */

/* ラジオボタン */
input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 1.125rem;
    height: 1.125rem;
    border: 1.5px solid #d1d5db;
    border-radius: 9999px;
    background: #ffffff;
    cursor: pointer;
    vertical-align: middle;
}

input[type="radio"]:checked {
    border-color: #48bb78;
    background-color: #48bb78;
    box-shadow: inset 0 0 0 4px #ffffff;
}

input[type="radio"]:focus-visible {
    outline: 2px solid #48bb78;
    outline-offset: 2px;
}

/* チェックボックス */
input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 1rem;
    height: 1rem;
    border: 1.5px solid #d1d5db;
    border-radius: 0.25rem;
    background: #ffffff;
    cursor: pointer;
    vertical-align: middle;
}

input[type="checkbox"]:checked {
    border-color: #48bb78;
    background-color: #48bb78;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3.5 8.5L6.5 11.5L12.5 4.5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 0.75rem 0.75rem;
}

input[type="checkbox"]:focus-visible {
    outline: 2px solid #48bb78;
    outline-offset: 2px;
}

/* disabled 共通: ネイティブのグレーアウトが失われないよう補完 */
input[type="radio"]:disabled,
input[type="checkbox"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* bg-green-500: 実行ボタン・サイドバーカレント・ドメインタブカレント */
.bg-green-500 {
    background-color: #48bb78 !important;
}

/* bg-green-500 ホバー: hover:bg-opacity-75/50 の代替として明示的に暗くする */
.bg-green-500:hover {
    background-color: #38a169 !important;
}

/* hover:bg-green-500: サイドバーメニューホバー（#sidebar 内に限定） */
#sidebar .hover\:bg-green-500:hover {
    background-color: #c6f6d5 !important;
}

/* text-green-700: ドメインセクションラベル・テキストリンク */
.text-green-700 {
    color: #276749 !important;
}

/* text-green-800: 事務所名・サイドバーメニューテキスト */
.text-green-800 {
    color: #22543d !important;
}

/* hover:bg-green-100: ドメインタブホバー */
.hover\:bg-green-100:hover {
    background-color: #c6f6d5 !important;
}

/* focus:border-green-400: テキストエリア・入力フィールドのフォーカス枠 */
.focus\:border-green-400:focus {
    border-color: #48bb78 !important;
}

/* focus:ring-green-500: サイドバートグルボタン・モーダル閉じるボタンのフォーカスリング */
.focus\:ring-green-500:focus {
    --tw-ring-color: #48bb78 !important;
}

/* ===== ツールタイトルアクションボタン (tool_title_actions) ===== */

/* Feature type アクティブ: #48bb78 → ホバーで暗く */
.tta-btn-feature-active {
    background-color: #48bb78;
    color: #ffffff;
    transition: background-color 0.15s;
}
.tta-btn-feature-active:hover {
    background-color: #38a169;
}

/* Feature type 非アクティブ: 左カラム検索ボタン disabled 色に合わせる（bg-green-600 / opacity-50） */
.tta-btn-feature-inactive {
    background-color: rgba(56, 161, 105, 0.5);
    color: #ffffff;
    transition: background-color 0.15s;
}
.tta-btn-feature-inactive:hover {
    background-color: rgba(56, 161, 105, 0.7);
}

/* Action type (#2a9bc1) → ホバーで暗く */
.tta-btn-action {
    background-color: #2a9bc1;
    color: #ffffff;
    transition: background-color 0.15s;
}
.tta-btn-action:hover {
    background-color: #22809f;
}

/* Settings / admin / status type アクティブ: 第3色 #d4d4d6 → ホバーで暗く */
.tta-btn-settings-active {
    background-color: #d4d4d6;
    color: #4a5568;
    transition: background-color 0.15s;
}
.tta-btn-settings-active:hover {
    background-color: #b0b0b2;
}

/* Settings / admin / status type 非アクティブ: 第3色より明るいグレー → ホバーで第3色へ */
.tta-btn-settings-inactive {
    background-color: #f0f0f0;
    color: #6b7280;
    transition: background-color 0.15s;
}
.tta-btn-settings-inactive:hover {
    background-color: #d4d4d6;
}

/* サイドバー開閉トランジション */
#sidebar {
    transition: width 0.2s ease-in-out;
    overflow-x: hidden;
}

/* 閉状態: Tailwind の w-56 / flex-shrink-0 を上書き */
/* html.sidebar-collapsed は head 内早期スクリプトで付与（初期描画フラッシュ防止） */
/* #sidebar.sidebar-collapsed は sidebar.js の DOMContentLoaded 後に付与 */
html.sidebar-collapsed #sidebar,
#sidebar.sidebar-collapsed {
    width: 0 !important;
    min-width: 0 !important;
    flex-basis: 0 !important;
    overflow: hidden !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}
