.agency-header {
            background: #fff;
            padding: 10px 0;
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
            height: fit-content;
        }
        .agency-header-container {
            display: flex;
            align-items: center;
            justify-content: space-around;
            padding: 0 20px;
            /* gap: 30px; */
        }

        @media (max-width: 768px) {
            .agency-header-container {
                flex-direction: column;
                align-items: flex-start;
                justify-content: flex-start;
                gap: 10px;
                padding: 0 10px;
            }
            .agency-header-container .left-bar {
                width: 100%!important;
                justify-content: center;
            }

            .agency-header-container .right-bar {
                width: 100%!important;
                justify-content: center;
                flex-direction: row-reverse;
            }

            .agency-logo {
                width: 100px!important;
            }
        }

        .agency-header-container .left-bar {
            display: flex;
            align-items: center;
            gap: 20px;
            width: auto;
        }

        .agency-header-container .right-bar {
            display: flex;
            align-items: center;
            justify-content: space-around;
            gap: 20px;
        }

        .agency-logo {
            display: flex;
            flex-direction: column;
            text-decoration: none;
            flex-shrink: 0;
            width: 120px;
        }
        .agency-logo-main {
            font-size: 28px;
            font-weight: bold;
            color: #4A8EE3;
            letter-spacing: 1px;
            line-height: 1;
        }
        .agency-logo-sub {
            font-size: 10px;
            font-weight: 400;
            color: #999;
            letter-spacing: 0.5px;
            margin-top: 2px;
            text-transform: uppercase;
        }
        .agency-nav {
            display: flex;
            gap: 30px;
            align-items: center;
            flex: 1;
        }
        .agency-nav a {
            color: #666;
            text-decoration: none;
            font-weight: 500;
            font-size: 15px;
            padding: 8px 0;
            transition: color 0.3s;
            white-space: nowrap;
        }
        .agency-nav a:hover {
            color: #4A8EE3;
        }
        .agency-nav a.active {
            color: #4A8EE3;
        }
        .agency-nav-divider {
            width: 1px;
            height: 20px;
            background: #ddd;
            flex-shrink: 0;
        }
        .agency-officedb-dropdown {
            position: relative;
        }
        .agency-officedb-menu {
            display: none;
            position: absolute;
            top: 100%;
            left: 0;
            background: white;
            border: 1px solid #ddd;
            border-radius: 4px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
            min-width: 210px;
            margin-top: 5px;
            z-index: 1000;
        }
        .agency-officedb-menu.show {
            display: block;
        }
        .agency-officedb-menu a {
            display: block;
            padding: 10px 15px !important;
            border-bottom: none !important;
        }
        .agency-officedb-menu a:hover {
            background: #f5f5f5;
        }
        .agency-search {
            position: relative;
            flex: 1;
            max-width: 400px;
        }
        .agency-search input {
            width: 100%;
            padding: 10px 15px 10px 40px;
            border: 1px solid #ddd;
            border-radius: 6px;
            font-size: 15px;
            transition: border-color 0.3s;
        }
        .agency-search input:focus {
            outline: none;
            border-color: #4A8EE3;
        }
        .agency-search-icon {
            position: absolute;
            left: 12px;
            top: 50%;
            transform: translateY(-50%);
            color: #999;
            font-size: 16px;
        }
        .agency-header-right {
            display: flex;
            align-items: center;
            gap: 15px;
            flex-shrink: 0;
        }
        .signup-gift-badge {
            display: inline-flex;
            flex-direction: column;
            align-items: flex-start;
            gap: 1px;
            background: #FFF6E8;
            color: #C2410C;
            border: 1px solid #F3C07A;
            border-radius: 8px;
            padding: 4px 10px;
            font-size: 13px;
            font-weight: 700;
            line-height: 1.25;
            white-space: nowrap;
        }
        .signup-gift-badge[hidden] {
            display: none !important;
        }
        .signup-gift-expiry {
            font-size: 11px;
            font-weight: 600;
        }
        .signup-gift-expiry[hidden] {
            display: none !important;
        }
        .notifications-icon {
            position: relative;
            font-size: 22px;
            color: #333;
            text-decoration: none;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 32px;
            height: 32px;
        }
        .notifications-icon:hover,
        .notifications-icon.active,
        .notifications-icon.is-open {
            color: #4A8EE3;
        }
        .notifications-badge {
            position: absolute;
            top: -6px;
            right: -9px;
            background: #dc3545;
            color: white;
            border-radius: 9px;
            min-width: 18px;
            height: 18px;
            padding: 0 5px;
            box-sizing: border-box;
            font-size: 10px;
            line-height: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
        }
        /* ナビの未読・未対応の数字：文字の右に並べる（ヘッダーからはみ出さない） */
        .agency-nav-badge {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 18px;
            height: 18px;
            padding: 0 5px;
            margin-left: 6px;
            box-sizing: border-box;
            border-radius: 9px;
            background: #dc3545;
            color: #fff;
            font-size: 11px;
            font-weight: bold;
            line-height: 1;
            vertical-align: 1px;
        }
        .user-icon {
            font-size: 24px;
            color: #333;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 32px;
            height: 32px;
        }
        .user-dropdown {
            position: relative;
        }
        .user-dropdown-toggle {
            display: flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
            padding: 4px 8px;
            border-radius: 4px;
            transition: background 0.3s;
        }
        .user-dropdown-toggle:hover {
            background: #f5f5f5;
        }
        .user-dropdown-arrow {
            font-size: 10px;
            color: #666;
            margin-top: 2px;
        }
        .dropdown-indicator {
            position: absolute;
            top: -8px;
            right: -8px;
            font-size: 10px;
            color: #666;
            cursor: pointer;
            padding: 4px;
            z-index: 10;
        }
        .agency-header {
            position: relative;
        }
        /* PC画面ではヘッダーを画面上部に固定する。ドロップダウンの位置決めに
           position:relative が要るため、fixedと両立できるよう子要素側で吸収する。 */
        @media (min-width: 769px) {
            .agency-header {
                position: fixed;
                top: 0;
                left: 0;
                right: 0;
                z-index: 1000;
            }
            body {
                margin-top: 0;
                /* .agency-header の実測高さ（chat.css の --agency-header-h と同じ値） */
                padding-top: 76px;
            }
        }
        .user-dropdown-menu {
            position: absolute;
            top: 100%;
            right: 0;
            background: white;
            border: 1px solid #ddd;
            border-radius: 4px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
            min-width: 200px;
            margin-top: 5px;
            display: none;
            z-index: 1000;
        }
        .user-dropdown-menu.show {
            display: block;
        }
        .user-dropdown-menu a {
            display: block;
            padding: 10px 15px;
            color: #333;
            text-decoration: none;
            transition: background 0.3s;
        }
        .user-dropdown-menu a:hover {
            background: #f5f5f5;
        }
        .agency-content {
            min-height: calc(100vh - 100px);
            padding: 30px 0;
        }
        @media (max-width: 768px) {
            .agency-header-container {
                flex-wrap: wrap;
            }
            .agency-search {
                order: 3;
                width: 100%;
                max-width: 100%;
            }
        }

        /* ---------- スマホ表示ヘッダー：ハンバーガーメニュー ----------
           このブレークポイント用の見た目は、上のルールをまとめてここで
           上書きする（1行のヘッダーに「ベル／メニュー／事務所アイコン」
           を並べ、ナビはハンバーガーの中に畳む）。 */
        .agency-menu-toggle {
            display: none;
            background: none;
            border: none;
            padding: 0;
            width: 32px;
            height: 32px;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            color: #333;
            cursor: pointer;
        }
        .agency-icon-thumb {
            display: none;
            width: 32px;
            height: 32px;
            border-radius: 50%;
            object-fit: cover;
            background: #f0f0f0;
        }
        @media (max-width: 768px) {
            .agency-header-container {
                flex-direction: row;
                flex-wrap: nowrap;
                align-items: center;
                justify-content: space-between;
                gap: 8px;
                padding: 0 12px;
                position: relative;
            }
            .agency-header-container .left-bar {
                width: auto !important;
                justify-content: flex-start;
                gap: 0;
            }
            .agency-header-container .right-bar {
                width: auto !important;
                justify-content: flex-end;
                flex-direction: row;
            }
            .agency-logo {
                width: 90px !important;
            }
            .agency-header-right {
                gap: 10px;
            }
            .signup-gift-badge {
                font-size: 11px;
                padding: 3px 8px;
            }
            .signup-gift-expiry {
                font-size: 10px;
            }
            /* ナビはハンバーガーで開閉するドロップダウンパネルに */
            .agency-nav {
                display: none;
                position: absolute;
                top: 100%;
                left: 0;
                right: 0;
                flex-direction: column;
                align-items: stretch;
                gap: 0;
                background: #fff;
                padding: 4px 20px 12px;
                box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
                z-index: 999;
            }
            .agency-nav.is-open {
                display: flex;
            }
            .agency-nav a {
                padding: 12px 0;
                border-bottom: 1px solid #f0f0f0;
            }
            .agency-nav-divider {
                width: 100%;
                height: 1px;
                margin: 4px 0;
            }
            .agency-officedb-menu {
                display: none;
                position: static;
                box-shadow: none;
                border: none;
                margin-top: 0;
                padding-left: 16px;
            }
            .agency-officedb-menu.show {
                display: block;
            }
            .agency-officedb-menu a {
                padding: 10px 0 !important;
            }
            .agency-menu-toggle {
                display: flex;
            }
            .agency-name-text {
                display: none;
            }
            .agency-icon-thumb {
                display: block;
            }
            .user-dropdown-arrow {
                display: none;
            }
            .dropdown-indicator {
                display: none;
            }
        }
