html, body { height: 100%; margin: 0; padding: 0; font-family: sans-serif; display: flex; flex-direction: column; overflow: hidden; background-color: #f8f9fa; }
      .control-panel { padding: 10px; background-color: #222; border-bottom: 1px solid #444; z-index: 20; display: flex; justify-content: space-between; align-items: center; color: white; }
      
      /* ★追加：部署フィルターのエリア */
      #deptFilterBar { display: flex; overflow-x: auto; gap: 8px; padding: 8px 10px; background: #333; border-bottom: 2px solid #2196F3; white-space: nowrap; align-items: center; z-index: 10; }
      .dept-btn { padding: 6px 12px; border-radius: 20px; font-size: 12px; font-weight: bold; border: 1px solid #777; background: #555; color: #ccc; cursor: pointer; transition: 0.2s; }
      .dept-btn.active { background: #2196F3; color: white; border-color: #1976D2; box-shadow: 0 0 5px rgba(33, 150, 243, 0.5); }

      #map { flex-grow: 1; width: 100%; }
      button { padding: 10px 15px; font-size: 14px; cursor: pointer; border-radius: 5px; border: none; font-weight: bold; }
      .btn-primary { background: #2196F3; color: white; }
      .btn-reload { background: #fff; color: #333; border: 1px solid #ccc; padding: 8px 12px; }
      .polygon-label { text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000; }
      .signboard-label { background: rgba(255,255,255,0.95); padding: 2px 6px; border-radius: 4px; border: 1px solid #666; font-size: 11px; font-weight: bold; margin-top: 5px; color: #000; }
      
      #scheduleModal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); z-index: 4000; justify-content: center; align-items: center; }
      .modal-content { background: #fff; color: #333; padding: 0; border-radius: 8px; width: 95%; max-width: 900px; height: 90%; display: flex; flex-direction: column; overflow: hidden; }
      .modal-header { background: #2196F3; color: white; padding: 15px; font-size: 18px; font-weight: bold; display: flex; justify-content: space-between; align-items: center; }
      .modal-body { flex: 1; overflow-y: auto; padding: 10px; background: #f4f6f8; }

      /* マイページ等の汎用モーダル */
      #modal {
        display: none;
        position: fixed;
        z-index: 12000;
        top: 0; left: 0;
        width: 100%; height: 100%;
        background: rgba(0,0,0,0.6);
        justify-content: center;
        align-items: center;
        box-sizing: border-box;
        padding: 16px;
      }
      #modal #modalBody {
        background: #fff;
        color: #333;
        padding: 20px;
        border-radius: 12px;
        width: 100%;
        max-width: 400px;
        max-height: 85vh;
        overflow-y: auto;
        box-shadow: 0 4px 20px rgba(0,0,0,0.3);
        box-sizing: border-box;
        height: auto;
        display: block;
      }
      
      table { width: 100%; border-collapse: collapse; font-size: 12px; background: white; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
      th, td { padding: 8px; border: 1px solid #ddd; text-align: left; white-space: nowrap; }
      th { background-color: #e3f2fd; color: #1a73e8; position: sticky; top: 0; z-index: 10; box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1); }
      .overdue-row { background-color: #ffebee; color: #d32f2f; font-weight: bold; }
      
      .legend { display: flex; gap: 10px; font-size: 11px; padding: 5px; background: #333; border-radius: 4px; margin-right: 10px;}
      .leg-item { display: flex; align-items: center; gap: 3px; }
      .leg-color { width: 12px; height: 12px; border-radius: 2px; }
    
      /* スマホで見切れないように横スクロール対応 */
      @media screen and (max-width: 768px) {
        .control-panel { flex-wrap: wrap; gap: 8px; padding: 10px 5px; }
        .control-panel-buttons { width: 100%; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
        .control-panel-buttons::-webkit-scrollbar { height: 4px; }
        .control-panel-buttons::-webkit-scrollbar-thumb { background: #888; border-radius: 2px; }
        .control-panel-buttons > * { flex-shrink: 0; } /* モバイルでボタンが潰れないように */
      }

      /* -------------------------------------------
         下部ナビバー & アクションシート（PC / モバイル共通）
      ------------------------------------------- */
      .desktop-only { display: none !important; }

      .mobile-bottom-bar {
        display: flex;
        background: #fff;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        z-index: 1000;
        padding-bottom: env(safe-area-inset-bottom);
        justify-content: center;
        flex-shrink: 0;
        border-top: 1px solid #e0e0e0;
      }
      .mobile-bottom-bar button {
        flex: 1;
        max-width: 120px;
        background: none;
        border: none;
        padding: 10px 5px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        font-size: 11px;
        color: #555;
        border-radius: 0;
      }
      .mobile-bottom-bar button:hover { background: #f5f5f5; }
      .mobile-bottom-bar button:active { background: #f0f0f0; }

      .mobile-action-sheet {
        display: none;
        position: fixed;
        top: 0; left: 0; width: 100%; height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 5000;
        justify-content: center;
        align-items: flex-end;
      }
      .action-sheet-content {
        background: #fff;
        width: 100%;
        max-width: 480px;
        border-radius: 15px 15px 0 0;
        display: flex;
        flex-direction: column;
        padding-bottom: env(safe-area-inset-bottom);
        box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
        box-sizing: border-box;
        overflow: hidden;
      }
      .action-sheet-content input,
      .action-sheet-content select {
        max-width: 100%;
        box-sizing: border-box;
      }
      .action-sheet-content button {
        background: none; border: none; padding: 18px; font-size: 16px; color: #333;
        border-bottom: 1px solid #eee; text-align: center; border-radius: 0; width: 100%; font-weight: bold;
      }
      .action-sheet-content button:active {
        background: #f0f0f0;
      }
      .action-sheet-content button.cancel-btn {
        color: #f44336; border-bottom: none;
      }