/* ============================================================
   KIZNAVI — グローバルスタイル
   移行元: layouts/app.blade.php <style>
============================================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #00897b;
    --primary-dark: #00695c;
    --primary-light: #e0f2f1;
    --color-bookmark: #1565c0;
    --color-bookmark-light: #e8f0fe;
    --color-priority: #f57c00;
    --color-priority-light: #fff3e0;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
    --header-h: 56px;
    --tab-h: 60px;
    --sidebar-w: 220px;
    --sidebar-cw: 56px;
}

html,
body {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", sans-serif;
    background: #f9fafb;
    color: var(--text);
}

/* ============================================================
   HEADER（モバイル）
============================================================ */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 600;
    height: var(--header-h);
    background: var(--primary);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    gap: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.site-logo {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    flex-shrink: 0;
}
.site-logo svg {
    width: 22px;
    height: 22px;
    fill: #fff;
}
.top-nav {
    display: none;
    flex: 1;
    align-items: center;
    gap: 0.125rem;
    padding: 0 0.75rem;
}
.top-nav-link {
    padding: 0.375rem 0.75rem;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    white-space: nowrap;
    transition:
        background 0.12s,
        color 0.12s;
}
.top-nav-link:hover,
.top-nav-link.active {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}
.header-spacer {
    flex: 1;
}

/* ============================================================
   ユーザードロップダウン
============================================================ */
.user-menu {
    position: relative;
    flex-shrink: 0;
}
.user-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    transition: background 0.12s;
}
.user-btn:hover {
    background: rgba(255, 255, 255, 0.28);
}
.user-btn svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}
.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.16);
    min-width: 220px;
    overflow: hidden;
    z-index: 300;
    display: none;
}
.dropdown-menu.open {
    display: block;
}
/* ユーザー情報ヘッダー */
.dropdown-user-header {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    padding: 0.875rem 1rem;
}
.dropdown-user-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.dropdown-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9375rem;
    font-weight: 700;
    flex-shrink: 0;
}
.dropdown-user-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}
.dropdown-tenant-name {
    font-size: 0.6875rem;
    color: var(--muted);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* メニュー項目 */
.dropdown-item,
.dropdown-menu form button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.12s, color 0.12s;
    box-sizing: border-box;
}
.dropdown-item:hover,
.dropdown-menu form button:hover {
    background: #f3f4f6;
    color: var(--text);
}
.dropdown-menu svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    fill: currentColor;
    opacity: 0.7;
}
.dropdown-divider {
    border-top: 1px solid var(--border);
}
.dropdown-danger {
    color: #ef4444 !important;
}

/* ============================================================
   MAIN CONTENT
============================================================ */
.site-main {
    margin-top: var(--header-h);
    padding: 1.25rem 1rem;
    padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 1rem);
    min-height: calc(100vh - var(--header-h));
}

.pw-wrap {
    position: relative;
}
.pw-wrap .form-input {
    padding-right: 2.75rem;
}

/* ============================================================
   SIDEBAR（PCのみ）
============================================================ */
.sidebar {
    display: none;
}

/* ============================================================
   BOTTOM TABS
============================================================ */
.bottom-tabs {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 600;
    display: flex;
    background: #fff;
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
    height: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
    color: #9ca3af;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: color 0.12s;
    padding-top: 2px;
    -webkit-tap-highlight-color: transparent;
}
.tab-item svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}
.tab-item.active,
.tab-item:hover {
    color: var(--primary);
}

/* ============================================================
   PC / iPad（768px以上）
============================================================ */
@media (min-width: 768px) {
    .site-header {
        display: none;
    }
    .bottom-tabs {
        display: none;
    }
    .site-main {
        margin-top: 0;
        margin-left: var(--sidebar-w);
        padding: 2rem 2.5rem 2rem;
        transition: margin-left 0.25s ease;
    }
    body.sidebar-collapsed .site-main {
        margin-left: var(--sidebar-cw);
    }
    .inner-nav {
        top: 0;
        left: var(--sidebar-w);
        transition: left 0.25s ease;
    }
    body.sidebar-collapsed .inner-nav {
        left: var(--sidebar-cw);
    }
    .sidebar {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: var(--sidebar-w);
        background: #fff;
        border-right: 1px solid var(--border);
        z-index: 600;
        overflow: hidden;
        transition: width 0.25s ease;
    }
    body.sidebar-collapsed .sidebar {
        width: var(--sidebar-cw);
    }
    .sidebar-header {
        height: 64px;
        display: flex;
        align-items: center;
        padding: 0 0.5rem 0 1rem;
        flex-shrink: 0;
        position: relative;
    }
    .sidebar-logo {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        text-decoration: none;
        color: var(--primary);
        font-size: 1.2rem;
        font-weight: 800;
        letter-spacing: -0.5px;
        overflow: hidden;
        white-space: nowrap;
    }
    .sidebar-logo-icon {
        width: 26px;
        height: 26px;
        fill: var(--primary);
        flex-shrink: 0;
        transition: opacity 0.15s;
    }
    .sidebar-nav {
        flex: 1;
        padding: 0.5rem 0;
        overflow-y: auto;
        overflow-x: hidden;
    }
    .sidebar-link {
        display: flex;
        align-items: center;
        gap: 0.875rem;
        padding: 0.75rem 1rem;
        color: var(--muted);
        text-decoration: none;
        font-size: 0.9375rem;
        font-weight: 500;
        white-space: nowrap;
        overflow: hidden;
        transition:
            background 0.12s,
            color 0.12s;
        position: relative;
    }
    .sidebar-link:hover {
        background: #f3f4f6;
        color: var(--text);
    }
    .sidebar-link.active {
        background: var(--primary-light);
        color: var(--primary);
        font-weight: 600;
    }
    .sidebar-link svg {
        width: 22px;
        height: 22px;
        fill: currentColor;
        flex-shrink: 0;
    }

    .sidebar-footer {
        padding: 0.375rem 0;
        flex-shrink: 0;
    }
    .sidebar-tenant-name {
        padding: 0.375rem 1rem 0;
        font-size: 0.6875rem;
        font-weight: 500;
        color: var(--muted);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        opacity: 0.8;
        transition: opacity 0.2s ease;
    }
    body.sidebar-collapsed .sidebar-tenant-name {
        opacity: 0;
        pointer-events: none;
        height: 0;
        padding: 0;
    }
    .sidebar-user-menu {
        position: relative;
    }
    .sidebar-user-btn {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        width: 100%;
        padding: 0.75rem 1rem;
        background: none;
        border: none;
        cursor: pointer;
        color: var(--text);
        text-align: left;
        white-space: nowrap;
        overflow: hidden;
        position: relative;
        transition: background 0.12s;
    }
    .sidebar-user-btn:hover {
        background: #f3f4f6;
    }
    body.sidebar-collapsed .sidebar-user-btn {
        overflow: visible;
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
        gap: 0;
    }
    body.sidebar-collapsed .sidebar-user-btn::after {
        content: 'プロフィール';
        position: absolute;
        left: calc(100% + 8px);
        top: 50%;
        transform: translateY(-50%);
        background: #1f2937;
        color: #fff;
        padding: 0.25rem 0.625rem;
        border-radius: 6px;
        font-size: 0.8125rem;
        white-space: nowrap;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.15s;
        z-index: 700;
    }
    body.sidebar-collapsed .sidebar-user-btn:hover::after {
        opacity: 1;
    }
    .sidebar-avatar {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: var(--primary-light);
        color: var(--primary);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.875rem;
        font-weight: 700;
        flex-shrink: 0;
    }
    .sidebar-username {
        font-size: 0.9375rem;
        font-weight: 500;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .sidebar-dropdown {
        display: none;
        position: absolute;
        bottom: 100%;
        left: 0.5rem;
        right: 0.5rem;
        background: #fff;
        border: 1px solid var(--border);
        border-radius: 12px;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
        overflow: hidden;
        z-index: 700;
    }
    body.sidebar-collapsed .sidebar-dropdown {
        right: auto;
        width: calc(var(--sidebar-w) - 1rem);
    }
    .sidebar-dropdown.open {
        display: block;
    }
    .sidebar-dropdown a,
    .sidebar-dropdown form button {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 0.9375rem;
        font-weight: 500;
        color: var(--muted);
        text-decoration: none;
        background: none;
        border: none;
        cursor: pointer;
        text-align: left;
        white-space: nowrap;
        overflow: hidden;
        transition:
            background 0.12s,
            color 0.12s;
        box-sizing: border-box;
        font-family: inherit;
    }
    .sidebar-dropdown a:hover,
    .sidebar-dropdown form button:hover {
        background: #f3f4f6;
        color: var(--text);
    }
    .sidebar-dropdown svg {
        flex-shrink: 0;
        width: 18px;
        height: 18px;
        fill: currentColor;
        opacity: 0.7;
    }
    .sidebar-dropdown-divider {
        border-top: 1px solid var(--border);
    }
    .sidebar-danger {
        color: #ef4444 !important;
    }
    .sidebar-collapse-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        border-radius: 8px;
        background: none;
        border: none;
        cursor: pointer;
        color: var(--muted);
        flex-shrink: 0;
        margin-left: auto;
        position: relative;
        transition:
            background 0.12s,
            color 0.12s,
            opacity 0.15s;
    }
    .sidebar-collapse-btn:hover {
        background: #f3f4f6;
        color: var(--primary);
    }
    .sidebar-collapse-btn svg {
        width: 20px;
        height: 20px;
        fill: currentColor;
    }
    /* 展開時ツールチップ: 「サイドバーを閉じる」 */
    .sidebar-collapse-btn::after {
        content: 'サイドバーを閉じる';
        position: absolute;
        top: calc(100% + 6px);
        right: 0;
        background: #1f2937;
        color: #fff;
        padding: 0.25rem 0.625rem;
        border-radius: 6px;
        font-size: 0.8125rem;
        white-space: nowrap;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.15s;
        z-index: 700;
    }
    .sidebar-collapse-btn:hover::after {
        opacity: 1;
    }

    /* 折りたたみ時: ボタンを非表示、ロゴアイコンの上に重ねる */
    body.sidebar-collapsed .sidebar-collapse-btn {
        position: absolute;
        top: 50%;
        left: calc(var(--sidebar-cw) / 2);
        transform: translate(-50%, -50%);
        margin: 0;
        opacity: 0;
        pointer-events: none;
    }
    /* 折りたたみ時ツールチップ: 「サイドバーを開く」（サイドバー右に表示） */
    body.sidebar-collapsed .sidebar-collapse-btn::after {
        content: 'サイドバーを開く';
        top: 50%;
        right: auto;
        left: calc(100% + 8px);
        transform: translateY(-50%);
    }
    /* 折りたたみ時、サイドバーにホバー: ボタン表示・ロゴ非表示 */
    body.sidebar-collapsed .sidebar:hover .sidebar-collapse-btn {
        opacity: 1;
        pointer-events: auto;
    }
    body.sidebar-collapsed .sidebar:hover .sidebar-logo-icon {
        opacity: 0;
    }
    .sidebar-label {
        overflow: hidden;
        max-width: 160px;
        transition:
            max-width 0.25s ease,
            opacity 0.2s ease;
        opacity: 1;
    }
    body.sidebar-collapsed .sidebar-label {
        max-width: 0;
        opacity: 0;
    }
    body.sidebar-collapsed .sidebar-nav {
        overflow: visible;
    }
    body.sidebar-collapsed .sidebar-link {
        overflow: visible;
    }
    body.sidebar-collapsed .sidebar-link::after {
        content: attr(data-label);
        position: absolute;
        left: calc(100% + 8px);
        top: 50%;
        transform: translateY(-50%);
        background: #1f2937;
        color: #fff;
        padding: 0.25rem 0.625rem;
        border-radius: 6px;
        font-size: 0.8125rem;
        white-space: nowrap;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.15s;
        z-index: 700;
    }
    body.sidebar-collapsed .sidebar-link:hover::after {
        opacity: 1;
    }
}

/* ============================================================
   INNER NAV（詳細・登録・編集ページ）
============================================================ */
.inner-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    z-index: 150;
    height: 52px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.inner-nav-start {
    flex: 1;
    display: flex;
    align-items: center;
}
.inner-nav-center {
    position: absolute;
    left: 0;
    right: 0;
    text-align: center;
    font-weight: 700;
    font-size: 0.9375rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}
.inner-nav-end {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}
.inner-nav-back {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.125rem;
    padding: 0.375rem 0.25rem;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}
.inner-nav-save,
.inner-nav-action,
.inner-nav-edit {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.375rem 0.875rem;
    cursor: pointer;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

/* inner-nav の PC 位置調整（@stack('styles')より後に確実に適用） */
@media (min-width: 768px) {
    .inner-nav {
        top: 0 !important;
        left: var(--sidebar-w) !important;
        transition: left 0.25s ease;
    }
    body.sidebar-collapsed .inner-nav {
        left: var(--sidebar-cw) !important;
    }
}

/* inner-nav を持つページの site-main 調整 */
body:has(.inner-nav) .site-main {
    margin-top: calc(var(--header-h) + 52px) !important;
    padding-left: 0;
    padding-right: 0;
    padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 2rem);
}
@media (min-width: 768px) {
    body:has(.inner-nav) .site-main {
        margin-top: 52px !important;
        padding-left: max(1.5rem, calc((100% - 1000px) / 2));
        padding-right: max(1.5rem, calc((100% - 1000px) / 2));
        padding-bottom: 3rem;
    }
}
.site-main--flush {
    padding: 0 !important;
    min-height: 0 !important;
    display: flex;
    flex-direction: column;
    height: calc(100dvh - var(--header-h) - var(--tab-h) - env(safe-area-inset-bottom, 0px));
}
.site-main--flush .sticky-header {
    position: relative;
    top: auto;
    flex-shrink: 0;
    z-index: 101;
}
.site-main--flush .sticky-header .list-toolbar {
    position: relative;
    top: auto;
}
.list-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.list-scroll > .facility-list,
.list-scroll > .activity-list {
    padding-bottom: 1rem;
}
@media (min-width: 768px) {
    .site-main--flush {
        height: 100dvh;
    }
    .list-scroll {
        overflow-y: auto;
        flex: 1;
        min-height: 0;
    }
    .list-scroll > .facility-list,
    .list-scroll > .activity-list {
        padding-bottom: 2rem;
    }
}
.site-main--map {
    padding: 0 !important;
    overflow: hidden;
    height: calc(100dvh - var(--header-h) - var(--tab-h) - env(safe-area-inset-bottom, 0px));
}
@media (min-width: 768px) {
    .site-main--map {
        height: 100dvh !important;
        max-width: none !important;
        margin-top: 0 !important;
        margin-left: var(--sidebar-w) !important;
        transition: margin-left 0.25s ease;
    }
    body.sidebar-collapsed .site-main--map {
        margin-left: var(--sidebar-cw) !important;
    }
}

/* ============================================================
   FILTER PANEL 共通
============================================================ */
.filter-panel-handle {
    width: 36px;
    height: 4px;
    background: #d1d5db;
    border-radius: 2px;
    margin: 0.75rem auto 0;
}
.filter-panel-pc-header {
    display: none;
}
.filter-panel-body {
    padding: 1rem 1.25rem 2rem;
}
.filter-panel-mobile-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    text-align: center;
}
.filter-section {
    margin-bottom: 20px;
}
.filter-section-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #9ca3af;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 10px;
}
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.filter-chip {
    padding: 6px 14px;
    border-radius: 999px;
    border: 1.5px solid #d1d5db;
    background: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.12s;
}
.filter-chip.active {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}
.filter-apply-btn {
    display: block;
    width: 100%;
    padding: 0.9rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 8px;
    text-align: center;
    transition: background 0.15s;
    text-decoration: none;
}
.filter-apply-btn:hover {
    background: var(--primary-dark);
}
.filter-reset-link {
    display: block;
    text-align: center;
    margin-top: 0.875rem;
    color: var(--muted);
    font-size: 0.875rem;
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
    text-decoration: none;
    padding: 0;
}
@media (min-width: 768px) {
    #filterSheet.bottom-sheet {
        top: 0;
        right: 0;
        left: auto;
        bottom: 0;
        width: 300px;
        height: 100dvh;
        border-radius: 0;
        max-height: none;
        box-shadow: -2px 0 20px rgba(0, 0, 0, 0.14);
        transform: translateX(100%);
        z-index: 450;
        overflow-y: auto;
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .filter-panel-handle {
        display: none;
    }
    .filter-panel-mobile-title {
        display: none;
    }
    .filter-panel-pc-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 14px 10px;
        border-bottom: 1px solid #f3f4f6;
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 1;
    }
    .filter-panel-pc-title {
        font-size: 0.875rem;
        font-weight: 700;
        color: #374151;
    }
    .filter-panel-close {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        background: none;
        border: none;
        cursor: pointer;
        color: #6b7280;
        border-radius: 50%;
        transition: background 0.1s;
    }
    .filter-panel-close:hover {
        background: #f3f4f6;
    }
    .filter-panel-close svg {
        width: 18px;
        height: 18px;
        fill: currentColor;
    }
}

/* ============================================================
   共通ページタイトル
============================================================ */
.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}
@media (min-width: 768px) {
    .page-title {
        font-size: 1.5rem;
        margin-bottom: 1.75rem;
    }
}

/* ============================================================
   設定系ページ共通（Type B）
   基準: /admin/users
============================================================ */
.settings-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 0 calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 2rem);
}
@media (min-width: 768px) {
    .settings-page {
        padding-bottom: 3rem;
    }
}

/* ============================================================
   ページヘッダー（設定系ページ共通）
   .page-header > .page-header-back? + .page-header-title
   ※ タイトル＋アクションを並べる場合は .page-header-row を使う
============================================================ */
.page-header {
    display: flex;
    flex-direction: column;
    padding: 0 1rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}
.page-header-back {
    display: inline-flex;
    align-items: center;
    gap: 0.125rem;
    color: var(--primary);
    font-size: 1.0625rem;
    font-weight: 500;
    text-decoration: none;
    padding: 0.875rem 0 0;
    -webkit-tap-highlight-color: transparent;
}
.page-header-back svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
    flex-shrink: 0;
}
.page-header-back:active {
    opacity: 0.6;
}
.page-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.page-header-title {
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--text);
    padding: 0.5rem 0 1.25rem;
    line-height: 1.2;
    margin: 0;
}

/* ============================================================
   タブページ共通（Type A）
   基準: /admin/analytics
============================================================ */
.page-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem 1rem calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 2rem);
}
@media (min-width: 768px) {
    .page-wrapper {
        padding-bottom: 3rem;
    }
}

/* ============================================================
   詳細ページ共通（Type C）
   基準: /activities/xx
============================================================ */
.detail-main {
    margin-top: calc(var(--header-h) + 52px) !important;
    padding: 0.75rem 0 calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 2rem);
    background: #f5f5f7;
}
@media (min-width: 768px) {
    .detail-main {
        margin-top: 52px !important;
        padding-top: 0.75rem;
        padding-bottom: 2rem;
    }
}

/* ============================================================
   カード
============================================================ */
.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}
.card-body {
    padding: 1.25rem 1rem;
}
.card-head {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
    font-weight: 700;
    background: #fafafa;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ============================================================
   フォーム
============================================================ */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin-bottom: 1rem;
}
.form-group-separator {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
    margin-top: 0.5rem;
}
.form-section-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}
.form-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 0.375rem;
}
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    background: #f5f5f7;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text);
    transition:
        border-color 0.15s,
        background 0.15s;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 137, 123, 0.1);
}
.form-textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}
.form-input.is-error,
.form-select.is-error,
.form-textarea.is-error {
    border-color: #e53935;
}
.form-error {
    font-size: 0.8125rem;
    color: #dc2626;
    margin-top: 0.25rem;
}
.form-hint {
    font-size: 0.8125rem;
    color: var(--muted);
    margin-top: 0.25rem;
}

/* ============================================================
   ボタン
============================================================ */
.btn-primary {
    display: block;
    width: 100%;
    padding: 0.9rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: opacity 0.15s;
}
.btn-primary:hover {
    opacity: 0.9;
}
.btn-primary:disabled {
    opacity: 0.4;
    cursor: default;
}
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.625rem 1rem;
    background: #f3f4f6;
    color: #374151;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.1s;
}
.btn-secondary:hover {
    background: #e5e7eb;
}
.btn-secondary svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    flex-shrink: 0;
}
.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.625rem 1rem;
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.1s;
}
.btn-danger:hover {
    background: #fecaca;
}

/* ============================================================
   リスト行（設定系アイテム）
============================================================ */
.list-row {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem 1.125rem;
    min-height: 76px;
    text-decoration: none;
    color: inherit;
    transition: background 0.12s;
}
.list-row:not(:last-child) {
    border-bottom: 1px solid #f3f4f6;
}
.list-row:hover {
    background: #f9fafb;
}
.list-row-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.list-row-icon svg {
    width: 20px;
    height: 20px;
    fill: #fff;
}
.list-row-body {
    flex: 1;
    min-width: 0;
}
.list-row-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
}
.list-row-desc {
    font-size: 0.8125rem;
    color: var(--muted);
    margin-top: 2px;
}
.list-row-chevron {
    color: #d1d5db;
    flex-shrink: 0;
}
.list-row-chevron svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* ============================================================
   バッジ
============================================================ */
.badge {
    display: inline-block;
    padding: 0.2rem 0.625rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}
.badge-admin {
    background: #ecfdf5;
    color: #065f46;
}
.badge-staff {
    background: #eff6ff;
    color: #1d4ed8;
}

/* ============================================================
   トースト通知
============================================================ */
#toast-container {
    position: fixed;
    top: calc(var(--header-h) + 8px);
    left: 12px;
    right: 12px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
@media (min-width: 768px) {
    #toast-container {
        top: 16px;
        left: auto;
        right: 24px;
        width: 360px;
    }
}
.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    pointer-events: auto;
    opacity: 0;
    transform: translateY(-16px);
    transition:
        opacity 0.25s ease,
        transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.toast.toast-show {
    opacity: 1;
    transform: translateY(0);
}
.toast.toast-hide {
    opacity: 0;
    transform: translateY(-16px);
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}
.toast-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}
.toast-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}
.toast-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}
.toast-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}
.toast-icon {
    flex-shrink: 0;
    margin-top: 1px;
}
.toast-message {
    flex: 1;
}
.toast-close {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
}
.toast-close:hover {
    opacity: 1;
}

/* ============================================================
   管理タブボタン（bottom-tabs 内）
============================================================ */
.admin-tab-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* ============================================================
   管理メニュー ボトムシート
============================================================ */
.admin-menu-sheet {
    max-height: 50vh;
    overflow-y: auto;
}
.admin-menu-body {
    padding: 0.5rem 1.25rem 1rem;
}
.admin-menu-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 0.75rem;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
    transition: background 0.12s;
}
.admin-menu-item.active {
    background: var(--primary-light);
    color: var(--primary);
}
.admin-menu-item:not(.active):hover {
    background: #f3f4f6;
}
.admin-menu-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.admin-menu-item-icon svg {
    width: 20px;
    height: 20px;
    fill: #6b7280;
}

.admin-menu-item.active .admin-menu-item-icon {
    background: var(--primary);
}
.admin-menu-item.active .admin-menu-item-icon svg {
    fill: #fff;
}

/* ============================================================
   パスワードトグル（共通）
============================================================ */
.pw-wrap {
    position: relative;
}
.pw-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    padding: 0.25rem;
    display: flex;
    align-items: center;
}

/* ============================================================
   ログインページ
============================================================ */
.login-body {
    background: var(--primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
}
.login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.75rem;
}
.login-logo-icon {
    width: 56px;
    height: 56px;
    fill: #fff;
}
.login-logo-name {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
}
.login-logo-sub {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.75);
}
.login-card {
    background: #fff;
    border-radius: 20px;
    padding: 2rem 1.75rem 2.25rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
}
.login-field {
    margin-bottom: 1rem;
}
.login-field label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 0.375rem;
    padding-left: 0.25rem;
}
.login-input {
    width: 100%;
    background: #f5f5f7;
    border: none;
    border-radius: 10px;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text);
    outline: none;
    transition:
        background 0.15s,
        box-shadow 0.15s;
    -webkit-appearance: none;
    appearance: none;
}
.login-input:focus {
    background: #ebebf0;
    box-shadow: 0 0 0 2.5px rgba(0, 137, 123, 0.35);
}
.login-input.is-error {
    box-shadow: 0 0 0 2px #ef4444;
}
.login-input-pw {
    padding-right: 2.75rem;
}
.login-error {
    color: #ef4444;
    font-size: 0.8rem;
    margin-top: 0.375rem;
    padding-left: 0.25rem;
}
.login-session-error {
    margin-bottom: 1.25rem;
}
.login-reload-link {
    display: block;
    padding-left: 0.25rem;
    margin-top: 0.375rem;
    color: var(--primary);
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
}
.login-reload-link:hover {
    text-decoration: underline;
}
.login-card-desc {
    font-size: 0.8125rem;
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 1.25rem;
}
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 1rem 0 1.5rem;
    gap: 0.5rem;
}
.remember-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--muted);
    font-size: 0.8125rem;
}
input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}
.forgot-link {
    color: var(--primary);
    font-size: 0.8125rem;
    text-decoration: none;
    white-space: nowrap;
}
.forgot-link:hover {
    text-decoration: underline;
}
.forgot-wrap {
    text-align: center;
    margin-top: 1rem;
}
.btn-login {
    display: block;
    width: 100%;
    padding: 0.9375rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition:
        background 0.15s,
        transform 0.1s;
    letter-spacing: 0.05em;
}
.btn-login:hover {
    background: var(--primary-dark);
}
.btn-login:active {
    transform: scale(0.985);
}

/* ============================================================
   規約同意ページ
============================================================ */
.consent-body {
    background: var(--primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2.5rem 1.25rem 3rem;
}
.consent-card {
    background: #fff;
    border-radius: 20px;
    padding: 2rem 1.75rem;
    width: 100%;
    max-width: 520px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
}
.consent-heading {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.25rem;
}
.consent-intro {
    font-size: 0.8125rem;
    color: var(--muted);
    line-height: 1.5;
    margin-bottom: 0.375rem;
}
.consent-meta {
    font-size: 0.6875rem;
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 1.25rem;
    opacity: 0.75;
}
.consent-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.8125rem;
    color: #b91c1c;
}
.consent-error ul {
    margin: 0;
    padding-left: 1.25rem;
}
/* アコーディオン */
.consent-section {
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 0.625rem;
    overflow: hidden;
}
.consent-accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.875rem 1rem;
    background: none;
    border: none;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}
.consent-accordion-header:hover {
    background: #f9fafb;
}
.consent-section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}
.consent-accordion-icon {
    flex-shrink: 0;
    fill: var(--muted);
    transition: transform 0.25s ease;
}
.consent-section.is-open .consent-accordion-icon {
    transform: rotate(180deg);
}
.consent-accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.consent-section.is-open .consent-accordion-body {
    max-height: 216px;
}
.consent-text-area {
    height: 200px;
    overflow-y: scroll;
    border-top: 1px solid var(--border);
    padding: 0.875rem 1rem;
    font-size: 0.75rem;
    line-height: 1.7;
    color: #4b5563;
    background: #f9fafb;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db #f3f4f6;
}
.consent-text-area::-webkit-scrollbar {
    width: 6px;
}
.consent-text-area::-webkit-scrollbar-track {
    background: #f3f4f6;
}
.consent-text-area::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}
.consent-text-area p {
    margin-bottom: 0.75rem;
}
.consent-text-area p:last-child {
    margin-bottom: 0;
}
/* 単一チェックボックス */
.consent-check-label {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    user-select: none;
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}
.consent-checkbox {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
    accent-color: var(--primary);
    cursor: pointer;
}
.consent-submit-btn {
    display: block;
    width: 100%;
    padding: 0.9375rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}
.consent-submit-btn:disabled {
    background: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
}
.consent-submit-btn:not(:disabled):hover {
    background: var(--primary-dark);
}
.consent-submit-btn:not(:disabled):active {
    transform: scale(0.985);
}

/* ============================================================
   パスワードリセットページ
============================================================ */
.forgot-logo {
    color: #fff;
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
}
.forgot-card {
    background: #fff;
    border-radius: 20px;
    padding: 2rem 1.75rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
    text-align: center;
}
.forgot-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
    color: var(--primary);
}
.forgot-card h1 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.75rem;
}
.forgot-card p {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}
.forgot-back {
    display: inline-block;
    color: var(--primary);
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
}
.forgot-back:hover {
    text-decoration: underline;
}
.contact-chip--deleted {
    opacity: 0.55;
}
.contact-row--deleted {
    opacity: 0.65;
}
.contact-job--deleted {
    background: #fee2e2;
    color: #dc2626;
}

/* ============================================================
   月ナビゲーション共通（dashboard / activities）
============================================================ */
.month-nav {
    display: flex;
    align-items: center;
    gap: 0.125rem;
    flex-shrink: 0;
}
.month-nav--plain {
    justify-content: center;
    padding: 0.875rem 0;
}
.month-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    text-decoration: none;
    transition:
        background 0.15s,
        color 0.15s;
}
.month-nav-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}
.month-nav-btn:hover {
    background: rgba(0, 137, 123, 0.12);
    color: var(--primary);
}
.month-label {
    display: inline-block;
    padding: 0.3rem 0.875rem;
    background: #f3f4f6;
    border-radius: 20px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    user-select: none;
}
.month-picker-wrap {
    position: relative;
}
.month-picker-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    padding: 1rem;
    z-index: 200;
    min-width: 200px;
}
.month-picker-dropdown--wide {
    min-width: 260px;
}
.mp-data-range {
    font-size: 0.75rem;
    color: var(--muted);
    margin-bottom: 0.5rem;
    text-align: center;
}
.mp-range-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted);
}
.mp-range-selects {
    display: flex;
    gap: 0.5rem;
}
.mp-range-selects select {
    flex: 1;
}
.mp-reset-link {
    display: block;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--muted);
    text-decoration: none;
}
.mp-reset-link:hover {
    color: var(--primary);
}
.month-picker-dropdown.open {
    display: block;
}
.month-picker-dropdown form {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}
.month-picker-dropdown select {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    color: #374151;
    background: #fff;
    width: 100%;
    font-family: inherit;
}
.month-picker-go-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.15s;
}
.month-picker-go-btn:hover {
    opacity: 0.88;
}

/* ============================================================
   マイ活動ページ（dashboard）
============================================================ */
.ma-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}
.ma-body-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}
.ma-item--goal {
    grid-column: 1 / 3;
}
.ma-item--mine {
    grid-column: 1 / 2;
}
.ma-item--avg {
    grid-column: 2 / 3;
}
.ma-item--weekly {
    grid-column: 1 / 3;
}
.ma-item--cal {
    grid-column: 1 / 3;
}
@media (min-width: 768px) {
    .ma-body-grid {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: auto auto 1fr 1fr 1fr;
        gap: 1rem;
    }
    .ma-item--goal {
        grid-column: 1 / 5;
        grid-row: 1;
    }
    .ma-item--mine {
        grid-column: 1 / 2;
        grid-row: 2;
    }
    .ma-item--avg {
        grid-column: 2 / 3;
        grid-row: 2;
    }
    .ma-item--weekly {
        grid-column: 1 / 3;
        grid-row: 3 / 5;
        display: flex;
        flex-direction: column;
    }
    .ma-item--cal {
        grid-column: 3 / 5;
        grid-row: 2 / 5;
    }
    .ma-item--weekly .weekly-chart {
        flex: 1;
        height: auto;
        min-height: 120px;
    }
}
.ma-summary-card {
    background: #fff;
    border-radius: 16px;
    padding: 1.125rem 1rem 1rem;
    text-align: center;
    border: 1px solid var(--border);
}
.ma-summary-card .summary-num-wrap {
    justify-content: center;
}
.summary-card-label {
    font-size: 0.75rem;
    color: var(--muted);
    margin-bottom: 0.375rem;
    font-weight: 500;
}
.summary-card-num {
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1;
}
.summary-card-num.mine {
    color: var(--primary);
}
.summary-card-num.team {
    color: #1a73e8;
}
.summary-card-unit {
    font-size: 0.75rem;
    color: #9ca3af;
    padding-bottom: 0.2rem;
}
/* 月次目標カード（自分） */
.goal-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1rem 1.125rem;
}
.goal-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.625rem;
}
.goal-card-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
}
.goal-card-meta {
    font-size: 0.8125rem;
    color: var(--muted);
}
.goal-progress-bar {
    height: 8px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}
.goal-progress-fill {
    height: 100%;
    border-radius: 99px;
    background: var(--primary);
    transition: width 0.4s ease;
}
.goal-progress-fill.done {
    background: #1a73e8;
}
.goal-card-footer {
    font-size: 0.75rem;
    color: var(--muted);
    display: flex;
    justify-content: space-between;
}
.goal-remain {
    font-weight: 700;
    color: var(--primary);
}
.goal-remain.done {
    color: #1a73e8;
}
/* チーム目標カード */
.team-goal-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1rem 1.125rem;
}
.team-goal-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.team-goal-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
}
.team-goal-meta {
    font-size: 0.8125rem;
    color: var(--muted);
    white-space: nowrap;
}
.team-goal-counts {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}
.team-goal-num {
    font-size: 1.625rem;
    font-weight: 800;
    color: #1a73e8;
    line-height: 1;
}
.team-goal-num.empty {
    color: #d1d5db;
}
.team-goal-num-unit {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-left: 1px;
}
.team-goal-sep {
    font-size: 0.875rem;
    color: #d1d5db;
    margin: 0 0.25rem;
}
.team-goal-target {
    font-size: 0.875rem;
    color: var(--muted);
}
.team-goal-bar {
    height: 6px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 0.375rem;
}
.team-goal-fill {
    height: 100%;
    border-radius: 99px;
    background: #1a73e8;
    transition: width 0.4s ease;
}
.team-goal-fill.done {
    background: var(--primary);
}
.team-goal-footer {
    font-size: 0.75rem;
    color: var(--muted);
    display: flex;
    justify-content: space-between;
}
.team-goal-remain {
    font-weight: 700;
    color: #1a73e8;
}
.team-goal-remain.done {
    color: var(--primary);
}
.team-goal-no-data {
    color: #9ca3af;
}
.team-goal-set-link {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
/* 週別棒グラフ */
.weekly-chart-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1rem 1.125rem 1.25rem;
}
.weekly-chart-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1rem;
}
.weekly-chart {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    height: 140px;
}
.weekly-bar-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    height: 100%;
    justify-content: flex-end;
}
.weekly-bar-count {
    font-size: 0.75rem;
    font-weight: 700;
    color: #374151;
}
.weekly-bar-track {
    width: 100%;
    background: #f3f4f6;
    border-radius: 6px 6px 0 0;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    flex: 1;
}
.weekly-bar-fill {
    width: 100%;
    background: var(--primary);
    border-radius: 4px 4px 0 0;
    transition: height 0.4s ease;
    min-height: 2px;
}
.weekly-bar-label {
    font-size: 0.6875rem;
    color: #9ca3af;
    text-align: center;
    line-height: 1.2;
}
.weekly-bar-date {
    font-size: 0.625rem;
}
/* 活動カレンダー */
.cal-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1rem 1.125rem 1.25rem;
}
.cal-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 0.875rem;
}
.cal-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
}
.cal-active-days {
    font-size: 0.8125rem;
    color: var(--muted);
}
.cal-active-days strong {
    color: var(--primary);
    font-weight: 700;
}
.cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    margin-bottom: 3px;
}
.cal-weekday {
    text-align: center;
    font-size: 0.6875rem;
    color: #9ca3af;
    font-weight: 500;
    padding-bottom: 2px;
}
.cal-weekday.sun {
    color: #f87171;
}
.cal-weekday.sat {
    color: #60a5fa;
}
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}
.cal-cell {
    aspect-ratio: 1;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: 500;
    position: relative;
    text-decoration: none;
    cursor: pointer;
    transition:
        transform 0.1s,
        opacity 0.1s;
    -webkit-tap-highlight-color: transparent;
}
.cal-cell:hover {
    opacity: 0.8;
}
.cal-cell:active {
    transform: scale(0.9);
}
.cal-cell--empty {
    background: transparent;
}
.cal-cell--none {
    background: #f3f4f6;
    color: #d1d5db;
}
.cal-cell--today.cal-cell--none {
    background: #f3f4f6;
    color: #9ca3af;
    outline: 2px solid #d1d5db;
    outline-offset: -2px;
}
.cal-cell--lv1 {
    background: #d1fae5;
    color: #065f46;
}
.cal-cell--lv2 {
    background: #6ee7b7;
    color: #064e3b;
}
.cal-cell--lv3 {
    background: var(--primary);
    color: #fff;
}
.cal-cell--today.cal-cell--lv1,
.cal-cell--today.cal-cell--lv2,
.cal-cell--today.cal-cell--lv3 {
    outline: 2px solid #374151;
    outline-offset: -2px;
}
.cal-cell--future {
    background: #f9fafb;
    color: #d1d5db;
}

/* ============================================================
   分析ページ（admin/analytics）
============================================================ */
.analytics-header {
    margin-bottom: 1.25rem;
}
.analytics-header-csv {
    margin-left: auto;
}
.analytics-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text);
}
.analytics-header-bottom {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex-wrap: wrap;
    min-height: 36px;
}
.period-tabs {
    display: flex;
    background: #f3f4f6;
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
    flex-shrink: 0;
}
.period-tab {
    padding: 0.375rem 0.875rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    transition:
        background 0.15s,
        color 0.15s;
    white-space: nowrap;
}
.period-tab.active {
    background: #fff;
    color: var(--text);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.csv-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4rem 0.875rem;
    background: var(--primary);
    color: #fff;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.15s;
    white-space: nowrap;
}
.csv-btn:hover {
    opacity: 0.88;
}
.csv-btn svg {
    width: 15px;
    height: 15px;
    fill: #fff;
    flex-shrink: 0;
}
.analytics-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
@media (min-width: 640px) {
    .analytics-cards {
        gap: 1rem;
    }
}
/* サマリーグリッド */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}
@media (min-width: 640px) {
    .summary-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
/* カード共通ベース */
.summary-card,
.chart-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
}
.summary-card {
    padding: 1.125rem 1rem 1rem;
    text-align: center;
}
.chart-card {
    padding: 1.125rem 1.25rem;
}
.summary-label {
    font-size: 0.75rem;
    color: var(--muted);
    margin-bottom: 0.5rem;
    font-weight: 500;
}
.summary-num-wrap {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
    margin-bottom: 0.25rem;
}
.summary-num {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
}
.summary-unit {
    font-size: 0.75rem;
    color: #9ca3af;
    padding-bottom: 0.2rem;
}
.col-teal {
    color: var(--primary);
}
.col-blue {
    color: #1a73e8;
}
.col-green {
    color: #16a34a;
}
.col-red {
    color: #dc2626;
}
.charts-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}
@media (min-width: 640px) {
    .charts-row {
        grid-template-columns: 3fr 2fr;
        gap: 1rem;
    }
}
.chart-card-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1rem;
}
/* スタッフ棒グラフ */
.chart-card .staff-list {
    min-height: 13.5rem;
}
.chart-card .ranking-list {
    min-height: 10rem;
}
.list-empty-chart {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 0.875rem;
    text-align: center;
    padding: 1rem 0;
}
.staff-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.staff-row-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 0.3rem;
}
.staff-name {
    font-size: 0.875rem;
    color: #374151;
    font-weight: 500;
}
.staff-medal {
    margin-right: 0.25rem;
}
.staff-cnt {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--primary);
}
.staff-cnt.rank-other {
    color: #9ca3af;
    font-weight: 500;
}
.staff-bar-bg {
    height: 8px;
    background: #f3f4f6;
    border-radius: 99px;
    overflow: hidden;
}
.staff-bar-fill {
    height: 100%;
    border-radius: 99px;
    background: var(--primary);
    transition: width 0.5s ease;
}
.staff-bar-fill.rank-other {
    background: #d1d5db;
}
/* ドーナツ */
.donut-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}
.donut-svg-wrap {
    position: relative;
    width: 140px;
    height: 140px;
    flex-shrink: 0;
}
.donut-center-label {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.donut-center-num {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
}
.donut-center-unit {
    font-size: 0.6875rem;
    color: #9ca3af;
    margin-top: 2px;
}
.donut-legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.375rem 0.75rem;
    width: 100%;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: #374151;
}
.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
/* ランキング・紹介実績カード共通 */
.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}
.ranking-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.ranking-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--muted);
    flex-shrink: 0;
}
.ranking-row:nth-child(1) .ranking-num {
    background: #fef3c7;
    color: #92400e;
}
.ranking-row:nth-child(2) .ranking-num {
    background: #f3f4f6;
    color: #374151;
}
.ranking-row:nth-child(3) .ranking-num {
    background: #fde8d0;
    color: #7c3a0e;
}
.ranking-name {
    flex: 1;
    font-size: 0.875rem;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ranking-cnt {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}
.empty-chart {
    padding: 2rem 1rem;
    text-align: center;
    color: #9ca3af;
    font-size: 0.875rem;
}
/* 利用者紹介実績カード */
.referral-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.referral-card-header .chart-card-title {
    margin-bottom: 0;
}
.analytics-card-action {
    font-size: 0.8125rem;
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}
.analytics-card-action:hover {
    opacity: 0.75;
}
.ranking-link {
    color: inherit;
    text-decoration: none;
}
.ranking-link:hover {
    color: var(--primary);
    text-decoration: underline;
}
.referral-analytics-total {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}
.referral-analytics-num {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
}
.referral-analytics-unit {
    font-size: 0.875rem;
    color: var(--muted);
}
/* 月次目標設定 */
.goal-setting-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.125rem 1.25rem;
    margin-top: 0.75rem;
}
.goal-setting-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.875rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.goal-setting-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text);
}
.goal-current-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    background: #ecfdf5;
    color: #065f46;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 600;
}
.goal-form-row {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex-wrap: wrap;
}
.goal-form-label {
    font-size: 0.875rem;
    color: #374151;
    white-space: nowrap;
}
.goal-month-select,
.goal-count-input {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    color: var(--text);
    background: #fff;
    font-family: inherit;
}
.goal-month-select:focus,
.goal-count-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0, 137, 123, 0.15);
}
.goal-count-input {
    width: 80px;
}
.goal-count-unit {
    font-size: 0.875rem;
    color: var(--muted);
}
.goal-submit-btn {
    padding: 0.5rem 1.25rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.15s;
    white-space: nowrap;
}
.goal-submit-btn:hover {
    opacity: 0.88;
}
/* ユーティリティ */
.invisible {
    visibility: hidden;
}

/* ============================================================
   空状態
============================================================ */
.empty-state {
    padding: 3rem 1rem;
    text-align: center;
    color: #9ca3af;
    font-size: 0.9rem;
}
.empty-state svg {
    width: 48px;
    height: 48px;
    fill: #d1d5db;
    margin: 0 auto 0.75rem;
    display: block;
}
.empty-state p {
    font-size: 0.9375rem;
}

/* ============================================================
   リスト型ページ共通（activities/index, facilities/index）
============================================================ */
.site-main:has(.list-toolbar) {
    padding: 0;
}
.list-toolbar {
    position: sticky;
    top: var(--header-h);
    z-index: 100;
    background: #fff;
    padding: 0.75rem 1rem 0.5rem;
    display: flex;
    gap: 0.625rem;
    align-items: center;
}
@media (min-width: 768px) {
    .list-toolbar {
        top: 0;
    }
}
.list-search-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    padding: 0 12px;
    gap: 8px;
    height: 42px;
}
.list-search-wrap svg {
    width: 16px;
    height: 16px;
    fill: #9ca3af;
    flex-shrink: 0;
}
.list-search-wrap form {
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 0;
}
.list-search {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 1rem;
    color: var(--text);
    padding: 0;
    width: 100%;
}
.list-search::placeholder {
    color: #9ca3af;
}
.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #f8f9fa;
    border: 1px solid #e8eaed;
    border-radius: 50%;
    color: #5f6368;
    cursor: pointer;
    flex-shrink: 0;
    transition:
        background 0.12s,
        color 0.12s,
        border-color 0.12s;
}
.icon-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}
.icon-btn:hover {
    background: #f1f3f4;
}
.icon-btn.has-filter {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}
.filter-btn {
    width: 42px;
    height: 42px;
    background: #fff;
    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    color: #374151;
    transition:
        background 0.15s,
        color 0.15s;
}
.filter-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}
.filter-btn.has-filter {
    background: var(--primary);
    color: #fff;
}
.month-nav-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    height: 44px;
    padding: 0 1rem;
    background: #fff;
}
.list-sub-bar {
    padding: 0.375rem 1rem;
    font-size: 0.8125rem;
    color: var(--muted);
    background: #fafafa;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.list-date-label {
    margin-left: 0.5rem;
    color: var(--primary);
    font-weight: 600;
}
.list-clear-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}
.filter-date-input,
.filter-select {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    color: #374151;
    background: #fff;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}
.pagination-wrap {
    padding: 0.75rem 1rem calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 52px + 1.5rem);
    display: flex;
    justify-content: center;
    background: #f5f5f7;
}
@media (min-width: 768px) {
    .pagination-wrap {
        padding-bottom: 2rem;
    }
}
.pagination-wrap nav span,
.pagination-wrap nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    border-radius: 8px;
    font-size: 0.875rem;
    text-decoration: none;
    color: var(--text);
    border: 1px solid var(--border);
    margin: 0 0.125rem;
}
.pagination-wrap nav .active span {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ============================================================
   活動記録一覧
============================================================ */
.activity-list {
    padding: 0.75rem 0.875rem;
    padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 1rem);
    background: #f5f5f7;
}
@media (min-width: 768px) {
    .activity-list {
        padding-bottom: 2rem;
    }
}
.activity-row {
    display: flex;
    flex-direction: column;
    padding: 0.75rem 1rem;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
    margin-bottom: 0.625rem;
    text-decoration: none;
    color: var(--text);
    -webkit-tap-highlight-color: transparent;
    transition:
        box-shadow 0.15s,
        transform 0.12s;
}
@media (hover: hover) {
    .activity-row:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
        transform: translateY(-1px);
    }
}
.activity-row:active {
    transform: scale(0.98);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
/* 1行目: 日付・活動方法・反応バッジ */
.act-row-top {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-wrap: wrap;
    margin-bottom: 0.375rem;
}
.act-date {
    font-size: 0.8125rem;
    color: var(--muted);
    font-weight: 500;
    flex-shrink: 0;
    margin-right: 0.125rem;
}
/* 活動方法バッジ（反応バッジと形・サイズを統一） */
.act-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    background: #f0f4ff;
    color: #3730a3;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}
/* 2行目: 施設名 */
.act-facility-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* 3行目: 対応者（アイコン + バッジ群） */
.act-contacts {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.3rem;
}
.act-contacts-icon {
    width: 15px;
    height: 15px;
    fill: var(--muted);
    flex-shrink: 0;
    align-self: center;
}
.act-contacts-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
}
/* 一覧カード内の対応者チップ: メモ行と高さを揃えたコンパクト四角版 */
.act-contacts-chips .contact-chip {
    padding: 0 0.5rem;
    border-radius: 3px;
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.5;
}
.act-contacts-chips .contact-chip-job {
    font-size: 0.6875rem;
}
.act-contacts-extra {
    font-size: 0.75rem;
    color: var(--muted);
    align-self: center;
    padding: 0.1rem 0.25rem;
}
/* 不在時のグレーチップ */
.act-absent-chip {
    display: inline-flex;
    align-items: center;
    padding: 0 0.5rem;
    border-radius: 3px;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.5;
    background: #f3f4f6;
    color: var(--muted);
}
/* 4行目: 使用資料・メモ */
.act-memo {
    display: flex;
    align-items: flex-start;
    gap: 0.3rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--text);
    margin-bottom: 0.3rem;
}
.act-memo svg {
    width: 15px;
    height: 15px;
    fill: var(--muted);
    flex-shrink: 0;
    margin-top: 0.1rem;
}
.act-memo span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@media (min-width: 768px) {
    .act-memo span {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }
}
/* 区切り線 */
.act-divider {
    border: none;
    border-top: 1px solid #f3f4f6;
    margin: 0.5rem 0 0.375rem;
}
/* 記録者 */
.act-recorder {
    font-size: 0.75rem;
    color: #9ca3af;
}
/* 反応バッジ */
.reaction-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.625rem;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}
.reaction-badge .rdot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.badge-absent {
    background: #f3f4f6;
    color: #9ca3af;
}
.badge-r1 {
    background: #f3f4f6;
    color: #6b7280;
}
.badge-r2 {
    background: #eff6ff;
    color: #2563eb;
}
.badge-r3 {
    background: #fffbeb;
    color: #d97706;
}
.badge-r4 {
    background: #ecfdf5;
    color: #059669;
}

/* ============================================================
   サービス種別設定（admin/facility_types/index）
============================================================ */
.section-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #6b7280;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding-bottom: 0.4rem;
}
.type-card {
    margin-bottom: 1.5rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    overflow: hidden;
}
.type-item {
    border-bottom: 1px solid #f3f4f6;
}
.type-item:last-child {
    border-bottom: none;
}
.type-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem 0.875rem 0.75rem;
    cursor: default;
    user-select: none;
}
.drag-handle {
    color: #c4c9d4;
    cursor: grab;
    flex-shrink: 0;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    padding: 0.25rem;
}
.drag-handle:active {
    cursor: grabbing;
}
.drag-handle svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    display: block;
}
.type-move-btns {
    display: none;
}
.type-item--ghost {
    background: #f0f4f8;
    border-radius: 10px;
    opacity: 1;
}
.type-item--ghost * {
    visibility: hidden;
}
.color-swatch {
    width: 20px;
    height: 26px;
    flex-shrink: 0;
    display: block;
    overflow: visible;
    background: none;
    border: 0;
}
.type-name-text {
    flex: 1;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text);
}
.edit-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    cursor: pointer;
    color: #6b7280;
    transition:
        background 0.12s,
        color 0.12s;
    flex-shrink: 0;
}
.edit-toggle-btn:hover {
    background: #e5e7eb;
    color: var(--text);
}
.edit-toggle-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}
.type-edit-area {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    padding: 0 1rem;
    background: #f9fafb;
    border-top: 0px solid #e5e7eb;
    transition: max-height 220ms ease, opacity 200ms ease,
                padding 220ms ease, border-top-width 220ms ease;
}
.type-edit-area.open {
    max-height: 700px;
    opacity: 1;
    padding: 0.75rem 1rem 1rem;
    border-top-width: 1px;
}
.edit-fields {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.color-picker-wrap {
    position: relative;
    flex-shrink: 0;
}
.color-preview-btn {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: block;
    transition: transform 0.1s;
}
.color-preview-btn:active {
    transform: scale(0.93);
}
.color-picker-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}
.edit-name-input,
.add-name-input {
    flex: 1;
    padding: 0.625rem 0.875rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.9375rem;
    color: var(--text);
    background: #fff;
    font-family: inherit;
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
}
.edit-name-input:focus,
.add-name-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 137, 123, 0.12);
}
.edit-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}
.btn-save {
    padding: 0.5rem 1.25rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.15s;
}
.btn-save:hover {
    opacity: 0.88;
}

.btn-cancel {
    padding: 0.55rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #374151;
    background: #f3f4f6;
    border: none;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.12s;
}
.btn-cancel:hover {
    background: #e5e7eb;
}

.edit-actions .btn-cancel {
    padding: 0.5rem 1rem;
    background: #fff;
    color: #6b7280;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
}
.edit-actions .btn-cancel:hover {
    background: #f3f4f6;
}

.btn-delete {
    padding: 0.5rem 1rem;
    background: #fff;
    color: #dc2626;
    border: 1.5px solid #fecaca;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.12s;
    margin-right: auto;
}
.btn-delete:hover {
    background: #fef2f2;
}

.add-section-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #6b7280;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding-bottom: 0.4rem;
}

.add-card {
    background: #fff;
    border: 1.5px dashed #d1d5db;
    border-radius: 18px;
    padding: 1rem;
    transition: border-color 0.15s;
}
.add-card:focus-within {
    border-color: var(--primary);
    border-style: solid;
}
.add-fields {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.add-color-wrap {
    position: relative;
    flex-shrink: 0;
}
.add-color-preview {
    width: 30px;
    height: 38px;
    cursor: pointer;
    display: block;
    overflow: visible;
    background: none;
    border: 0;
    transition: transform 0.1s;
}
.add-color-preview:active {
    transform: scale(0.93);
}
.add-color-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.btn-add {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    transition: opacity 0.15s;
}
.btn-add:hover {
    opacity: 0.88;
}
.btn-add svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.type-item.dragging {
    opacity: 0.35;
}
.type-item.drag-over {
    background: #f0fdf4;
}

.empty-msg {
    padding: 2.5rem 1rem;
    text-align: center;
    color: #9ca3af;
    font-size: 0.9rem;
}

/* ---- サービス種別：ラベル付きフィールド行 ---- */
.edit-field-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.edit-field-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    min-width: 3em;
    flex-shrink: 0;
}

/* ---- サービス種別：ピン色トリガー ---- */
.pin-swatch-wrap {
    position: relative;
    flex-shrink: 0;
}
.pin-color-trigger,
.add-pin-trigger {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 8px;
    transition: background 0.12s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.pin-color-trigger:hover,
.add-pin-trigger:hover {
    background: #f3f4f6;
}
.pin-color-trigger svg,
.add-pin-trigger svg {
    width: 24px;
    height: 30px;
    display: block;
}
.pin-change-hint {
    font-size: 0.7rem;
    color: #9ca3af;
    white-space: nowrap;
    line-height: 1.2;
}

/* ---- サービス種別：スウォッチパネル ---- */
.swatch-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 100;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 0.75rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    min-width: 240px;
}
.swatch-panel.right {
    left: auto;
    right: 0;
}
.swatch-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}
.swatch-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2.5px solid transparent;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: transform 0.1s, border-color 0.1s;
}
.swatch-btn:hover { transform: scale(1.15); }
.swatch-btn.selected {
    border-color: #111;
    transform: scale(1.1);
}
.swatch-custom-btn {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    background: #f0fdf4;
    border: 1.5px dashed #6ee7b7;
    border-radius: 20px;
    padding: 0.25rem 0.625rem;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.12s;
    white-space: nowrap;
}
.swatch-custom-btn:hover { background: #d1fae5; }

/* ---- サービス種別：カスタムカラー展開エリア ---- */
.custom-color-expand {
    margin-top: 0.625rem;
    padding-top: 0.625rem;
    border-top: 1px solid #f3f4f6;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.custom-color-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.custom-color-row label {
    font-size: 0.75rem;
    color: #6b7280;
    min-width: 5em;
}
.custom-hex-picker {
    width: 36px;
    height: 28px;
    border: 1.5px solid #e5e7eb;
    border-radius: 6px;
    padding: 2px;
    cursor: pointer;
    flex-shrink: 0;
}
.custom-hex-text {
    flex: 1;
    font-size: 0.8125rem;
    font-family: monospace;
    padding: 0.3rem 0.5rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    color: var(--text);
}
.custom-hex-text:focus {
    outline: none;
    border-color: var(--primary);
}
.alpha-slider {
    flex: 1;
    accent-color: var(--primary);
}
.alpha-value {
    font-size: 0.75rem;
    color: #6b7280;
    min-width: 2.5em;
    text-align: right;
}

/* ---- サービス種別：編集ボタン行 ---- */
.edit-actions-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* ---- サービス種別：削除確認モーダル ---- */
.st-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
}
.st-modal {
    background: #fff;
    border-radius: 18px;
    padding: 1.5rem;
    width: 100%;
    max-width: 340px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}
.st-modal-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.625rem;
}
.st-modal-body {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 1.25rem;
    white-space: pre-line;
}
.st-modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}
.st-modal-cancel,
.st-modal-confirm {
    border: none;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    padding: 0.5rem 1rem;
}
.st-modal-cancel {
    background: #f3f4f6;
    color: #374151;
}
.st-modal-cancel:hover { background: #e5e7eb; }
.st-modal-confirm {
    background: #dc2626;
    color: #fff;
    padding-inline: 1.125rem;
}
.st-modal-confirm:hover { background: #b91c1c; }
.st-modal-confirm--primary { background: var(--primary); }
.st-modal-confirm--primary:hover { background: var(--primary-dark); }

/* ============================================================
   ピン表示の日付形式（admin/settings_pin_mode）
============================================================ */
.section-desc {
    padding-bottom: 1.25rem;
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.6;
}

.option-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.option-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.125rem;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    cursor: pointer;
    min-height: 110px;
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    box-sizing: border-box;
}
.option-card:hover {
    border-color: #9ca3af;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.option-card.selected {
    border-color: var(--primary);
    box-shadow:
        0 0 0 1px var(--primary),
        0 2px 8px rgba(0, 137, 123, 0.1);
}

.option-radio {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.pin-preview {
    width: 48px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 2px;
    flex-shrink: 0;
}

.option-body {
    flex: 1;
    min-width: 0;
}
.option-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.375rem;
}
.option-desc {
    font-size: 0.8125rem;
    color: #6b7280;
    line-height: 1.55;
}

.option-check {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
    transition:
        border-color 0.15s,
        background 0.15s;
}
.option-card.selected .option-check {
    border-color: var(--primary);
    background: var(--primary);
}
.option-check svg {
    width: 13px;
    height: 13px;
    fill: #fff;
    opacity: 0;
    transition: opacity 0.12s;
}
.option-card.selected .option-check svg {
    opacity: 1;
}

.save-row {
    padding-top: 1.5rem;
}
.save-btn {
    width: 100%;
    padding: 0.875rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition:
        opacity 0.15s,
        transform 0.1s;
}
.save-btn:hover {
    opacity: 0.9;
}
.save-btn:active {
    transform: scale(0.98);
}

/* ============================================================
   スタッフ管理（admin/users）
============================================================ */
.add-user-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.45rem 1rem;
    background: var(--primary);
    color: #fff;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity 0.15s;
    flex-shrink: 0;
}
.add-user-btn:hover {
    opacity: 0.88;
}
.add-user-btn svg {
    width: 16px;
    height: 16px;
    fill: #fff;
}

.search-bar {
    position: relative;
    margin-bottom: 1.25rem;
}
.search-bar svg {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    fill: #9ca3af;
    pointer-events: none;
}
.search-input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    border: 1px solid #e8eaed;
    border-radius: 24px;
    font-size: 1rem;
    color: var(--text);
    background: #fff;
    box-sizing: border-box;
    font-family: inherit;
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
}
.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 137, 123, 0.12);
}

.user-group-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #6b7280;
    letter-spacing: 0.05em;
    padding: 0 0.25rem;
    margin-bottom: 0.5rem;
}

.user-list {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.user-row {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    text-decoration: none;
    color: inherit;
    transition: background 0.12s;
}
.user-row:not(:last-child) {
    border-bottom: 1px solid #f3f4f6;
}
.user-row:hover {
    background: #f9fafb;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    flex-shrink: 0;
}
.avatar-admin {
    background: #ecfdf5;
    color: var(--primary);
}
.avatar-staff {
    background: #eff6ff;
    color: #1a73e8;
}

.user-info {
    flex: 1;
    min-width: 0;
}
.user-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-kana {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 1px;
}
.user-email {
    font-size: 0.75rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.user-role-badge {
    display: inline-block;
    padding: 0.2rem 0.625rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}
.badge-admin {
    background: #ecfdf5;
    color: #065f46;
}
.badge-staff {
    background: #eff6ff;
    color: #1d4ed8;
}

.user-chevron {
    color: #d1d5db;
    flex-shrink: 0;
}
.user-chevron svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* ============================================================
   スタッフ登録・編集フォーム（admin/users/create, edit）
============================================================ */

.user-form {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.125rem;
}

.required {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #fff;
    background: #e53935;
    padding: 1px 5px;
    border-radius: 4px;
}

.role-segment {
    display: flex;
    background: #f3f4f6;
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
}
.role-seg-item {
    flex: 1;
    position: relative;
    cursor: pointer;
}
.role-seg-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.role-seg-item span {
    display: block;
    text-align: center;
    padding: 0.5rem;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #6b7280;
    transition:
        background 0.15s,
        color 0.15s;
}
.role-seg-item.selected span,
.role-seg-item input:checked + span {
    background: #fff;
    color: var(--text);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-actions {
    display: flex;
    gap: 0.625rem;
    justify-content: flex-end;
    padding-top: 0.25rem;
}

.btn-submit {
    padding: 0.55rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff;
    background: var(--primary);
    border: none;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.15s;
}
.btn-submit:hover {
    opacity: 0.88;
}

/* ============================================================
   プロフィール編集（profile/edit）
============================================================ */
.profile-links {
    margin-top: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.profile-link-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text);
    font-size: 0.9375rem;
    font-weight: 500;
    transition: background 0.12s;
}
.profile-link-item:hover {
    background: #f9fafb;
}
.profile-link-item svg {
    width: 18px;
    height: 18px;
    fill: #9ca3af;
}

/* ============================================================
   活動記録フォーム（activities/create, edit）
============================================================ */
.form-hero {
    background: #fff;
    margin: 0 0.875rem;
    border-radius: 16px;
    padding: 1rem 1.125rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
}
.form-hero-facility {
    font-size: 1.1875rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.3;
    margin-bottom: 0.25rem;
}
.form-hero-meta {
    font-size: 0.8125rem;
    color: var(--muted);
}

.form-card {
    background: #fff;
    margin: 0.75rem 0.875rem 0;
    border-radius: 16px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
    overflow: hidden;
}

.form-row {
    padding: 0.875rem 1.125rem;
    border-bottom: 1px solid #e5e5ea;
}
.form-row:last-child {
    border-bottom: none;
}
.form-row-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 0.5rem;
    display: block;
}
.req {
    color: #ef4444;
    margin-left: 0.2rem;
}
.field-error {
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    color: #ef4444;
}

.dt-row {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.125rem;
    border-bottom: 1px solid #e5e5ea;
    gap: 0.75rem;
}
.dt-row:last-child {
    border-bottom: none;
}
.dt-icon {
    width: 32px;
    height: 32px;
    background: var(--primary-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.dt-icon svg {
    width: 17px;
    height: 17px;
    fill: var(--primary);
}
.dt-label {
    font-size: 0.9375rem;
    color: var(--text);
    font-weight: 500;
    flex-shrink: 0;
    min-width: 2.5rem;
}
.dt-input {
    flex: 1;
    text-align: right;
    border: none;
    background: transparent;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--primary-dark);
    font-family: inherit;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    min-width: 0;
}

.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: flex-start;
}
.chip-group > label {
    display: inline-flex;
    align-items: center;
}
.chip-group input[type="radio"] {
    display: none;
}
.chip-option {
    padding: 0.4375rem 1rem;
    border: 1.5px solid #d1d5db;
    border-radius: 999px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.1s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    color: var(--text);
}
.chip-group input[type="radio"]:checked + .chip-option {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
}

.absent-block {
    display: flex;
    flex-direction: column;
}
.absent-row-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.625rem;
}
.absent-row-desc {
    font-size: 0.8125rem;
    color: var(--muted);
}
.absent-block .toggle-switch {
    margin-bottom: 0.625rem;
}

/* ===== 共通トグルスイッチ ===== */
.toggle-switch {
    position: relative;
    width: 51px;
    height: 31px;
    flex-shrink: 0;
}
.toggle-switch input {
    display: none;
}
.toggle-slider {
    position: absolute;
    inset: 0;
    background: #e5e5ea;
    border-radius: 15.5px;
    cursor: pointer;
    transition: background 0.22s;
}
.toggle-slider::before {
    content: "";
    position: absolute;
    width: 27px;
    height: 27px;
    left: 2px;
    top: 2px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.22s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.22);
}
.toggle-switch input:checked + .toggle-slider {
    background: var(--primary);
}
.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

.contact-card-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.contact-card-list label:not(:last-of-type) .contact-card {
    border-bottom: 1px solid #e5e5ea;
}
.contact-card-list input[type="checkbox"] {
    display: none;
}
.contact-card {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 0;
    cursor: pointer;
    transition: background 0.1s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.contact-check {
    width: 24px;
    height: 24px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s;
    background: #fff;
}
.contact-card-list input[type="checkbox"]:checked + .contact-card .contact-check {
    background: var(--primary);
    border-color: var(--primary);
}
.contact-check-icon {
    display: none;
    width: 13px;
    height: 13px;
    fill: #fff;
}
.contact-card-list input[type="checkbox"]:checked + .contact-card .contact-check-icon {
    display: block;
}
.contact-card-info {
    flex: 1;
    min-width: 0;
}
.contact-card-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
}
.contact-card-job {
    display: inline-block;
    margin-top: 0.2rem;
    padding: 0.1rem 0.5rem;
    background: #f3f4f6;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
}
.contact-card-list input[type="checkbox"]:checked + .contact-card .contact-card-job {
    background: rgba(0, 137, 123, 0.12);
    color: var(--primary-dark);
}

.add-contact-toggle {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.75rem;
    color: var(--primary);
    font-size: 0.9375rem;
    font-weight: 500;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0;
    -webkit-tap-highlight-color: transparent;
}

.inline-contact-form {
    margin-top: 0.75rem;
    padding: 1rem;
    background: #f5f5f7;
    border-radius: 12px;
    display: none;
}
.inline-contact-form.open {
    display: block;
}
.inline-contact-form-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.75rem;
}
.inline-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background: #fff;
    border: 1.5px solid transparent;
    border-radius: 10px;
    font-size: 1rem;
    color: var(--text);
    outline: none;
    margin-bottom: 0.5rem;
    font-family: inherit;
    box-sizing: border-box;
}
.inline-input:focus {
    border-color: var(--primary);
}
.inline-chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 0.75rem;
    align-items: flex-start;
}
.inline-chip-group > label {
    display: inline-flex;
    align-items: center;
}
.inline-chip-group input[type="radio"] {
    display: none;
}
.inline-chip {
    padding: 0.3125rem 0.75rem;
    border: 1.5px solid #d1d5db;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    background: #fff;
    color: var(--text);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.1s;
}
.inline-chip-group input[type="radio"]:checked + .inline-chip {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.inline-actions {
    display: flex;
    gap: 0.5rem;
}
.inline-save-btn {
    flex: 1;
    padding: 0.625rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}
.inline-cancel-btn {
    padding: 0.625rem 1rem;
    background: #fff;
    color: var(--muted);
    border: none;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
}
.inline-error {
    font-size: 0.8125rem;
    color: #b91c1c;
    margin-bottom: 0.5rem;
    display: none;
}

/* ---- 選択済み対応者エリア ---- */
.selected-contacts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 0.75rem;
}
.selected-contacts:empty {
    margin-bottom: 0;
}
.selected-contact-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.3rem 0.5rem 0.3rem 0.75rem;
    background: var(--primary-light);
    border: 1.5px solid var(--primary);
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary-dark);
}
.selected-contact-chip--unknown {
    background: #fef9c3;
    border-color: #fde047;
    color: #713f12;
}
.selected-chip-name {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.selected-chip-job {
    font-size: 0.7rem;
    font-weight: 500;
    opacity: 0.75;
}
.selected-chip-remove {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0 0.1rem;
}
.selected-chip-remove:hover {
    opacity: 1;
}

/* ---- 氏名不明セクション ---- */
.unknown-contact-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.unknown-contact-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 0.5rem;
}
.unknown-contact-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}
.unknown-role-btn {
    padding: 0.375rem 0.875rem;
    background: #f3f4f6;
    color: var(--text);
    border: 1.5px solid #e5e7eb;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
}
.unknown-role-btn:active {
    background: #e5e7eb;
}

/* 表示用：氏名不明チップ */
.contact-chip--unknown {
    background: #fef9c3;
    color: #713f12;
}
.contact-chip--unknown .contact-chip-job {
    color: #92400e;
}

.reaction-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: flex-start;
}
.reaction-group > label {
    display: inline-flex;
    align-items: center;
}
.reaction-group input[type="radio"] {
    display: none;
}
.reaction-chip {
    padding: 0.4375rem 1rem;
    border: 1.5px solid #d1d5db;
    border-radius: 999px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.12s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
    color: var(--text);
}
.reaction-group input[value="1"]:checked + .reaction-chip {
    background: #f3f4f6;
    border-color: #6b7280;
    color: #6b7280;
    font-weight: 600;
}
.reaction-group input[value="2"]:checked + .reaction-chip {
    background: #eff6ff;
    border-color: #2563eb;
    color: #2563eb;
    font-weight: 600;
}
.reaction-group input[value="3"]:checked + .reaction-chip {
    background: #fffbeb;
    border-color: #d97706;
    color: #d97706;
    font-weight: 600;
}
.reaction-group input[value="4"]:checked + .reaction-chip {
    background: #ecfdf5;
    border-color: #059669;
    color: #059669;
    font-weight: 600;
}

.material-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: flex-start;
}
.material-group > label {
    display: inline-flex;
    align-items: center;
}
.material-group input[type="checkbox"] {
    display: none;
}
.material-chip {
    padding: 0.4375rem 1rem;
    border: 1.5px solid #d1d5db;
    border-radius: 999px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.1s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    color: var(--text);
}
.material-group input[type="checkbox"]:checked + .material-chip {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
}

.form-card .form-textarea {
    background: transparent;
    border: none;
    resize: none;
    min-height: 96px;
}

.form-save-wrap {
    padding: 1.25rem 0.875rem 0;
}
.page-wrapper .form-save-wrap {
    padding-left: 0;
    padding-right: 0;
}
.form-save-btn {
    width: 100%;
    padding: 1rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    letter-spacing: 0.01em;
}

.contact-section.hidden,
.reaction-section.hidden {
    display: none;
}

/* ============================================================
   活動記録詳細（activities/show）
============================================================ */
/* ---- 活動記録詳細 ---- */
.act-card {
    background: #fff;
    margin: 0 0.875rem;
    margin-bottom: 1rem;
    border-radius: 16px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
    overflow: hidden;
}
.act-card-header {
    padding: 1.25rem 1.125rem 1rem;
}
.act-card-facility {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text);
    text-decoration: none;
    line-height: 1.3;
}
.act-card-facility svg {
    color: var(--muted);
    flex-shrink: 0;
}
.act-card-date {
    display: flex;
    align-items: center;
    gap: 0.3125rem;
    font-size: 0.875rem;
    color: var(--muted);
    font-weight: 500;
    margin-top: 0.375rem;
}
.act-absent {
    color: var(--muted);
}
.act-row:last-child {
    border-bottom: none;
}
.act-row-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--muted);
    white-space: nowrap;
    flex-shrink: 0;
    padding-top: 0.125rem;
    min-width: 4rem;
}
.act-row-value {
    font-size: 0.9375rem;
    color: var(--text);
    line-height: 1.55;
    flex: 1;
}

.contact-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    background: var(--primary-light);
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin: 0.125rem;
}
.contact-chip-job {
    font-size: 0.7rem;
    color: var(--primary);
    font-weight: 500;
}

.material-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}
.material-chips .material-chip {
    padding: 0.25rem 0.625rem;
    background: #f3f4f6;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #374151;
    border: none;
}

.memo-text,
.info-value.memo-text {
    font-size: 0.9375rem;
    color: var(--text);
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
    overflow: visible;
    text-overflow: unset;
}

/* 削除ゾーン（activities/edit のみ） */
.delete-section {
    margin-top: 1.25rem;
    padding: 0 0.875rem;
}
.page-wrapper .delete-section {
    padding-left: 0;
    padding-right: 0;
}
.delete-trigger-btn {
    display: block;
    width: 100%;
    padding: 1rem;
    background: #fff;
    color: #ef4444;
    border: 1.5px solid #fca5a5;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
}
.delete-trigger-btn:active {
    background: #fee2e2;
}
.back-trigger-btn {
    display: block;
    width: 100%;
    padding: 1rem;
    background: #fff;
    color: #374151;
    border: 1.5px solid #e5e7eb;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}
.back-trigger-btn:active {
    background: #f3f4f6;
}

/* ============================================================
   施設詳細（facilities/show）
============================================================ */
.show-header-card {
    background: #fff;
    margin: 0rem 0.875rem 1rem;
    border-radius: 16px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
    padding: 1.25rem 1.125rem 1rem;
}
.facility-title {
    display: inline-flex;
    align-items: center;
    gap: 0.125rem;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.375rem;
    color: var(--text);
    text-decoration: none;
}
.facility-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 700;
}
.status-badge .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.badge-未接触 {
    background: #f3f4f6;
    color: #6b7280;
}
.badge-未接触 .dot {
    background: #9e9e9e;
}
.badge-接触済 {
    background: #dbeafe;
    color: #1d4ed8;
}
.badge-接触済 .dot {
    background: #1a73e8;
}
.badge-連携中 {
    background: #d1fae5;
    color: #065f46;
}
.badge-連携中 .dot {
    background: #00897b;
}

.service-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 600;
}
.priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    background: var(--color-priority-light);
    color: var(--color-priority);
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 600;
}

.info-section {
    background: #fff;
    margin: 0.625rem 0.875rem 0;
    border-radius: 16px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
    overflow: hidden;
}
.info-row {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border);
}
.info-row:last-child {
    border-bottom: none;
}
.info-icon {
    width: 20px;
    height: 20px;
    fill: var(--muted);
    flex-shrink: 0;
}
.info-content {
    flex: 1;
    min-width: 0;
}
.info-label {
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 500;
    margin-bottom: 0.125rem;
}
.info-value {
    font-size: 0.9375rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.info-value--wrap {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}
.info-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}
.info-map-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--primary);
    text-decoration: none;
}
.info-map-link:hover {
    text-decoration: underline;
}

.appoint-badge {
    display: inline-block;
    padding: 0.2rem 0.625rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
}
.appoint-必要 {
    background: #fee2e2;
    color: #b91c1c;
}
.appoint-不要 {
    background: #f3f4f6;
    color: var(--muted);
}
.appoint-未確認 {
    background: #fef3c7;
    color: #92400e;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem 0.5rem;
}
.section-header-title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.section-add-link {
    font-size: 0.875rem;
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    padding: 0.375rem 0.75rem;
    background: var(--primary-light);
    border-radius: 8px;
    -webkit-tap-highlight-color: transparent;
}

.facility-contact-section {
    margin: 0.75rem 0.875rem 0;
    padding: 0 0.75rem 0.75rem;
    background: #f5f5f7;
    border-radius: 16px;
    overflow: hidden;
}
.contact-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07);
    margin-bottom: 0.5rem;
}
.contact-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.contact-avatar svg {
    width: 20px;
    height: 20px;
    fill: var(--primary);
}
.contact-info {
    flex: 1;
    min-width: 0;
}
.contact-name {
    font-size: 0.9375rem;
    font-weight: 600;
}
.contact-job {
    display: inline-block;
    margin-top: 0.25rem;
    padding: 0.125rem 0.5rem;
    background: #f3f4f6;
    color: var(--muted);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}
.contact-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}
.contact-edit-btn {
    padding: 0.375rem 0.625rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    border-radius: 6px;
    background: var(--primary-light);
    -webkit-tap-highlight-color: transparent;
}
.contact-delete-btn {
    padding: 0.375rem 0.625rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #ef4444;
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}
.contact-empty {
    padding: 1.25rem 1rem;
    color: var(--muted);
    font-size: 0.875rem;
}

.memo-section {
    background: #fff;
    margin: 0.75rem 0.875rem 0;
    border-radius: 16px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
    padding: 1rem 1.125rem;
}
.memo-label {
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}
.memo-empty {
    font-size: 0.875rem;
    color: #d1d5db;
    font-style: italic;
}

.cta-section {
    padding: 1rem 0.875rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.75rem;
}
.cta-btn-primary,
.cta-btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.875rem;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}
.cta-btn-primary {
    background: var(--primary);
    color: #fff;
    border: none;
}
.cta-btn-secondary {
    background: #fff;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}
.cta-btn-primary svg,
.cta-btn-secondary svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    flex-shrink: 0;
}

.activity-section {
    margin: 0.75rem 0.875rem 0;
    padding: 0 0.75rem 0.75rem;
    background: #f5f5f7;
    border-radius: 16px;
    overflow: hidden;
}
.activity-item {
    padding: 0.875rem 1rem;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07);
    margin-bottom: 0.5rem;
    border-left: 3px solid var(--primary);
    transition:
        box-shadow 0.15s,
        transform 0.12s;
}
@media (hover: hover) {
    .activity-item:hover {
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.11);
        transform: translateY(-1px);
    }
}
.activity-item:active {
    transform: scale(0.99);
}
.activity-content {
    width: 100%;
}
.activity-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.125rem;
    margin-bottom: 0.25rem;
}
.activity-type {
    font-size: 0.875rem;
    font-weight: 600;
}
.activity-date {
    font-size: 0.75rem;
    color: var(--muted);
}
.activity-meta-row {
    display: flex;
    align-items: baseline;
    gap: 0.375rem;
    font-size: 0.8125rem;
    margin-bottom: 0.2rem;
}
.activity-meta-label {
    font-size: 0.7rem;
    color: var(--muted);
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}
.activity-meta-value {
    color: #374151;
    line-height: 1.4;
}
.activity-meta-row.contacts .activity-meta-value {
    color: var(--primary-dark);
    font-weight: 500;
}
.activity-note {
    font-size: 0.8125rem;
    color: #4b5563;
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-top: 0.25rem;
}
.activity-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.375rem;
}
.activity-author {
    font-size: 0.75rem;
    color: var(--muted);
}
.activity-edit-btn {
    font-size: 0.75rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--primary);
    border-radius: 6px;
    -webkit-tap-highlight-color: transparent;
}

.reaction-label {
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}
.reaction-1 {
    background: #f3f4f6;
    color: #6b7280;
}
.reaction-2 {
    background: #eff6ff;
    color: #2563eb;
}
.reaction-3 {
    background: #fffbeb;
    color: #d97706;
}
.reaction-4 {
    background: #ecfdf5;
    color: #059669;
}

.activity-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.875rem;
    background: #fff;
    border-bottom: 1px solid var(--border);
}

/* ============================================================
   施設登録・編集フォーム（facilities/create, edit）
============================================================ */
.form-section {
    background: #fff;
    margin: 0.75rem 0.875rem 0;
    border-radius: 16px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
    overflow: hidden;
}
.form-section-title {
    padding: 0.625rem 1rem;
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #fafafa;
    border-bottom: 1px solid var(--border);
}
.form-field {
    padding: 0.875rem 1.125rem;
    border-bottom: 1px solid var(--border);
}
.form-field:last-child {
    border-bottom: none;
}

.postal-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.postal-input {
    width: 130px;
    padding: 0.625rem 0.875rem;
    background: #f5f5f7;
    border: none;
    border-radius: 10px;
    font-size: 0.9375rem;
    outline: none;
    letter-spacing: 0.05em;
    font-family: inherit;
}
.postal-input:focus {
    background: #ededf0;
}
.postal-search-btn {
    padding: 0.625rem 0.875rem;
    background: var(--primary-light);
    color: var(--primary);
    border: none;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.1s;
}
.postal-search-btn:disabled {
    opacity: 0.5;
    cursor: default;
}
.postal-hint {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 0.375rem;
}

.map-pick-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.625rem;
    padding: 0.625rem 1rem;
    background: var(--primary-light);
    border: 1.5px solid #a3cbc7;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    font-family: inherit;
    transition:
        background 0.12s,
        border-color 0.12s;
}
.map-pick-btn:hover {
    background: #b2dfdb;
    border-color: var(--primary);
}
.map-pick-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    flex-shrink: 0;
}

.map-picker-overlay {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: none;
    flex-direction: column;
    background: #fff;
}
.map-picker-overlay.open {
    display: flex;
}
.map-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.75rem 0 1rem;
    height: 52px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.map-picker-title {
    font-size: 0.9375rem;
    font-weight: 700;
}
.map-picker-close {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0.375rem;
    display: flex;
    align-items: center;
    border-radius: 50%;
    transition: background 0.1s;
}
.map-picker-close:hover {
    background: #f3f4f6;
}
.map-picker-close svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}
#mapPickerMap {
    flex: 1;
    min-height: 0;
}
.map-picker-footer {
    padding: 0.875rem 1rem calc(0.875rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    flex-shrink: 0;
    background: #fff;
}
.map-picker-hint {
    font-size: 0.8125rem;
    color: #6b7280;
    text-align: center;
}
.map-picker-addr {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    text-align: center;
    min-height: 1.25em;
}
.map-picker-confirm {
    margin-top: 0.25rem;
    padding: 0.8rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 0.9375rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    width: 100%;
    transition: opacity 0.1s;
}
.map-picker-confirm:disabled {
    opacity: 0.45;
    cursor: default;
}
.map-picker-confirm:not(:disabled):hover {
    opacity: 0.88;
}

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.toggle-text {
    flex: 1;
}
.toggle-title {
    font-size: 0.9375rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}
.toggle-desc {
    font-size: 0.8125rem;
    color: var(--muted);
    margin-top: 0.125rem;
}

.facility-delete {
    padding: 0 1rem 2rem;
}

/* ============================================================
   施設一覧（facilities/index）
============================================================ */
.sticky-header {
    position: sticky;
    top: var(--header-h);
    z-index: 100;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}
@media (min-width: 768px) {
    .sticky-header {
        top: 0;
    }
}

.facility-search-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    padding: 0 12px;
    gap: 8px;
    height: 42px;
    position: relative;
}
.facility-search-wrap svg {
    width: 16px;
    height: 16px;
    fill: #9ca3af;
    flex-shrink: 0;
}
.facility-search-wrap form {
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 0;
}
.facility-search {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 1rem;
    color: var(--text);
    padding: 0;
    font-family: inherit;
    width: 100%;
}
.facility-search::placeholder {
    color: #9ca3af;
}

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #f8f9fa;
    border: 1px solid #e8eaed;
    border-radius: 50%;
    color: #5f6368;
    cursor: pointer;
    flex-shrink: 0;
    transition:
        background 0.12s,
        color 0.12s,
        border-color 0.12s;
}
.icon-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}
.icon-btn:hover {
    background: #f1f3f4;
}
.icon-btn.has-filter {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

.sort-chips-bar {
    display: flex;
    align-items: center;
    height: 44px;
    padding: 0 1rem;
    background: #fff;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.sort-chips-bar::-webkit-scrollbar {
    display: none;
}
.sort-chips {
    display: flex;
    gap: 0.5rem;
    width: max-content;
}
.sort-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.375rem 0.875rem;
    border-radius: 999px;
    border: 1.5px solid #dadce0;
    background: #fff;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #3c4043;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.12s;
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
}
.sort-chip:hover {
    background: #f8f9fa;
    border-color: #bdc1c6;
}
.sort-chip.active {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 700;
}
.sort-chip svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    flex-shrink: 0;
}

.facility-list {
    padding: 0.75rem 0.875rem;
    padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 1rem);
    background: #f5f5f7;
}
@media (min-width: 768px) {
    .facility-list {
        padding-bottom: 2rem;
    }
}
.facility-card {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
    margin-bottom: 0.625rem;
    color: var(--text);
    cursor: pointer;
    transition:
        box-shadow 0.15s,
        transform 0.12s;
    -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
    .facility-card:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
        transform: translateY(-1px);
    }
}
.facility-card:active {
    transform: scale(0.98);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.fac-icons {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: 18px;
    flex-shrink: 0;
}
.fac-icon-star {
    width: 16px;
    height: 16px;
    fill: var(--color-priority);
}
.fac-icon-bookmark {
    width: 15px;
    height: 15px;
    fill: var(--color-bookmark);
}

.facility-info {
    flex: 1;
    min-width: 0;
}
.facility-name {
    font-size: 0.9375rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}
.facility-meta {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.25rem;
    flex-wrap: wrap;
}
.service-chip {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.6875rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}
.apo-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffcc80;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}
.facility-address {
    flex-basis: 100%;
    font-size: 0.8125rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (min-width: 768px) {
    .facility-address {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }
}

.last-contact {
    font-size: 0.75rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.25rem;
}
.last-contact.overdue {
    color: #e53935;
    font-weight: 600;
}
.last-contact svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
    flex-shrink: 0;
}
.overdue-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    background: #fee2e2;
    color: #b91c1c;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 700;
    margin-left: 0.25rem;
}
.facility-map-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--primary);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
.facility-map-link svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
    flex-shrink: 0;
}
.facility-map-link:hover {
    text-decoration: underline;
}
.facility-chevron {
    width: 16px;
    height: 16px;
    fill: #d1d5db;
    flex-shrink: 0;
}

.fab-add {
    position: fixed;
    right: 1.25rem;
    bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 1rem);
    width: 52px;
    height: 52px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(0, 137, 123, 0.4);
    z-index: 100;
    -webkit-tap-highlight-color: transparent;
    transition:
        transform 0.12s,
        box-shadow 0.12s;
}
@media (min-width: 768px) {
    .fab-add {
        bottom: 1.5rem;
    }
}
.fab-add:active {
    transform: scale(0.94);
    box-shadow: 0 2px 8px rgba(0, 137, 123, 0.3);
}
.fab-add svg {
    width: 28px;
    height: 28px;
    fill: #fff;
}

/* ============================================================
   施設インポート（admin/facilities/import/*）
============================================================ */
.nav-back {
    display: inline-flex;
    align-items: center;
    gap: 0.125rem;
    color: var(--primary);
    font-size: 1.0625rem;
    font-weight: 500;
    text-decoration: none;
    padding: 0.875rem 1rem 0;
    -webkit-tap-highlight-color: transparent;
}
.nav-back svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
    flex-shrink: 0;
}
.nav-back:active {
    opacity: 0.6;
}

.page-heading {
    font-size: 1.625rem;
    font-weight: 700;
    color: #1f2937;
    padding: 0.25rem 1rem 1.25rem;
    line-height: 1.2;
}
.import-body {
    max-width: 800px;
    margin: 0 auto;
    padding-bottom: 4rem;
}
.import-body.padded {
    padding: 1.25rem 1rem;
}

.import-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    margin-bottom: 1rem;
    overflow: hidden;
}
.import-card-head {
    padding: 0.75rem 1rem;
    background: #fafafa;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.import-card-body {
    padding: 1.25rem 1rem;
}

.step-bar {
    display: flex;
    align-items: stretch;
    margin-bottom: 1.25rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}
.step-item {
    flex: 1;
    padding: 0.625rem 0.25rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.125rem;
}
.step-item:last-child {
    border-right: none;
}
.step-item.active {
    color: var(--primary);
    background: var(--primary-light);
}
.step-num {
    font-size: 0.6875rem;
}
.step-label {
    font-size: 0.6875rem;
    line-height: 1.3;
}

.error-box {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 10px;
    padding: 0.875rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #b91c1c;
}

/* index: ガイドセクション */
.guide-section {
    margin-bottom: 1.25rem;
}
.guide-section:last-child {
    margin-bottom: 0;
}
.guide-section-title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.625rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}
.guide-section-title .step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 800;
    flex-shrink: 0;
}
.sample-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 0.5rem;
}
.sample-table {
    border-collapse: collapse;
    font-size: 0.8125rem;
    white-space: nowrap;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    overflow: hidden;
}
.sample-table th {
    padding: 0.5rem 0.875rem;
    background: #e8f0fe;
    color: var(--primary);
    font-weight: 700;
    border-bottom: 2px solid #c7d8fc;
    border-right: 1px solid #d1d5db;
    text-align: left;
}
.sample-table th:last-child {
    border-right: none;
}
.sample-table td {
    padding: 0.5rem 0.875rem;
    border-bottom: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    color: #374151;
}
.sample-table td:last-child {
    border-right: none;
}
.sample-table tr:last-child td {
    border-bottom: none;
}
.sample-table .row-label {
    background: #fef9c3;
    color: #92400e;
    font-weight: 700;
    font-size: 0.6875rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
}
.field-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.field-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #374151;
}
.field-tag {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    font-size: 0.6875rem;
    font-weight: 700;
    border-radius: 4px;
    padding: 0.15em 0.45em;
    margin-top: 0.1em;
}
.field-tag.required {
    background: #fee2e2;
    color: #dc2626;
}
.field-tag.optional {
    background: #f3f4f6;
    color: #6b7280;
}
.hint-box {
    border-radius: 10px;
    padding: 0.75rem 0.875rem;
    font-size: 0.8125rem;
    line-height: 1.6;
}
.hint-box.blue {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}
.hint-box.yellow {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}
.hint-box p {
    margin: 0 0 0.375rem;
}
.hint-box p:last-child {
    margin-bottom: 0;
}
.hint-box strong {
    font-weight: 700;
}
.guide-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.25rem 0;
}

/* index: ドロップゾーン */
.drop-zone {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 2.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition:
        border-color 0.2s,
        background 0.2s;
    margin-bottom: 1.25rem;
}
.drop-zone.drag-over {
    border-color: var(--primary);
    background: var(--primary-light);
}
.drop-zone.has-file {
    border-style: solid;
    border-color: #34d399;
    background: #ecfdf5;
}
.drop-zone input[type="file"] {
    display: none;
}
.dz-default {
    transition: opacity 0.2s;
}
.drop-zone-icon {
    width: 48px;
    height: 48px;
    fill: #9ca3af;
    margin: 0 auto 0.75rem;
    display: block;
}
.drop-zone-text {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.375rem;
}
.drop-zone-sub {
    font-size: 0.8125rem;
    color: var(--muted);
}
.dz-selected {
    display: none;
}
.dz-selected-icon {
    width: 48px;
    height: 48px;
    fill: #10b981;
    margin: 0 auto 0.625rem;
    display: block;
}
.dz-selected-title {
    font-size: 1rem;
    font-weight: 700;
    color: #065f46;
    margin-bottom: 0.25rem;
}
.dz-selected-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #047857;
    background: #d1fae5;
    border-radius: 8px;
    padding: 0.375rem 0.875rem;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dz-selected-hint {
    font-size: 0.75rem;
    color: #059669;
    margin-top: 0.5rem;
}

/* mapping: フィールド割り当て */
.map-intro {
    padding: 0.875rem 1rem;
    background: #eff6ff;
    border-bottom: 1px solid #bfdbfe;
    font-size: 0.875rem;
    color: #1e40af;
    line-height: 1.6;
}
.map-row {
    padding: 1.125rem 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.map-row:last-child {
    border-bottom: none;
}
.map-label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.375rem;
}
.map-sublabel {
    font-size: 0.8125rem;
    color: var(--muted);
    margin-top: -0.5rem;
}
.badge-required {
    font-size: 0.6875rem;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 4px;
    padding: 0.1em 0.4em;
    font-weight: 700;
}
.col-field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}
.col-field-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #8e8e93;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0 0.125rem;
}
.col-select {
    width: 100%;
    padding: 0.8125rem 0.875rem;
    background: #f2f2f7;
    border: none;
    border-radius: 10px;
    font-size: 0.9375rem;
    color: #1c1c1e;
    outline: none;
    appearance: auto;
    cursor: pointer;
    font-family: inherit;
}
.col-select:focus {
    background: #e5e5ea;
}
.radio-cards {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.radio-card {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    border: 1.5px solid #e5e5ea;
    border-radius: 12px;
    cursor: pointer;
    transition:
        border-color 0.15s,
        background 0.15s;
    background: #fff;
}
.radio-card.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}
.radio-card input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}
.radio-card-text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.radio-card-main {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1c1c1e;
}
.radio-card-sub {
    font-size: 0.8125rem;
    color: #8e8e93;
}
.multi-col-area {
    display: none;
    flex-direction: column;
    gap: 0.625rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.875rem;
}
.multi-col-area.open {
    display: flex;
}
.multi-col-hint {
    font-size: 0.8125rem;
    color: var(--muted);
}
.col-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.col-checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.9375rem;
    cursor: pointer;
    padding: 0.25rem 0;
}
.col-checkbox-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}
.sort-list {
    list-style: none;
    padding: 0;
    margin: 0.375rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}
.sort-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: grab;
    user-select: none;
}
.sort-item.dragging {
    opacity: 0.5;
}
.sort-item-handle {
    color: #9ca3af;
    flex-shrink: 0;
}
.sub-area {
    display: none;
    flex-direction: column;
    gap: 0.5rem;
}
.sub-area.open {
    display: flex;
}
.import-body .field-error {
    display: none;
}
.import-body .field-error.visible {
    display: block;
}
.btn-next {
    width: 100%;
    padding: 0.9375rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.1s;
}
.btn-next:hover {
    opacity: 0.88;
}
.btn-back-full {
    display: block;
    width: 100%;
    padding: 0.875rem;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
    text-align: center;
    text-decoration: none;
    margin-top: 0.75rem;
    cursor: pointer;
    font-family: inherit;
}

/* preview: 確認画面 */
.summary-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.summary-card {
    flex: 1;
    min-width: 120px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.875rem 1rem;
    text-align: center;
}
.summary-card-num {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}
.summary-card-num.warn {
    color: #f59e0b;
}
.summary-card-unit {
    font-size: 0.875rem;
    font-weight: 600;
    margin-left: 0.125rem;
}
.summary-card-label {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 0.25rem;
}
.st-map-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}
.st-map-row:last-child {
    border-bottom: none;
}
.st-file-val {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    background: #f3f4f6;
    border-radius: 8px;
    padding: 0.375rem 0.625rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.st-arrow {
    color: var(--muted);
    flex-shrink: 0;
    font-size: 1.125rem;
}
.st-map-select {
    flex: 1.2;
    padding: 0.5rem 0.75rem;
    background: #f2f2f7;
    border: none;
    border-radius: 10px;
    font-size: 0.9375rem;
    color: #1c1c1e;
    outline: none;
    appearance: auto;
    min-width: 0;
    font-family: inherit;
}
.st-map-select:focus {
    background: #ededf0;
}
.st-map-select.error {
    border: 1.5px solid #ef4444;
    background: #fff5f5;
}
.preview-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
    min-width: 480px;
}
.preview-table th {
    padding: 0.625rem 0.875rem;
    background: #f9fafb;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    color: var(--muted);
    text-align: left;
    white-space: nowrap;
}
.preview-table td {
    padding: 0.625rem 0.875rem;
    border-bottom: 1px solid #f3f4f6;
    color: var(--text);
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.preview-table tr:last-child td {
    border-bottom: none;
}
.error-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.error-list li {
    padding: 0.625rem 1rem;
    border-bottom: 1px solid #fecaca;
    font-size: 0.8125rem;
    color: #b91c1c;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}
.error-list li:last-child {
    border-bottom: none;
}
.error-list li::before {
    content: "!";
    background: #ef4444;
    color: #fff;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 0.6875rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}
.btn-execute {
    width: 100%;
    padding: 0.875rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 0.9375rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.1s;
}
.btn-execute:hover {
    opacity: 0.88;
}
.btn-execute:disabled {
    opacity: 0.4;
    cursor: default;
}
.btn-back {
    display: block;
    width: 100%;
    padding: 0.75rem;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
    text-align: center;
    text-decoration: none;
    margin-top: 0.75rem;
    cursor: pointer;
    font-family: inherit;
}

/* 重複行 */
.dup-bulk-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.875rem;
}
.dup-bulk-btn {
    flex: 1;
    padding: 0.5rem 0.25rem;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid;
    font-family: inherit;
    transition: background 0.12s;
}
.dup-bulk-btn--skip {
    background: #fff7ed;
    color: #c2410c;
    border-color: #fed7aa;
}
.dup-bulk-btn--skip:hover {
    background: #fed7aa;
}
.dup-bulk-btn--register {
    background: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}
.dup-bulk-btn--register:hover {
    background: #bbf7d0;
}

.dup-row {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.dup-row:last-child {
    border-bottom: none;
}

.dup-badge-row {
    display: flex;
}
.dup-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.625rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    background: #fee2e2;
    color: #b91c1c;
}
.dup-badge--name {
    background: #fee2e2;
    color: #b91c1c;
}
.dup-badge--address {
    background: #fee2e2;
    color: #b91c1c;
}
.dup-badge--both {
    background: #fee2e2;
    color: #b91c1c;
}

.dup-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.625rem;
}
.dup-compare-col {
    min-width: 0;
}
.dup-compare-col--new {
    background: #f0fdf4;
    border-radius: 8px;
    padding: 0.625rem 0.75rem;
}
.dup-compare-col--existing {
    background: #fef2f2;
    border-radius: 8px;
    padding: 0.625rem 0.75rem;
}
.dup-compare-label {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.dup-compare-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.2rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dup-compare-addr {
    font-size: 0.75rem;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dup-action {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 0.75rem;
}
.dup-action-label {
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 10rem;
}
.dup-action-label input[type="radio"] {
    display: none;
}
.dup-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.4375rem 1rem;
    border-radius: 999px;
    font-size: 0.9375rem;
    font-weight: 500;
    border: 1.5px solid #d1d5db;
    transition:
        background 0.1s,
        color 0.1s,
        border-color 0.1s;
    cursor: pointer;
    white-space: nowrap;
    background: #fff;
    color: var(--text);
}
.dup-action-label input:checked + .dup-chip {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
}

.new-summary-pill {
    margin: 0 1rem 1rem;
    padding: 0.75rem 1rem;
    background: #f0fdf4;
    border-radius: 10px;
    font-size: 0.875rem;
    color: #166534;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.new-summary-pill svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    flex-shrink: 0;
}

/* ============================================================
   設定ページ（admin/settings）
============================================================ */
.settings-section {
    margin-bottom: 1rem;
}
.settings-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: #6b7280;
    letter-spacing: 0.05em;
    padding: 0 0.25rem;
    margin-bottom: 0.5rem;
}
.settings-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
}

/* ============================================================
   月次目標設定ページ
============================================================ */
.goal-setting-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    margin-bottom: 12px;
    overflow: hidden;
}
.goal-setting-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #9ca3af;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 1rem 1.25rem 0.625rem;
}

.goal-stepper-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 1rem 1.25rem 0.75rem;
}
.goal-stepper-btn {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: none;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition:
        background 0.1s,
        transform 0.08s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.goal-stepper-btn:active {
    background: #e5e7eb;
    transform: scale(0.91);
}
.goal-stepper-btn svg {
    width: 26px;
    height: 26px;
    fill: #374151;
}
.goal-stepper-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 110px;
}
.goal-stepper-num {
    font-size: 4.5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
    /* input reset */
    border: none;
    background: transparent;
    outline: none;
    text-align: center;
    width: 5ch;
    padding: 0;
    font-family: inherit;
    -moz-appearance: textfield;
    appearance: textfield;
}
.goal-stepper-num::-webkit-outer-spin-button,
.goal-stepper-num::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}
.goal-stepper-unit {
    font-size: 0.8125rem;
    color: #9ca3af;
    font-weight: 500;
    margin-top: 5px;
}
.goal-stepper-hint {
    text-align: center;
    font-size: 0.6875rem;
    color: #d1d5db;
    padding: 0 1.25rem 1rem;
}
.goal-submit-btn {
    display: block;
    width: 100%;
    padding: 1rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 1.75rem;
    transition:
        background 0.15s,
        transform 0.08s;
    -webkit-tap-highlight-color: transparent;
}
.goal-submit-btn:active {
    background: var(--primary-dark);
    transform: scale(0.98);
}
.goal-existing-header {
    font-size: 0.6875rem;
    font-weight: 700;
    color: #9ca3af;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0 0.25rem;
    margin-bottom: 8px;
}
.goal-existing-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.25rem;
}
.goal-existing-row + .goal-existing-row {
    border-top: 1px solid #f3f4f6;
}
.goal-existing-month {
    font-size: 0.9375rem;
    color: #1f2937;
    font-weight: 500;
}
.goal-existing-count-wrap {
    display: flex;
    align-items: baseline;
    gap: 2px;
}
.goal-existing-count {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary);
}
.goal-existing-unit {
    font-size: 0.75rem;
    font-weight: 500;
    color: #9ca3af;
}

.settings-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem 1.125rem;
    min-height: 76px;
    text-decoration: none;
    color: inherit;
    transition: background 0.12s;
}
.settings-item:not(:last-child) {
    border-bottom: 1px solid #f3f4f6;
}
.settings-item:hover {
    background: #f9fafb;
}
.settings-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.settings-item-icon svg {
    width: 20px;
    height: 20px;
    fill: #fff;
}
.icon-teal {
    background: var(--primary);
}
.icon-blue {
    background: #1a73e8;
}
.icon-orange {
    background: #fb8c00;
}
.icon-green {
    background: #43a047;
}
.settings-item-body {
    flex: 1;
    min-width: 0;
}
.settings-item-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1f2937;
}
.settings-item-desc {
    font-size: 0.8125rem;
    color: #6b7280;
    margin-top: 2px;
}
.settings-item-chevron {
    color: #d1d5db;
    flex-shrink: 0;
}
.settings-item-chevron svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* ============================================================
   地図ページ（map/index）
============================================================ */
#map {
    width: 100%;
    height: 100%;
    background: #e5e7eb;
}

.map-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: #f0faf9;
    color: #6b7280;
    text-align: center;
    padding: 2rem;
}
.map-placeholder svg {
    width: 64px;
    height: 64px;
    color: #9ca3af;
}
.map-placeholder p {
    font-size: 0.9375rem;
    line-height: 1.7;
}
.map-placeholder code {
    background: #e5e7eb;
    border-radius: 6px;
    padding: 0.2em 0.5em;
    font-size: 0.875rem;
    color: #374151;
}

.map-topbar {
    position: fixed;
    top: calc(var(--header-h) + 10px);
    left: 12px;
    right: 12px;
    z-index: 50;
    pointer-events: none;
    overflow: visible;
}
.map-topbar > * {
    pointer-events: auto;
}

.map-search-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.filter-btn {
    width: 42px;
    height: 42px;
    background: #fff;
    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    color: #374151;
    transition:
        background 0.15s,
        color 0.15s;
}
.filter-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}
.filter-btn.has-filter {
    background: var(--primary);
    color: #fff;
}

.quick-chips {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 2px;
    width: calc(100% + 24px);
    margin-left: -12px;
    padding-left: 12px;
    padding-right: 12px;
    box-sizing: border-box;
}
.quick-chips::-webkit-scrollbar {
    display: none;
}

.qchip {
    padding: 5px 12px;
    border-radius: 999px;
    border: 1.5px solid #d1d5db;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
    font-size: 0.8125rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.12s;
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
}
.qchip.selected {
    background: var(--chip-color, var(--primary));
    border-color: var(--chip-color, var(--primary));
    color: #fff;
    font-weight: 600;
}

.map-summary {
    position: fixed;
    left: 14px;
    bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 14px);
    background: #fff;
    border-radius: 14px;
    padding: 10px 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.14);
    z-index: 50;
    min-width: 100px;
}
.summary-label {
    font-size: 0.6875rem;
    color: #6b7280;
    margin-bottom: 2px;
}
.summary-value {
    display: flex;
    align-items: baseline;
    gap: 2px;
}
.summary-count {
    font-size: 1.625rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}
.summary-unit {
    font-size: 0.8125rem;
    color: #374151;
    font-weight: 600;
}

.sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
    background: rgba(0, 0, 0, 0.3);
    z-index: 400;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}
.sheet-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.bottom-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-radius: 20px 20px 0 0;
    z-index: 500;
    transform: translateY(110%);
    transition: transform 0.42s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
    touch-action: none;
}
#facilitySheet {
    height: calc(100dvh - var(--header-h) - var(--tab-h) - env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
#filterSheet {
    max-height: min(90dvh, calc(100dvh - var(--header-h) - var(--tab-h) - env(safe-area-inset-bottom, 0px)));
    overflow-y: auto;
    touch-action: auto;
}

.sheet-handle-wrap {
    padding: 14px 0 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s;
    border-radius: 20px 20px 0 0;
}
.sheet-handle-wrap:hover {
    background: #f9fafb;
}
.sheet-handle {
    width: 36px;
    height: 4px;
    background: #d1d5db;
    border-radius: 2px;
    transition:
        width 0.2s ease,
        background-color 0.15s;
}
.sheet-handle-wrap:hover .sheet-handle {
    width: 52px;
    background: #9ca3af;
}
.sheet-handle-wrap:active .sheet-handle {
    background: #6b7280;
}
#facilitySheet.fs-expanded .sheet-handle {
    width: 52px;
    background: #9ca3af;
}

.sheet-inner {
    padding: 16px 20px 24px;
}

.sheet-name {
    font-size: 1.1875rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 4px;
}
.sheet-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.sheet-type {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border: 1px solid rgba(156, 163, 175, 0.4);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    color: #6b7280;
    background: rgba(156, 163, 175, 0.1);
}

/* マップ用ステータスバッジ（直接背景色・白文字） */
.sheet-meta .status-badge {
    color: #fff;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
}
.status-untouched {
    background: #9e9e9e;
}
.status-contacted {
    background: #1a73e8;
}
.status-active {
    background: #00897b;
}
.status-inactive {
    background: #e53935;
}

.sheet-month-count {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    background: #f0fdf4;
    color: var(--primary);
    border: 1px solid #bbf7d0;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    margin-left: auto;
}
.sheet-month-count.zero {
    background: #f3f4f6;
    color: #9ca3af;
    border-color: #e5e7eb;
}

/* アポバナー（モバイル: パネル上部の帯、アポ必要時のみ表示） */
.sheet-apo-banner {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 0px 20px;
    color: #e65100;
    font-size: 0.875rem;
    font-weight: 600;
    flex-shrink: 0;
}
.sheet-apo-banner svg {
    width: 18px;
    height: 18px;
    fill: #e65100;
    flex-shrink: 0;
}

/* アポバッジ（PC: メタ行の下、アポ必要時のみ表示） */
.sheet-apo-pc {
    display: none;
    align-items: center;
    gap: 6px;
    margin-top: -8px;
    margin-bottom: 12px;
    padding: 5px 10px;
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffcc80;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    width: fit-content;
}
.sheet-apo-pc svg {
    width: 16px;
    height: 16px;
    fill: #e65100;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .sheet-apo-banner {
        display: none !important;
    }
}

.sheet-action-row {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    margin: 0 -20px 16px;
    padding: 0 20px 4px;
}
.sheet-action-row::-webkit-scrollbar {
    display: none;
}

.sab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 72px;
    height: 72px;
    min-width: 72px;
    border-radius: 14px;
    border: none;
    background: #f1f3f4;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #374151;
    text-decoration: none;
    cursor: pointer;
    flex-shrink: 0;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    transition:
        background 0.12s,
        color 0.12s;
    font-family: inherit;
}
.sab svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
    flex-shrink: 0;
}
.sab:active {
    background: #e2e4e5;
}
.sab.sab-hidden {
    display: none;
}
.sab.bookmarked {
    background: #e8f0fe;
    color: #1565c0;
}
.sab.prioritized {
    background: #fff3e0;
    color: #f57c00;
}

.sheet-register-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.9rem;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.15s;
    font-family: inherit;
}
.sheet-register-btn:hover {
    background: #00695c;
}
.sheet-register-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.sheet-activities-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 20px;
    border-top: 1px solid #e5e7eb;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    background: #f9fafb;
    transition: background 0.15s;
}
.sheet-activities-header:hover {
    background: #f0fdf9;
}
.sheet-activities-header:active {
    background: #d1fae5;
}
#facilitySheet.fs-expanded .sheet-activities-header {
    background: #fff;
    border-bottom: 1px solid #f3f4f6;
}

.sheet-activities-label {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.sheet-activities-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #374151;
}
.sheet-activities-hint {
    font-size: 0.6875rem;
    color: var(--primary);
    font-weight: 500;
    transition: opacity 0.2s;
}
#facilitySheet.fs-expanded .sheet-activities-hint {
    opacity: 0;
}

.chevron-icon {
    width: 20px;
    height: 20px;
    fill: #9ca3af;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: rotate(180deg);
}
#facilitySheet.fs-expanded .chevron-icon {
    transform: rotate(0deg);
}

.sheet-activities {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 20px 20px;
    touch-action: pan-y;
}

.sai {
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}
.sai:last-child {
    border-bottom: none;
}
.sai:active {
    background: #f9fafb;
    margin: 0 -12px;
    padding: 10px 12px;
}
/* 1行目: 活動方法バッジ（左）/ 日付（右） */
.sai-header {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.3rem;
    flex-wrap: nowrap;
}
.sai-header-left {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}
.sai-type {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    background: #f0f4ff;
    color: #3730a3;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}
.sai-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}
.sai-date {
    font-size: 0.75rem;
    color: #9ca3af;
    white-space: nowrap;
    flex-shrink: 0;
}
/* 2行目: 対応者 */
.sai-contacts {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 0.25rem;
}
.sai-icon {
    width: 15px;
    height: 15px;
    fill: var(--muted);
    flex-shrink: 0;
}
.sai-contact-chip {
    display: inline-flex;
    align-items: center;
    padding: 0 0.5rem;
    border-radius: 3px;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.5;
    background: var(--primary-light);
    color: var(--primary-dark);
}
.sai-absent-chip {
    display: inline-flex;
    align-items: center;
    padding: 0 0.5rem;
    border-radius: 3px;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.5;
    background: #f3f4f6;
    color: var(--muted);
}
.sai-contacts-extra {
    font-size: 0.75rem;
    color: var(--muted);
}
/* 3行目・4行目: 使用資料・メモ */
.sai-row-icon {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8125rem;
    color: var(--text);
    line-height: 1.5;
    margin-bottom: 0.2rem;
}
.sai-row-icon span {
    min-width: 0;
}
.sai-memo-trunc span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* 5行目: 記録者 */
.sai-footer {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.2rem;
}
.sai-empty,
.sai-loading {
    font-size: 0.875rem;
    color: #9ca3af;
    text-align: center;
    padding: 14px 0;
}

.panel-close-btn {
    display: none;
}

.myloc-btn {
    position: fixed;
    right: 12px;
    bottom: calc(var(--tab-h, 60px) + env(safe-area-inset-bottom, 0px) + 14px);
    width: 44px;
    height: 44px;
    background: #fff;
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 50;
    transition: box-shadow 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.myloc-btn:active {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.myloc-btn svg {
    width: 22px;
    height: 22px;
    fill: #5f6368;
    transition: fill 0.15s;
}
.myloc-btn.active svg {
    fill: #4285f4;
}

.pin-tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    pointer-events: none;
    z-index: 200;
    display: none;
    white-space: nowrap;
    transform: translateY(-50%);
}

@media (min-width: 768px) {
    .map-topbar {
        top: 10px;
        left: calc(var(--sidebar-w) + 12px);
        right: 12px;
        transition: left 0.25s ease;
    }
    body.sidebar-collapsed .map-topbar {
        left: calc(var(--sidebar-cw) + 12px);
    }
    .map-summary {
        bottom: 14px;
        left: calc(var(--sidebar-w) + 14px);
        transition: left 0.25s ease;
        padding: 14px 20px;
    }
    body.sidebar-collapsed .map-summary {
        left: calc(var(--sidebar-cw) + 14px);
    }
    .map-summary .summary-label {
        font-size: 0.8125rem;
        margin-bottom: 4px;
    }
    .map-summary .summary-count {
        font-size: 2.75rem;
    }
    .map-summary .summary-unit {
        font-size: 1rem;
    }
    .myloc-btn {
        bottom: 14px;
        right: 14px;
    }
    .sheet-overlay {
        bottom: 0;
        left: var(--sidebar-w);
        transition: left 0.25s ease;
    }
    body.sidebar-collapsed .sheet-overlay {
        left: var(--sidebar-cw);
    }
    .bottom-sheet {
        bottom: 0;
    }
    #facilitySheet {
        height: 100dvh;
    }

    .panel-close-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        border: none;
        border-radius: 8px;
        background: #f3f4f6;
        cursor: pointer;
        color: #6b7280;
        transition:
            background 0.12s,
            color 0.12s;
        flex-shrink: 0;
    }
    .panel-close-btn:hover {
        background: #e5e7eb;
        color: #1f2937;
    }
    .panel-close-btn svg {
        width: 18px;
        height: 18px;
        fill: currentColor;
        pointer-events: none;
    }

    #facilitySheet {
        top: 0;
        left: var(--sidebar-w);
        right: auto;
        bottom: 0;
        width: 320px;
        height: 100dvh;
        border-radius: 0;
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.14);
        transform: translateX(-100%);
        z-index: 450;
        touch-action: auto;
        transition:
            transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
            left 0.25s ease;
    }
    body.sidebar-collapsed #facilitySheet {
        left: var(--sidebar-cw);
    }
    #facilitySheet.fs-open {
        transform: translateX(0);
    }
    #facilitySheet .sheet-handle-wrap {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 14px 10px;
        border-radius: 0;
        border-bottom: 1px solid #f3f4f6;
        cursor: default;
        background: #fff;
    }
    #facilitySheet .sheet-handle-wrap:hover {
        background: #fff;
    }
    #facilitySheet .sheet-handle {
        display: none;
    }
    #facilitySheet .sheet-handle-wrap::before {
        content: "施設情報";
        font-size: 0.875rem;
        font-weight: 700;
        color: #374151;
    }
    #facilitySheet .sheet-activities-header {
        background: #f9fafb;
        cursor: default;
        pointer-events: none;
    }
    #facilitySheet .sheet-activities-header:hover,
    #facilitySheet .sheet-activities-header:active {
        background: #f9fafb;
    }
    #facilitySheet .sheet-activities-hint {
        display: none;
    }
    #facilitySheet .sheet-activities-header .chevron-icon {
        display: none;
    }
    #facilitySheet .sheet-inner {
        flex-shrink: 0;
    }
    #filterSheet {
        top: 0;
        right: 0;
        left: auto;
        bottom: 0;
        width: 300px;
        height: 100dvh;
        border-radius: 0;
        max-height: none;
        box-shadow: -2px 0 20px rgba(0, 0, 0, 0.14);
        transform: translateX(100%);
        z-index: 450;
        overflow-y: auto;
        touch-action: auto;
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }
    #filterSheet.fs-open {
        transform: translateX(0);
    }

    #sheetActivities {
        scrollbar-width: thin;
        scrollbar-color: #d1d5db transparent;
    }
    #sheetActivities::-webkit-scrollbar {
        width: 4px;
    }
    #sheetActivities::-webkit-scrollbar-track {
        background: transparent;
    }
    #sheetActivities::-webkit-scrollbar-thumb {
        background: #d1d5db;
        border-radius: 4px;
    }
}

/* ============================================================
   利用者紹介実績
============================================================ */

.referral-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--primary-light);
    border-bottom: 1px solid var(--border);
}
.referral-summary-label {
    font-size: 0.8125rem;
    color: var(--primary);
    font-weight: 600;
}
.referral-summary-count {
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--primary);
}

.referral-list {
    padding: 0.5rem 0;
}
.referral-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border);
}
.referral-item-main {
    flex: 1;
    min-width: 0;
}
.referral-item-facility {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.25rem;
}
.referral-item-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.referral-item-date {
    font-size: 0.8125rem;
    color: var(--muted);
}
.referral-item-count {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--primary);
}
.referral-item-memo {
    font-size: 0.8125rem;
    color: var(--muted);
    margin-top: 0.25rem;
}
.referral-item-edit {
    flex-shrink: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--primary);
    border-radius: 8px;
}
.referral-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}
.referral-add-wrap {
    padding: 1rem;
}
.referral-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.875rem;
    background: var(--primary);
    color: #fff;
    border-radius: 12px;
    font-size: 0.9375rem;
    font-weight: 700;
    text-decoration: none;
}

/* フォーム上部バリデーションエラーバナー */
.form-alert-error {
    padding: 0.875rem 1rem;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 0.875rem;
    border-bottom: 1px solid #fca5a5;
}
.form-alert-error ul {
    padding-left: 1.25rem;
    margin: 0.375rem 0 0;
}
.form-context-bar {
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    background: #fff;
}
.form-context-bar strong {
    font-weight: 600;
    color: var(--text);
}

/* ============================================================
   施設インポート ジオコーディング処理中ページ
============================================================ */
.geocode-processing-card {
    max-width: 480px;
    margin: 4rem auto;
    padding: 2.5rem 2rem;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    text-align: center;
}
.geocode-processing-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 1.25rem;
}
.geocode-processing-icon svg {
    width: 48px;
    height: 48px;
    fill: var(--primary);
    animation: geocodeSpin 1.2s linear infinite;
}
.geocode-processing-card h1 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
}
.geocode-processing-msg {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 1.75rem;
}
.geocode-processing-bar-wrap {
    height: 8px;
    background: #f3f4f6;
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 0.625rem;
}
.geocode-processing-bar {
    height: 100%;
    width: 0%;
    background: var(--primary);
    border-radius: 99px;
    transition: width 0.4s ease;
}
.geocode-processing-count {
    font-size: 0.875rem;
    color: var(--muted);
    margin-bottom: 1.5rem;
}
.geocode-processing-note {
    font-size: 0.875rem;
    color: var(--muted);
    margin-bottom: 1.25rem;
}
.geocode-processing-skip {
    display: inline-block;
    color: var(--primary);
    font-size: 0.875rem;
    text-decoration: none;
}
.geocode-processing-skip:hover {
    text-decoration: underline;
}
@keyframes geocodeSpin {
    to {
        transform: rotate(360deg);
    }
}

/* =============================================
   招待・パスワードリセット関連
   ============================================= */

/* フラッシュメッセージ */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}
.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}
.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}
.alert p { margin: 0; }

/* ユーザー行ラッパー（招待アクション含む） */
.user-row-wrap {
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.12s;
    cursor: pointer;
}
.user-row-wrap:last-child {
    border-bottom: none;
}
.user-row-wrap:hover {
    background: #f9fafb;
}
.user-row-wrap .user-row {
    border-bottom: none;
}
.user-row-wrap .user-row:hover {
    background: transparent;
}

/* 招待ステータス表示 */
.invitation-status {
    font-size: 0.7rem;
    margin-top: 2px;
}
.status-pending  { color: #b45309; }
.status-expired  { color: #dc2626; }
.status-revoked  { color: #6b7280; }

/* 招待アクションボタンエリア */
.invitation-actions {
    padding: 0 1rem 0.625rem 4.375rem;
}
.btn-invite-action {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: opacity 0.15s;
}
.btn-invite-action:active { opacity: 0.7; }
.btn-revoke {
    background: #fee2e2;
    color: #dc2626;
}
.btn-resend {
    background: #e0f2fe;
    color: #0369a1;
}

/* 招待確認画面カード */
.confirm-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.25rem 1rem;
    margin-bottom: 1.25rem;
}
.confirm-desc {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 1rem;
}
.confirm-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.confirm-row {
    display: flex;
    gap: 1rem;
    align-items: baseline;
}
.confirm-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #9ca3af;
    min-width: 7em;
    flex-shrink: 0;
}
.confirm-value {
    font-size: 0.9375rem;
    color: #111827;
    word-break: break-all;
}

/* ユーザー詳細画面 */
.user-detail-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.25rem 1rem;
    margin-bottom: 1rem;
    position: relative;
}
.user-detail-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.375rem;
    font-weight: 700;
    flex-shrink: 0;
}
.user-detail-info {
    flex: 1;
    min-width: 0;
}
.user-detail-name {
    font-size: 1.0625rem;
    font-weight: 700;
    color: #111827;
}
.user-detail-kana {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 1px;
}
.user-detail-email {
    font-size: 0.8125rem;
    color: #6b7280;
    margin-top: 4px;
    word-break: break-all;
}
.user-detail-section {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}
.user-detail-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #9ca3af;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.user-detail-actions {
    margin-bottom: 1rem;
}

/* ===== ユーザー退職ステータス ===== */
.user-group-label--retired {
    color: var(--muted);
}
.user-row--retired {
    opacity: 0.75;
}
.avatar-retired {
    background: #e5e7eb;
    color: #9ca3af;
}
.badge-retired {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    white-space: nowrap;
}
.user-status-retired {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 600;
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
    margin-left: 0.375rem;
    vertical-align: middle;
}

/* ============================================================
   不在の取り扱い設定（admin/settings/absence）
============================================================ */
.toggle-setting-list {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}
.toggle-setting-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.125rem 1.125rem;
}
.toggle-setting-item + .toggle-setting-item {
    border-top: 1px solid #f0f0f0;
}
.toggle-setting-body {
    flex: 1;
    min-width: 0;
}
.toggle-setting-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.25rem;
}
.toggle-setting-desc {
    font-size: 0.8125rem;
    color: var(--muted);
    line-height: 1.55;
}
.setting-toggle {
    flex-shrink: 0;
}
